From 0c29256050564b18a8cd1c202ba92ccbadc8c650 Mon Sep 17 00:00:00 2001 From: "arya.k" Date: Wed, 16 Sep 2015 17:07:01 +0530 Subject: [PATCH] [TIZEN] Enriched RE Sample Application with nested resource attribute. Change-Id: I2b32519b1f107421c834e4bd8ac22467cd3b1c7f Signed-off-by: arya.k Reviewed-on: https://gerrit.iotivity.org/gerrit/2587 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- .../tizen/NestedAttributeClientApp/.cproject | 519 ++++++++++++++++++ .../tizen/NestedAttributeClientApp/.exportMap | 4 + .../tizen/NestedAttributeClientApp/.project | 43 ++ .../edc_resource/re_client_control.edc | 137 +++++ .../edc_resource/re_container_control.edc | 123 +++++ .../tizen/NestedAttributeClientApp/inc/reclient.h | 32 ++ .../NestedAttributeClientApp/inc/reclientmain.h | 50 ++ .../inc/recontainerclient.h | 48 ++ .../NestedAttributeClientApp/res/ui_controls.edc | 26 + .../shared/res/resampleapp.png | Bin 0 -> 57662 bytes .../NestedAttributeClientApp/src/reclient.cpp | 580 ++++++++++++++++++++ .../NestedAttributeClientApp/src/reclientmain.cpp | 260 +++++++++ .../src/recontainerclient.cpp | 199 +++++++ .../NestedAttributeClientApp/tizen-manifest.xml | 13 + .../tizen/NestedAttributeServerApp/.cproject | 520 ++++++++++++++++++ .../tizen/NestedAttributeServerApp/.exportMap | 4 + .../tizen/NestedAttributeServerApp/.project | 43 ++ .../edc_resource/re_server_control.edc | 137 +++++ .../tizen/NestedAttributeServerApp/inc/reserver.h | 45 ++ .../NestedAttributeServerApp/inc/reservermain.h | 50 ++ .../NestedAttributeServerApp/res/ui_controls.edc | 25 + .../shared/res/resampleapp.png | Bin 0 -> 57662 bytes .../NestedAttributeServerApp/src/reserver.cpp | 592 +++++++++++++++++++++ .../NestedAttributeServerApp/src/reservermain.cpp | 257 +++++++++ .../NestedAttributeServerApp/tizen-manifest.xml | 13 + 25 files changed, 3720 insertions(+) create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.cproject create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.exportMap create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.project create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/edc_resource/re_client_control.edc create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/edc_resource/re_container_control.edc create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/reclient.h create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/reclientmain.h create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/recontainerclient.h create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/res/ui_controls.edc create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/shared/res/resampleapp.png create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/src/reclient.cpp create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/src/reclientmain.cpp create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/src/recontainerclient.cpp create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/tizen-manifest.xml create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.cproject create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.exportMap create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.project create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/edc_resource/re_server_control.edc create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/inc/reserver.h create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/inc/reservermain.h create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/res/ui_controls.edc create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/shared/res/resampleapp.png create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/src/reserver.cpp create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/src/reservermain.cpp create mode 100644 service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/tizen-manifest.xml diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.cproject b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.cproject new file mode 100644 index 0000000..fc79a18 --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.cproject @@ -0,0 +1,519 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.exportMap b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.exportMap new file mode 100644 index 0000000..43e310e --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.exportMap @@ -0,0 +1,4 @@ +{ + global: main; + local: *; +}; diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.project b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.project new file mode 100644 index 0000000..2d9d95a --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/.project @@ -0,0 +1,43 @@ + + + NestedAttributeClient + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + org.tizen.nativecore.apichecker.core.builder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.tizen.nativecore.apichecker.core.tizenCppNature + + + + 0 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-projectRelativePath-matches-false-false-*/.tpk + + + + diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/edc_resource/re_client_control.edc b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/edc_resource/re_client_control.edc new file mode 100644 index 0000000..e936bbb --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/edc_resource/re_client_control.edc @@ -0,0 +1,137 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#define POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 15 +#define POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC 96 + +group +{ + name: "group_layout"; + parts + { + part + { + name: "find_button"; + type: SWALLOW; + scale: 1; + description + { + rel1.relative: 0.01 0.01; + rel2.relative: 0.7 0.09; + } + } + part + { + name: "list"; + type: SWALLOW; + scale: 1; + description + { + rel1.relative: 0.01 0.1; + rel2.relative: 0.99 0.7; + } + } + part + { + name: "log_bg"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + rel1.relative: 0.01 0.71; + rel2.relative: 0.98 1.0; + color: 220 220 220 255; + } + } + part + { + name: "log"; + type: SWALLOW; + scale: 1; + description + { + rel1.to: "log_bg"; + rel2.to: "log_bg"; + } + } + } +} + +group +{ + name: "popup_datetime_text"; + parts + { + part + { + name: "pad_l"; + type: SPACER; + scale: 1; + description + { + state: "default" 0.0; + min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0; + fixed: 1 0; + rel1.relative: 0.0 0.0; + rel2.relative: 0.0 1.0; + align: 0.0 0.0; + } + } + part + { + name: "pad_r"; + type: SPACER; + scale: 1; + description + { + state: "default" 0.0; + min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0; + fixed: 1 0; + rel1.relative: 1.0 0.0; + rel2.relative: 1.0 1.0; + align: 1.0 0.0; + } + } + part + { + name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + description + { + state: "default" 0.0; + min: 0 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC; + max: -1 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC; + align: 0.5 0.5; + rel1 + { + relative: 1.0 0.0; + to_x: "pad_l"; + } + rel2 + { + relative: 0.0 1.0; + to_x: "pad_r"; + } + } + } + } +} diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/edc_resource/re_container_control.edc b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/edc_resource/re_container_control.edc new file mode 100644 index 0000000..e394253 --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/edc_resource/re_container_control.edc @@ -0,0 +1,123 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +group +{ + name: "container_layout"; + parts + { + part + { + name: "listnew"; + type: SWALLOW; + scale: 1; + description + { + rel1.relative: 0.01 0.1; + rel2.relative: 0.99 0.7; + } + } + part + { + name: "log_bg"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + rel1.relative: 0.01 0.71; + rel2.relative: 0.98 1.0; + color: 220 220 220 255; + } + } + part + { + name: "log"; + type: SWALLOW; + scale: 1; + description + { + rel1.to: "log_bg"; + rel2.to: "log_bg"; + } + } + } +} + +group +{ + name: "popup_datetime_text"; + parts + { + part + { + name: "pad_l"; + type: SPACER; + scale: 1; + description + { + state: "default" 0.0; + min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0; + fixed: 1 0; + rel1.relative: 0.0 0.0; + rel2.relative: 0.0 1.0; + align: 0.0 0.0; + } + } + part + { + name: "pad_r"; + type: SPACER; + scale: 1; + description + { + state: "default" 0.0; + min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0; + fixed: 1 0; + rel1.relative: 1.0 0.0; + rel2.relative: 1.0 1.0; + align: 1.0 0.0; + } + } + part + { + name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + description + { + state: "default" 0.0; + min: 0 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC; + max: -1 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC; + align: 0.5 0.5; + rel1 + { + relative: 1.0 0.0; + to_x: "pad_l"; + } + rel2 + { + relative: 0.0 1.0; + to_x: "pad_r"; + } + } + } + } +} diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/reclient.h b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/reclient.h new file mode 100644 index 0000000..376521c --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/reclient.h @@ -0,0 +1,32 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#ifndef RECLIENT_H__ +#define RECLIENT_H__ + +# define DEFAULT_FANSPEED 45 +# define DEFAULT_AIRSPEED 450 + +typedef void(*ClientMenuHandler)(); +typedef int ReturnValue; + +void *showClientAPIs(void *data); + +#endif // RECLIENT_H__ diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/reclientmain.h b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/reclientmain.h new file mode 100644 index 0000000..33c6531 --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/reclientmain.h @@ -0,0 +1,50 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#ifndef RECLIENTMAIN_H__ +#define RECLIENTMAIN_H__ + +#include +#include +#include +#include +#include + +#include "OCPlatform.h" +#include "OCApi.h" + +using namespace OC; + +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "reclientmain" + +#if !defined(PACKAGE) +#define PACKAGE "org.tizen.nestedattributeclient" +#endif + +#define ELM_DEMO_EDJ "opt/usr/apps/org.tizen.nestedattributeclient/res/ui_controls.edj" + +void group_cb(void *data, Evas_Object *obj, void *event_info); + +void containerCreateUI(void *data, Evas_Object *obj, void *event_info); + +#endif // RECLIENTMAIN_H__ diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/recontainerclient.h b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/recontainerclient.h new file mode 100644 index 0000000..5ec7c79 --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/inc/recontainerclient.h @@ -0,0 +1,48 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#include "reclientmain.h" + +#include "RCSRemoteResourceObject.h" + +#include +#include +#include +#include +#include + +#ifndef RECONTAINER_H__ +#define RECONTAINER_H__ + +# define LOG_TAG "recontainerclient" + +using namespace OIC::Service; + +void *showContainerAPIs(void *data); + +void onContainerDiscovered(std::shared_ptr foundResource); + +static void find_resource_cb(void *data, Evas_Object *obj, void *event_info); + +static void findLight(void *data, Evas_Object *obj, void *event_info); + +static void findSoftsensor(void *data, Evas_Object *obj, void *event_info); + +#endif // RECONTAINER_H__ \ No newline at end of file diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/res/ui_controls.edc b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/res/ui_controls.edc new file mode 100644 index 0000000..66a5509 --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/res/ui_controls.edc @@ -0,0 +1,26 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +collections +{ + base_scale: 1.8; + #include "../edc_resource/re_client_control.edc" + #include "../edc_resource/re_container_control.edc" +} \ No newline at end of file diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/shared/res/resampleapp.png b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/shared/res/resampleapp.png new file mode 100644 index 0000000000000000000000000000000000000000..9765b1bda7e5bddf0925555ab204b887a873bf24 GIT binary patch literal 57662 zcmdU&2Y{Bv)wXAQhoyJerGpfaq9DE5J1S~atXN|Avn3kQ*!`l$D2ie%v3Ct9iU9$! zARxVWkS4wCvh_dLJny{>uV6_upZ~zTGjrz5nKS2}_RLfEz7vl>A}6zMrgJXms3ZHI zY~lal(^KvD>g2b^T99$|k!M`zTvj!Ff*bL4ZRavixU^rt6HmP4s_U=1?vksn&O54K zzr3rjz3Spie}9p4H!U1_%FscltgqRlVCl}j$J~4S-;TNJ8N(x+7h3`nl`#k2P&{pByWKUm|WHre-Q&QDvN|NLL>eBs{vzbanwhZioN zJGS84sb!<)^<4YLj*;(APaB_}{rHg`PwISo_N#pxR#|@M=aVL{SlzDou*{}cyWI5m zFU-HLv`K<1ysdlpgBp)d`cVb&Nq{W}Uo#k#HS@`5165LsT%de5} z>?1C(+C}&Fcb6RQ-k5&c{R7 zy7#VDF8L2`$QMnT+~ofJq^mw~`{~`c9rRZ2+SX>NC*SKnrfJs!!_G=?drjKur?+d^ za@tX~4yxYeyu|ZH^lmrd<|peMGOSbO`OD}^=eFH2 zF15Vz`RA`HTQmLjt9v`Q;`-ZWl(lL9e%;#-Prdz$vgey^PQK)vtY`nH;DL+ZtK55( zdv^W8(|25rZ3aB|@R$V))~sGV|L945&pPj`({C*sI^o>$rQvN1Z=raO>);PO5s%U;2-D zaK|ApHomX#Ut4|FY-ag|E0?t?PU^X=vwP>Vo(X?=r0pwbUy!u>m=?K%uOGj%z`5-o zU-jwimgz~iUvlS)={J^d=~a5fv(4P?7a#T4Yn(f$f75n@zIwmc=jqP%e|A{wcly-Z z`DyJo<5TN@nzH!Qtdb#J{@l0eqzQd<`(|Evd;M#Nw0h%?zAf*b`c8w^L)y>o-JsL> zlP9w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C?=&9O5ZR~{Dc@Xo)ab&y4LC9i7xGCmoe0{MD!5urgm^q=g69ZU~%imq0h0 zFZ2!4Ot9BIRaYKmR{oN3@*X{2^C5O$DP8HE&8W8hI-bfv}r zLm?dqClFOubrXh8^{FoLS^1eJ>rn&qMdJs|Uwo2!1ic#Vf?b-djrddQ~P z@y7aJ0~5V)`)m9EIjE6pUO5nCT29W(%d2Uh+WEa1@I+I(nS~L$K_g`J5D3ZoPeU1s z5cx_Y*XlJ=`63J7wzuLQTfTfbkIwQS&96GmQuqE`sGIVCGoVT#LQ@oQnVOTEHf`F% zHdQ=f(Z}d*jOItM8iUb8Z}}A?4*G$d%7-CwdC7^%U_{O~AjjFw?|;~{!}Bd4Aemyn zzb!scrN07Q`iG)_lb}jLQd`!VcPK4UMIq`6?FY>(F@k_}g5RW$5yke+hYkW}9Kd?XEQzUukRQ0^7NMWv|@x zwG+T&6#DSD0;1`&kBdyQ56LC)MX~>1olS!p$pSkJiQ^PTspwbpG9e!D!m!-zBA%$k kZ}gYfNaCF}xV$|1>H6z0+kD +#include "mutex" +#include "condition_variable" + +#include "reclientmain.h" + +#include "RCSDiscoveryManager.h" +#include "RCSRemoteResourceObject.h" +#include "RCSResourceAttributes.h" +#include "RCSAddress.h" + +#include "OCPlatform.h" + +# define nestedAtrribute std::vector> +# define checkResource nullptr == resource?false:true + +using namespace std; +using namespace OC; +using namespace OIC::Service; + +constexpr int CORRECT_INPUT = 1; +constexpr int INCORRECT_INPUT = 2; +constexpr int QUIT_INPUT = 3; + +std::shared_ptr resource; + +const std::string defaultKey = "deviceInfo"; +const std::string resourceType = "core.ac"; +const std::string relativeUri = OC_RSRVD_WELL_KNOWN_URI; + +std::mutex mtx; +std::condition_variable cond; + +RCSResourceAttributes model; +RCSResourceAttributes speed; +RCSResourceAttributes airCirculation; +RCSResourceAttributes temperature; +RCSResourceAttributes humidity; +RCSResourceAttributes power; +RCSResourceAttributes capacity; +RCSResourceAttributes weight; +RCSResourceAttributes dimensions; +RCSResourceAttributes red; +RCSResourceAttributes green; + +std::vector generalInfo; +std::vector fan; +std::vector tempSensor; +std::vector efficiency; +std::vector light; + +static Evas_Object *log_entry = NULL; +static Evas_Object *list = NULL; +static Evas_Object *naviframe = NULL; + +typedef struct temperature_popup +{ + Evas_Object *popup; + Evas_Object *entry; +} temperature_popup_fields; + +// Function to update the log in UI +void *updateGroupLog(void *data) +{ + string *log = (string *)data; + // Show the log + elm_entry_entry_append(log_entry, (*log).c_str()); + elm_entry_cursor_end_set(log_entry); + return NULL; +} + +nestedAtrribute createNestedAttribute(int fanSpeed, int airSpeed) +{ + nestedAtrribute *acServer = new nestedAtrribute(); + + model["model"] = "SamsungAC"; + + speed["speed"] = fanSpeed; + airCirculation["air"] = airSpeed; + + temperature["temp"] = 30; + humidity["humidity"] = 30; + + power["power"] = 1600; + capacity["capacity"] = 1; + + weight["weight"] = 3; + dimensions["dimensions"] = "10x25x35"; + + red["red"] = 50; + green["green"] = 60; + + generalInfo.clear(); + generalInfo.push_back(model); + generalInfo.push_back(weight); + generalInfo.push_back(dimensions); + + fan.clear(); + fan.push_back(speed); + fan.push_back(airCirculation); + + tempSensor.clear(); + tempSensor.push_back(temperature); + tempSensor.push_back(humidity); + + efficiency.clear(); + efficiency.push_back(power); + efficiency.push_back(capacity); + + light.clear(); + light.push_back(red); + light.push_back(green); + + if (nullptr == acServer) + { + dlog_print(DLOG_ERROR, LOG_TAG, "#### NULL nestedAtrribute"); + return *acServer; + } + + acServer->push_back(generalInfo); + acServer->push_back(fan); + acServer->push_back(tempSensor); + acServer->push_back(efficiency); + acServer->push_back(light); + + return *acServer; +} + +static void onDestroy() +{ + dlog_print(DLOG_INFO, LOG_TAG, "#### Destroy sequence called"); + resource = nullptr; +} + +void onResourceDiscovered(std::shared_ptr foundResource) +{ + dlog_print(DLOG_INFO, LOG_TAG, "#### onResourceDiscovered callback"); + + std::string resourceURI = foundResource->getUri(); + std::string hostAddress = foundResource->getAddress(); + + dlog_print(DLOG_INFO, LOG_TAG, "#### Resource URI : %s", resourceURI.c_str()); + dlog_print(DLOG_INFO, LOG_TAG, "#### Resource Host : %S", hostAddress.c_str()); + + string logMessage = "Resource Found
"; + logMessage = logMessage + "URI: " + resourceURI + "
"; + logMessage = logMessage + "Host:" + hostAddress + "
"; + logMessage += "----------------------
"; + dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); + + resource = foundResource; + + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showClientAPIs, NULL); + cond.notify_all(); +} + +void onRemoteAttributesReceivedCallback(const RCSResourceAttributes &attributes) +{ + dlog_print(DLOG_INFO, LOG_TAG, "#### onRemoteAttributesReceivedCallback callback"); + + string logMessage = "Remote Attribute Updated :
"; + + if (attributes.empty()) + { + logMessage + logMessage + "Attribute is Empty
"; + return; + } + + for (const auto & attr : attributes) + { + logMessage = logMessage + "==========================
"; + OIC::Service::RCSResourceAttributes::Value attrValue = attr.value(); + std::vector< std::vector> attrVector = + attrValue.get>>(); + + for (auto itr = attrVector.begin(); itr != attrVector.end(); ++itr) + { + std::vector attrKeyVector = *itr; + for (auto itrKey = attrKeyVector.begin(); itrKey != attrKeyVector.end(); ++itrKey) + { + for (const auto & attribute : *itrKey) + { + logMessage = logMessage + attribute.key().c_str() + " : " + + attribute.value().toString().c_str() + "
"; + } + } + std::cout << std::endl; + logMessage = logMessage + "
"; + } + logMessage = logMessage + "==========================
"; + } + + dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); +} + +static void list_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + elm_list_item_selected_set(it, EINA_FALSE); +} + +static void getAttributeFromRemoteServer(void *data, Evas_Object *obj, void *event_info) +{ + if (checkResource) + { + resource->getRemoteAttributes(&onRemoteAttributesReceivedCallback); + } + else + { + dlog_print(DLOG_INFO, LOG_TAG, "#### No Resource to getAttributeFromRemoteServer..."); + } +} + +static void setAttributeToRemoteServer(int fanSpeed, int airSpeed) +{ + string logMessage = ""; + + nestedAtrribute attr = createNestedAttribute(fanSpeed, airSpeed); + RCSResourceAttributes setAttribute; + setAttribute[defaultKey] = attr; + + if (checkResource) + { + resource->setRemoteAttributes(setAttribute, + &onRemoteAttributesReceivedCallback); + } + else + { + logMessage = "No Resource to setAttributeToRemoteServer"; + } + + dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); +} + +void discoverResource() +{ + dlog_print(DLOG_INFO, LOG_TAG, "#### Wait 2 seconds until discovered"); + + RCSDiscoveryManager::getInstance()->discoverResourceByType(RCSAddress::multicast(), relativeUri, + resourceType, &onResourceDiscovered); + + std::unique_lock lck(mtx); + cond.wait_for(lck, std::chrono::seconds(2)); + + dlog_print(DLOG_INFO, LOG_TAG, "#### Discovery over"); +} + +static void +popup_cancel_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + temperature_popup_fields *popup_fields = (temperature_popup_fields *)data; + evas_object_del(popup_fields->popup); + free(popup_fields); +} + +static void +popup_setFanSpeed_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + temperature_popup_fields *popup_fields = (temperature_popup_fields *)data; + Evas_Object *entry = popup_fields->entry; + const char *fanSpeedString = elm_entry_entry_get(entry); + // Remove white spaces(if any) at the beginning + int beginning = 0; + while (fanSpeedString[beginning] == ' ') + { + (beginning)++; + } + + int len = strlen(fanSpeedString); + if (NULL == fanSpeedString || 1 > len) + { + dlog_print(DLOG_INFO, LOG_TAG, "#### Read NULL Fan Speed Value"); + string logMessage = "Fan Speed Cannot be NULL
"; + logMessage += "----------------------
"; + dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage); + } + else + { + int fanSpeed = atoi(fanSpeedString); + string fanString(fanSpeedString); + setAttributeToRemoteServer(fanSpeed, DEFAULT_AIRSPEED); + dlog_print(DLOG_INFO, LOG_TAG, "#### Fan Speed to set : %d", fanSpeed); + + string logMessage = "Fan Speed set to set : " + fanString + "
"; + logMessage += "----------------------
"; + dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); + } + evas_object_del(popup_fields->popup); + free(popup_fields); +} + +static void +popup_setAirSpeed_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + temperature_popup_fields *popup_fields = (temperature_popup_fields *)data; + Evas_Object *entry = popup_fields->entry; + const char *airSpeedString = elm_entry_entry_get(entry); + // Remove white spaces(if any) at the beginning + int beginning = 0; + while (airSpeedString[beginning] == ' ') + { + (beginning)++; + } + + int len = strlen(airSpeedString); + if (NULL == airSpeedString || 1 > len) + { + dlog_print(DLOG_INFO, LOG_TAG, "#### Read NULL Fan Speed Value"); + string logMessage = "Fan Speed Cannot be NULL
"; + logMessage += "----------------------
"; + dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage); + } + else + { + int airSpeed = atoi(airSpeedString); + string airString(airSpeedString); + setAttributeToRemoteServer(DEFAULT_FANSPEED, airSpeed); + dlog_print(DLOG_INFO, LOG_TAG, "#### Fan Speed to set : %d", airSpeed); + + string logMessage = "Fan Speed set to set : " + airString + "
"; + logMessage += "----------------------
"; + dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); + } + evas_object_del(popup_fields->popup); + free(popup_fields); +} + +static void +list_setFanSpeed_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *popup, *btn; + Evas_Object *nf = naviframe; + Evas_Object *entry; + Evas_Object *layout; + + /* popup */ + popup = elm_popup_add(nf); + elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_part_text_set(popup, "title,text", "Enter the Fan Speed"); + + layout = elm_layout_add(popup); + elm_layout_file_set(layout, ELM_DEMO_EDJ, "popup_datetime_text"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_content_set(popup, layout); + + entry = elm_entry_add(layout); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_entry_scrollable_set(entry, EINA_TRUE); + evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + eext_entry_selection_back_event_allow_set(entry, EINA_TRUE); + elm_object_part_text_set(entry, "elm.guide", "Range : 0-100"); + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBER); + elm_object_part_content_set(layout, "elm.swallow.content", entry); + + temperature_popup_fields *popup_fields; + popup_fields = (temperature_popup_fields *)malloc(sizeof(temperature_popup_fields)); + if (NULL == popup_fields) + { + dlog_print(DLOG_INFO, LOG_TAG, "#### Memory allocation failed"); + } + else + { + popup_fields->popup = popup; + popup_fields->entry = entry; + } + + /* Cancel button */ + btn = elm_button_add(popup); + elm_object_style_set(btn, "popup"); + elm_object_text_set(btn, "Cancel"); + elm_object_part_content_set(popup, "button1", btn); + evas_object_smart_callback_add(btn, "clicked", popup_cancel_clicked_cb, popup_fields); + + /* Set button */ + btn = elm_button_add(popup); + elm_object_style_set(btn, "popup"); + elm_object_text_set(btn, "Set"); + elm_object_part_content_set(popup, "button2", btn); + evas_object_smart_callback_add(btn, "clicked", popup_setFanSpeed_clicked_cb, popup_fields); + + evas_object_show(popup); +} + +static void +list_setAirSpeed_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *popup, *btn; + Evas_Object *nf = naviframe; + Evas_Object *entry; + Evas_Object *layout; + + /* popup */ + popup = elm_popup_add(nf); + elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_part_text_set(popup, "title,text", "Enter the Fan Speed"); + + layout = elm_layout_add(popup); + elm_layout_file_set(layout, ELM_DEMO_EDJ, "popup_datetime_text"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_content_set(popup, layout); + + entry = elm_entry_add(layout); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_entry_scrollable_set(entry, EINA_TRUE); + evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + eext_entry_selection_back_event_allow_set(entry, EINA_TRUE); + elm_object_part_text_set(entry, "elm.guide", "Range : 0-500"); + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBER); + elm_object_part_content_set(layout, "elm.swallow.content", entry); + + temperature_popup_fields *popup_fields; + popup_fields = (temperature_popup_fields *)malloc(sizeof(temperature_popup_fields)); + if (NULL == popup_fields) + { + dlog_print(DLOG_INFO, LOG_TAG, "#### Memory allocation failed"); + } + else + { + popup_fields->popup = popup; + popup_fields->entry = entry; + } + + /* Cancel button */ + btn = elm_button_add(popup); + elm_object_style_set(btn, "popup"); + elm_object_text_set(btn, "Cancel"); + elm_object_part_content_set(popup, "button1", btn); + evas_object_smart_callback_add(btn, "clicked", popup_cancel_clicked_cb, popup_fields); + + /* Set button */ + btn = elm_button_add(popup); + elm_object_style_set(btn, "popup"); + elm_object_text_set(btn, "Set"); + elm_object_part_content_set(popup, "button2", btn); + evas_object_smart_callback_add(btn, "clicked", popup_setAirSpeed_clicked_cb, popup_fields); + + evas_object_show(popup); +} + +// Method to be called when the Discover Resource UI Button is selected +static void +find_resource_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (NULL != list) + { + discoverResource(); + } + else + { + dlog_print(DLOG_ERROR, "find_resource_cb", "list is NULL - So unable to add items!!!"); + } +} + +void *showClientAPIs(void *data) +{ + // Add items to the list only if the list is empty + const Eina_List *eina_list = elm_list_items_get(list); + int count = eina_list_count(eina_list); + if (!count) + { + elm_list_item_append(list, "3. Get Remote Attribute", NULL, NULL, + getAttributeFromRemoteServer, NULL); + + elm_list_item_append(list, "4. Set Fan Speed", NULL, NULL, + list_setFanSpeed_cb, NULL); + + elm_list_item_append(list, "4. Set Air Circulation Speed", NULL, NULL, + list_setAirSpeed_cb, NULL); + + elm_list_go(list); + } + return NULL; +} + +static Eina_Bool +naviframe_pop_cb(void *data, Elm_Object_Item *it) +{ + onDestroy(); + + if (NULL != log_entry) + { + evas_object_del(log_entry); + log_entry = NULL; + } + if (NULL != list) + { + evas_object_del(list); + list = NULL; + } + return EINA_TRUE; +} + +// Method to be called when the Group APIs UI Button is selected +void group_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout; + Evas_Object *scroller; + Evas_Object *nf = (Evas_Object *)data; + Evas_Object *find_button; + Elm_Object_Item *nf_it; + + naviframe = nf; + + // Scroller + scroller = elm_scroller_add(nf); + elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE); + elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); + + // Layout + layout = elm_layout_add(nf); + elm_layout_file_set(layout, ELM_DEMO_EDJ, "group_layout"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_object_content_set(scroller, layout); + + // Button + find_button = elm_button_add(layout); + elm_object_part_content_set(layout, "find_button", find_button); + elm_object_text_set(find_button, "Discover Resource"); + evas_object_smart_callback_add(find_button, "clicked", find_resource_cb, NULL); + + // List + list = elm_list_add(layout); + elm_list_mode_set(list, ELM_LIST_COMPRESS); + evas_object_smart_callback_add(list, "selected", list_selected_cb, NULL); + elm_object_part_content_set(layout, "list", list); + elm_list_go(list); + + // log_entry - textarea for log + log_entry = elm_entry_add(layout); + elm_entry_scrollable_set(log_entry, EINA_TRUE); + elm_entry_editable_set(log_entry, EINA_FALSE); + elm_object_part_text_set(log_entry, "elm.guide", "Logs will be updated here!!!"); + evas_object_size_hint_weight_set(log_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(log_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(layout, "log", log_entry); + + nf_it = elm_naviframe_item_push(nf, "Resource Encapsulation", NULL, NULL, scroller, NULL); + elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, NULL); +} diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/src/reclientmain.cpp b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/src/reclientmain.cpp new file mode 100644 index 0000000..4d3ac6c --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/src/reclientmain.cpp @@ -0,0 +1,260 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#include "reclientmain.h" +#include + +#include "OCPlatform.h" +#include "OCApi.h" + +typedef struct appdata +{ + Evas_Object *win; + Evas_Object *conform; + Evas_Object *layout; + Evas_Object *nf; + Evas_Object *findButton; + Evas_Object *logtext; + Evas_Object *listview; +} appdata_s; + +static void +win_delete_request_cb(void *data , Evas_Object *obj , void *event_info) +{ + ui_app_exit(); +} + +static void +list_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + elm_list_item_selected_set(it, EINA_FALSE); +} + +static Eina_Bool +naviframe_pop_cb(void *data, Elm_Object_Item *it) +{ + ui_app_exit(); + return EINA_FALSE; +} + +static void +create_list_view(appdata_s *ad) +{ + Evas_Object *list; + Evas_Object *btn; + Evas_Object *nf = ad->nf; + Elm_Object_Item *nf_it; + + // List + list = elm_list_add(nf); + elm_list_mode_set(list, ELM_LIST_COMPRESS); + evas_object_smart_callback_add(list, "selected", list_selected_cb, NULL); + + // Main Menu Items Here + elm_list_item_append(list, "Resource Client", NULL, NULL, group_cb, nf); + + elm_list_item_append(list, "Resource Container", NULL, NULL, containerCreateUI, nf); + + elm_list_go(list); + + // This button is set for devices which doesn't have H/W back key. + btn = elm_button_add(nf); + elm_object_style_set(btn, "naviframe/end_btn/default"); + nf_it = elm_naviframe_item_push(nf, "Resource Encapsulation", btn, NULL, list, NULL); + elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, ad->win); +} + + +static void +create_base_gui(appdata_s *ad) +{ + // Window + ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE); + elm_win_conformant_set(ad->win, EINA_TRUE); + elm_win_autodel_set(ad->win, EINA_TRUE); + + if (elm_win_wm_rotation_supported_get(ad->win)) + { + int rots[4] = { 0, 90, 180, 270 }; + elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4); + } + + evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL); + + // Conformant + ad->conform = elm_conformant_add(ad->win); + evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(ad->win, ad->conform); + evas_object_show(ad->conform); + + // Base Layout + ad->layout = elm_layout_add(ad->conform); + evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_layout_theme_set(ad->layout, "layout", "application", "default"); + evas_object_show(ad->layout); + + elm_object_content_set(ad->conform, ad->layout); + + // Naviframe + ad->nf = elm_naviframe_add(ad->layout); + create_list_view(ad); + elm_object_part_content_set(ad->layout, "elm.swallow.content", ad->nf); + eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL); + eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL); + + // Show window after base gui is set up + evas_object_show(ad->win); +} + +// Configures the OCPlatform +static void +configure_platform() +{ + try + { + PlatformConfig config + { OC::ServiceType::InProc, ModeType::Client, "0.0.0.0", 0, OC::QualityOfService::LowQos }; + + OCPlatform::Configure(config); + + dlog_print(DLOG_INFO, LOG_TAG, "#### Platform configuration done!!!!"); + } + catch (OCException &e) + { + dlog_print(DLOG_ERROR, LOG_TAG, "Exception occured! (%s)", e.what()); + } +} + +static bool +app_create(void *data) +{ + /* Hook to take necessary actions before main event loop starts + Initialize UI resources and application's data + If this function returns true, the main loop of application starts + If this function returns false, the application is terminated */ + appdata_s *ad = (appdata_s *)data; + + elm_app_base_scale_set(1.8); + + create_base_gui(ad); + + configure_platform(); + + return true; +} + +static void +app_control(app_control_h app_control, void *data) +{ + // Handle the launch request. +} + +static void +app_pause(void *data) +{ + // Take necessary actions when application becomes invisible. +} + +static void +app_resume(void *data) +{ + // Take necessary actions when application becomes visible. +} + +static void +app_terminate(void *data) +{ + // Release all resources. +} + +static void +ui_app_lang_changed(app_event_info_h event_info, void *user_data) +{ + // APP_EVENT_LANGUAGE_CHANGED + char *locale = NULL; + system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale); + elm_language_set(locale); + free(locale); + return; +} + +static void +ui_app_orient_changed(app_event_info_h event_info, void *user_data) +{ + // APP_EVENT_DEVICE_ORIENTATION_CHANGED + return; +} + +static void +ui_app_region_changed(app_event_info_h event_info, void *user_data) +{ + // APP_EVENT_REGION_FORMAT_CHANGED +} + +static void +ui_app_low_battery(app_event_info_h event_info, void *user_data) +{ + // APP_EVENT_LOW_BATTERY +} + +static void +ui_app_low_memory(app_event_info_h event_info, void *user_data) +{ + // APP_EVENT_LOW_MEMORY +} + +int +main(int argc, char *argv[]) +{ + appdata_s ad = {0,}; + int ret = 0; + + ui_app_lifecycle_callback_s event_callback = {0,}; + app_event_handler_h handlers[5] = {NULL, }; + + event_callback.create = app_create; + event_callback.terminate = app_terminate; + event_callback.pause = app_pause; + event_callback.resume = app_resume; + event_callback.app_control = app_control; + + ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, + ui_app_low_battery, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, + ui_app_low_memory, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], + APP_EVENT_DEVICE_ORIENTATION_CHANGED, + ui_app_orient_changed, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], + APP_EVENT_LANGUAGE_CHANGED, + ui_app_lang_changed, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], + APP_EVENT_REGION_FORMAT_CHANGED, + ui_app_region_changed, &ad); + ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]); + + ret = ui_app_main(argc, argv, &event_callback, &ad); + if (APP_ERROR_NONE != ret) + { + dlog_print(DLOG_ERROR, LOG_TAG, "app_main() is failed. err = %d", ret); + } + return ret; +} diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/src/recontainerclient.cpp b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/src/recontainerclient.cpp new file mode 100644 index 0000000..40662a7 --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/src/recontainerclient.cpp @@ -0,0 +1,199 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#include "recontainerclient.h" + +#include "reclientmain.h" +#include "RCSDiscoveryManager.h" +#include "RCSResourceAttributes.h" +#include "RCSAddress.h" + +#include +#include "mutex" +#include "condition_variable" + +using namespace std; +using namespace OC; +using namespace OIC::Service; + +std::shared_ptr g_containerResource; + +const std::string resourceTypeLight = "?rt=oic.light.control"; +const std::string resourceTypeSoftsensor = "?rt=oic.softsensor"; +const std::string targetLightUri = OC_RSRVD_WELL_KNOWN_URI + resourceTypeLight; +const std::string targetSoftsensorUri = OC_RSRVD_WELL_KNOWN_URI + resourceTypeSoftsensor; + +std::mutex g_containerMtx; +std::condition_variable g_containerCond; + +static Evas_Object *log_entry = NULL; +static Evas_Object *listnew = NULL; +static Evas_Object *naviframe = NULL; + +// Function to update the log in UI +void *updateContainerLog(void *data) +{ + string *log = (string *)data; + // Show the log + elm_entry_entry_append(log_entry, (*log).c_str()); + elm_entry_cursor_end_set(log_entry); + return NULL; +} + +static void list_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + elm_list_item_selected_set(it, EINA_FALSE); +} + +static void onDestroy() +{ + g_containerResource = NULL; +} + +void onContainerDiscovered(std::shared_ptr foundResource) +{ + dlog_print(DLOG_INFO, LOG_TAG, "#### onResourceDiscovered callback"); + + std::string resourceURI = foundResource->getUri(); + std::string hostAddress = foundResource->getAddress(); + + dlog_print(DLOG_INFO, LOG_TAG, "#### Resource URI : %s", resourceURI.c_str()); + dlog_print(DLOG_INFO, LOG_TAG, "#### Resource Host : %S", hostAddress.c_str()); + + string logMessage = "Resource Found
"; + logMessage = logMessage + "URI: " + resourceURI + "
"; + logMessage = logMessage + "Host:" + hostAddress + "
"; + logMessage += "----------------------
"; + dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog, + &logMessage); + + g_containerResource = foundResource; + + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showContainerAPIs, NULL); + g_containerCond.notify_all(); +} + +void *showContainerAPIs(void *data) +{ + // Add items to the list only if the list is empty + const Eina_List *eina_list = elm_list_items_get(listnew); + int count = eina_list_count(eina_list); + if (!count) + { + elm_list_item_append(listnew, "1. Find Light resource", NULL, NULL, + findLight, NULL); + + elm_list_item_append(listnew, "1. Find Softsensor resource", NULL, NULL, + findSoftsensor, NULL); + + elm_list_go(listnew); + } + return NULL; +} + +static void findLight(void *data, Evas_Object *obj, void *event_info) +{ + dlog_print(DLOG_INFO, LOG_TAG, "#### Wait 2 seconds until discovered"); + + RCSDiscoveryManager::getInstance()->discoverResource(RCSAddress::multicast(), targetLightUri, + &onContainerDiscovered); + + std::unique_lock lck(g_containerMtx); + g_containerCond.wait_for(lck, std::chrono::seconds(2)); + + dlog_print(DLOG_INFO, LOG_TAG, "#### Light Discovery over"); +} + +static void findSoftsensor(void *data, Evas_Object *obj, void *event_info) +{ + dlog_print(DLOG_INFO, LOG_TAG, "#### Wait 2 seconds until discovered"); + + RCSDiscoveryManager::getInstance()->discoverResource(RCSAddress::multicast(), targetSoftsensorUri, + &onContainerDiscovered); + + std::unique_lock lck(g_containerMtx); + g_containerCond.wait_for(lck, std::chrono::seconds(2)); + + dlog_print(DLOG_INFO, LOG_TAG, "#### Softsensor Discovery over"); +} + +static Eina_Bool +naviframe_pop_cb(void *data, Elm_Object_Item *it) +{ + onDestroy(); + + if (NULL != log_entry) + { + evas_object_del(log_entry); + log_entry = NULL; + } + if (NULL != listnew) + { + evas_object_del(listnew); + listnew = NULL; + } + return EINA_TRUE; +} + +// Method to set up server screens +void containerCreateUI(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout; + Evas_Object *scroller; + Evas_Object *nf = (Evas_Object *)data; + Elm_Object_Item *nf_it; + naviframe = nf; + + // Scroller + scroller = elm_scroller_add(nf); + elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE); + elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); + + // Layout + layout = elm_layout_add(nf); + elm_layout_file_set(layout, ELM_DEMO_EDJ, "container_layout"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_object_content_set(scroller, layout); + + // List + listnew = elm_list_add(layout); + elm_list_mode_set(listnew, ELM_LIST_COMPRESS); + evas_object_smart_callback_add(listnew, "selected", list_selected_cb, NULL); + elm_object_part_content_set(layout, "listnew", listnew); + elm_list_go(listnew); + + // log_entry - text area for log + log_entry = elm_entry_add(layout); + elm_entry_scrollable_set(log_entry, EINA_TRUE); + elm_entry_editable_set(log_entry, EINA_FALSE); + elm_object_part_text_set(log_entry, "elm.guide", "Logs will be updated here!!!"); + evas_object_size_hint_weight_set(log_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(log_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(layout, "log", log_entry); + + nf_it = elm_naviframe_item_push(nf, "Resource Container", NULL, NULL, scroller, NULL); + elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, NULL); + + // Show the UI list of group APIs + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showContainerAPIs, NULL); +} diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/tizen-manifest.xml b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/tizen-manifest.xml new file mode 100644 index 0000000..f53b166 --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeClientApp/tizen-manifest.xml @@ -0,0 +1,13 @@ + + + + + + resampleapp.png + + + http://tizen.org/privilege/network.get + http://tizen.org/privilege/internet + + true + diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.cproject b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.cproject new file mode 100644 index 0000000..61e6e5a --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.cproject @@ -0,0 +1,520 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.exportMap b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.exportMap new file mode 100644 index 0000000..43e310e --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.exportMap @@ -0,0 +1,4 @@ +{ + global: main; + local: *; +}; diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.project b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.project new file mode 100644 index 0000000..f4a551a --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/.project @@ -0,0 +1,43 @@ + + + NestedAttributeServer + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + org.tizen.nativecore.apichecker.core.builder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.tizen.nativecore.apichecker.core.tizenCppNature + + + + 0 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-projectRelativePath-matches-false-false-*/.tpk + + + + diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/edc_resource/re_server_control.edc b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/edc_resource/re_server_control.edc new file mode 100644 index 0000000..ca4dbfc --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/edc_resource/re_server_control.edc @@ -0,0 +1,137 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#define POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 15 +#define POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC 96 + +group +{ + name: "server_layout"; + parts + { + part + { + name: "find_button"; + type: SWALLOW; + scale: 1; + description + { + rel1.relative: 0.01 0.01; + rel2.relative: 0.5 0.09; + } + } + part + { + name: "list"; + type: SWALLOW; + scale: 1; + description + { + rel1.relative: 0.01 0.1; + rel2.relative: 0.99 0.7; + } + } + part + { + name: "log_bg"; + type: RECT; + scale: 1; + description + { + state: "default" 0.0; + rel1.relative: 0.01 0.51; + rel2.relative: 0.98 1.0; + color: 220 220 220 255; + } + } + part + { + name: "log"; + type: SWALLOW; + scale: 1; + description + { + rel1.to: "log_bg"; + rel2.to: "log_bg"; + } + } + } +} + +group +{ + name: "popup_datetime_text"; + parts + { + part + { + name: "pad_l"; + type: SPACER; + scale: 1; + description + { + state: "default" 0.0; + min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0; + fixed: 1 0; + rel1.relative: 0.0 0.0; + rel2.relative: 0.0 1.0; + align: 0.0 0.0; + } + } + part + { + name: "pad_r"; + type: SPACER; + scale: 1; + description + { + state: "default" 0.0; + min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0; + fixed: 1 0; + rel1.relative: 1.0 0.0; + rel2.relative: 1.0 1.0; + align: 1.0 0.0; + } + } + part + { + name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + description + { + state: "default" 0.0; + min: 0 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC; + max: -1 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC; + align: 0.5 0.5; + rel1 + { + relative: 1.0 0.0; + to_x: "pad_l"; + } + rel2 + { + relative: 0.0 1.0; + to_x: "pad_r"; + } + } + } + } +} diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/inc/reserver.h b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/inc/reserver.h new file mode 100644 index 0000000..795c396 --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/inc/reserver.h @@ -0,0 +1,45 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#include "reservermain.h" + +#include "RCSResourceObject.h" + +#ifndef RESERVER_H__ +#define RESERVER_H__ + +using namespace std; +using namespace OIC::Service; + +typedef void(*ClientMenuHandler)(); +typedef int ReturnValue; + +std::string resourceUri = "/a/airConditioner"; +std::string resourceType = "core.ac"; +std::string resourceInterface = "oic.if."; +std::string attributeKey = "deviceInfo"; + +void printAttribute(const RCSResourceAttributes &attrs); + +void *showGroupAPIs(void *data); + +void serverCreateUI(void *data); + +#endif // RESERVER_H__ diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/inc/reservermain.h b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/inc/reservermain.h new file mode 100644 index 0000000..fa337b4 --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/inc/reservermain.h @@ -0,0 +1,50 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#ifndef REMAIN_H__ +#define REMAIN_H__ + +#include +#include +#include +#include +#include + +#include "OCPlatform.h" +#include "OCApi.h" + +using namespace OC; + +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "reservermain" + +#if !defined(PACKAGE) +#define PACKAGE "org.tizen.nestedattributeserver" +#endif + +#define ELM_DEMO_EDJ "opt/usr/apps/org.tizen.nestedattributeserver/res/ui_controls.edj" + +void start_server(void *data, Evas_Object *obj, void *event_info); + +void start_server_cb(void *data, Evas_Object *obj, void *event_info); + +#endif // REMAIN_H__ diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/res/ui_controls.edc b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/res/ui_controls.edc new file mode 100644 index 0000000..5caf512 --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/res/ui_controls.edc @@ -0,0 +1,25 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +collections +{ + base_scale: 1.8; + #include "../edc_resource/re_server_control.edc" +} \ No newline at end of file diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/shared/res/resampleapp.png b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/shared/res/resampleapp.png new file mode 100644 index 0000000000000000000000000000000000000000..9765b1bda7e5bddf0925555ab204b887a873bf24 GIT binary patch literal 57662 zcmdU&2Y{Bv)wXAQhoyJerGpfaq9DE5J1S~atXN|Avn3kQ*!`l$D2ie%v3Ct9iU9$! zARxVWkS4wCvh_dLJny{>uV6_upZ~zTGjrz5nKS2}_RLfEz7vl>A}6zMrgJXms3ZHI zY~lal(^KvD>g2b^T99$|k!M`zTvj!Ff*bL4ZRavixU^rt6HmP4s_U=1?vksn&O54K zzr3rjz3Spie}9p4H!U1_%FscltgqRlVCl}j$J~4S-;TNJ8N(x+7h3`nl`#k2P&{pByWKUm|WHre-Q&QDvN|NLL>eBs{vzbanwhZioN zJGS84sb!<)^<4YLj*;(APaB_}{rHg`PwISo_N#pxR#|@M=aVL{SlzDou*{}cyWI5m zFU-HLv`K<1ysdlpgBp)d`cVb&Nq{W}Uo#k#HS@`5165LsT%de5} z>?1C(+C}&Fcb6RQ-k5&c{R7 zy7#VDF8L2`$QMnT+~ofJq^mw~`{~`c9rRZ2+SX>NC*SKnrfJs!!_G=?drjKur?+d^ za@tX~4yxYeyu|ZH^lmrd<|peMGOSbO`OD}^=eFH2 zF15Vz`RA`HTQmLjt9v`Q;`-ZWl(lL9e%;#-Prdz$vgey^PQK)vtY`nH;DL+ZtK55( zd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L=M0O?Sc=#<$X zUHJ;(k$lDXSC%}1p|WA9x)dreJ`Ek3IBF8VC((5ItTEMwxg+k|%noWK3p7S<*64C@;Rufzm3YeCmvM@BpYl zjqh0ES3YUU32D$NtM*&oO1sg0p^eZ_EsHlIe(*Y!@;~HMXUOxbfJy~c8J0@27o95G zCC^hfb)IOA^Yzi_P?-b8WqcWww0Ma_S6YoyI^98#-M+l(g*@40a+YsG0bLNa^jr<=? zx5y2h+OQ7|<$i5v75h)FT5s3%*4E!ev`3XLRvC?=&9O5ZR~{Dc@Xo)ab&y4LC9i7xGCmoe0{MD!5urgm^q=g69ZU~%imq0h0 zFZ2!4Ot9BIRaYKmR{oN3@*X{2^C5O$DP8HE&8W8hI-bfv}r zLm?dqClFOubrXh8^{FoLS^1eJ>rn&qMdJs|Uwo2!1ic#Vf?b-djrddQ~P z@y7aJ0~5V)`)m9EIjE6pUO5nCT29W(%d2Uh+WEa1@I+I(nS~L$K_g`J5D3ZoPeU1s z5cx_Y*XlJ=`63J7wzuLQTfTfbkIwQS&96GmQuqE`sGIVCGoVT#LQ@oQnVOTEHf`F% zHdQ=f(Z}d*jOItM8iUb8Z}}A?4*G$d%7-CwdC7^%U_{O~AjjFw?|;~{!}Bd4Aemyn zzb!scrN07Q`iG)_lb}jLQd`!VcPK4UMIq`6?FY>(F@k_}g5RW$5yke+hYkW}9Kd?XEQzUukRQ0^7NMWv|@x zwG+T&6#DSD0;1`&kBdyQ56LC)MX~>1olS!p$pSkJiQ^PTspwbpG9e!D!m!-zBA%$k kZ}gYfNaCF}xV$|1>H6z0+kD + +#define DEFAULT_FANSPEED 30 +#define DEFAULT_AIRSPEED 400 + +using namespace std; +using namespace OC; +using namespace OIC::Service; + +RCSResourceAttributes model; +RCSResourceAttributes speed; +RCSResourceAttributes airCirculation; +RCSResourceAttributes temperature; +RCSResourceAttributes humidity; +RCSResourceAttributes power; +RCSResourceAttributes capacity; +RCSResourceAttributes weight; +RCSResourceAttributes dimensions; +RCSResourceAttributes red; +RCSResourceAttributes green; + +std::vector generalInfo; +std::vector fan; +std::vector tempSensor; +std::vector efficiency; +std::vector light; + +RCSResourceObject::Ptr server; +static bool serverCallback = false; + +# define nestedAtrribute std::vector> +# define checkServer NULL!=server?true:false + +static Evas_Object *log_entry = NULL; +static Evas_Object *list = NULL; +static Evas_Object *naviframe = NULL; + +typedef struct datetime_popup +{ + Evas_Object *popup; + Evas_Object *entry; +} datetime_popup_fields; + +// Function to update the log in UI +void *updateGroupLog(void *data) +{ + string *log = (string *)data; + // Show the log + elm_entry_entry_append(log_entry, (*log).c_str()); + elm_entry_cursor_end_set(log_entry); + return NULL; +} + +static void printNestedAttribute(void *data, Evas_Object *obj, void *event_info) +{ + RCSResourceObject::LockGuard lock(*server); + RCSResourceAttributes attributes = server->getAttributes(); + + std::cout << "\nPrinting nested attributes" << std::endl; + printAttribute(attributes); + return; +} + +void printAttribute(const RCSResourceAttributes &attrs) +{ + string logMessage = ""; + for (const auto & attr : attrs) + { + logMessage = logMessage + "==========================
"; + + OIC::Service::RCSResourceAttributes::Value attrValue = attr.value(); + std::vector< std::vector> attrVector = + attrValue.get>>(); + + for (auto itr = attrVector.begin(); itr != attrVector.end(); ++itr) + { + std::vector attrKeyVector = *itr; + for (auto itrKey = attrKeyVector.begin(); itrKey != attrKeyVector.end(); ++itrKey) + { + for (const auto & attribute : *itrKey) + { + logMessage = logMessage + attribute.key().c_str() + " : " + + attribute.value().toString().c_str() + "
"; + } + } + std::cout << std::endl; + logMessage = logMessage + "
"; + } + logMessage = logMessage + "==========================
"; + } + dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); +} + +nestedAtrribute createNestedAttribute(int fanSpeed, int airSpeed) +{ + nestedAtrribute *acServer = new nestedAtrribute(); + + model["model"] = "SamsungAC"; + + speed["speed"] = fanSpeed; + airCirculation["air"] = airSpeed; + + temperature["temp"] = 30; + humidity["humidity"] = 30; + + power["power"] = 1600; + capacity["capacity"] = 1; + + weight["weight"] = 3; + dimensions["dimensions"] = "10x25x35"; + + red["red"] = 50; + green["green"] = 60; + + generalInfo.clear(); + generalInfo.push_back(model); + generalInfo.push_back(weight); + generalInfo.push_back(dimensions); + + fan.clear(); + fan.push_back(speed); + fan.push_back(airCirculation); + + tempSensor.clear(); + tempSensor.push_back(temperature); + tempSensor.push_back(humidity); + + efficiency.clear(); + efficiency.push_back(power); + efficiency.push_back(capacity); + + light.clear(); + light.push_back(red); + light.push_back(green); + + acServer->push_back(generalInfo); + acServer->push_back(fan); + acServer->push_back(tempSensor); + acServer->push_back(efficiency); + acServer->push_back(light); + + return *acServer; +} + +static void onDestroy() +{ + server = NULL; + string logMessage = "SERVER DESTROYED"; + + dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); +} + +//hander for get request (if developer choose second option for resource Creation) +RCSGetResponse requestHandlerForGet(const RCSRequest &request, + RCSResourceAttributes &attrs) +{ + string logMessage = "GET REQUEST RECEIVED
"; + + RCSResourceObject::LockGuard lock(*server); + RCSResourceAttributes attributes = server->getAttributes(); + printAttribute(attributes); + logMessage += "RESPONSE SENT
"; + + dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); + return RCSGetResponse::defaultAction(); +} + +//hander for set request (if developer choose second option for resource Creation) +RCSSetResponse requestHandlerForSet(const RCSRequest &request, + RCSResourceAttributes &attrs) +{ + string logMessage = "SET REQUEST RECEIVED
"; + + RCSResourceObject::LockGuard lock(*server); + for (const auto & attr : attrs) + { + logMessage = logMessage + "KEY:" + attr.key().c_str() + "
"; + logMessage = logMessage + "VALUE:" + attr.value().toString().c_str() + "
"; + server->setAttribute(attr.key(), attr.value()); + } + + printAttribute(attrs); + logMessage += "RESPONSE SENT
"; + dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); + + return RCSSetResponse::defaultAction(); +} + +static void list_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + elm_list_item_selected_set(it, EINA_FALSE); +} + +static void initServer() +{ + OCPlatform::startPresence(3); + + try + { + server = RCSResourceObject::Builder(resourceUri, resourceType, + resourceInterface).setDiscoverable(true).setObservable(true).build(); + } + catch (const PlatformException &e) + { + dlog_print(DLOG_ERROR, LOG_TAG, "#### Create resource exception! (%s)", e.what()); + } + + server->setAutoNotifyPolicy(RCSResourceObject::AutoNotifyPolicy::UPDATED); + server->setSetRequestHandlerPolicy(RCSResourceObject::SetRequestHandlerPolicy::NEVER); + + nestedAtrribute attr = createNestedAttribute(DEFAULT_FANSPEED, DEFAULT_AIRSPEED); + server->setAttribute(attributeKey, attr); + + string logMessage = "SERVER CREATED
"; + dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); + + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showGroupAPIs, NULL); +} + +static void +popup_cancel_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + datetime_popup_fields *popup_fields = (datetime_popup_fields *)data; + evas_object_del(popup_fields->popup); + free(popup_fields); +} + +static void +popup_setFanSpeed_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + datetime_popup_fields *popup_fields = (datetime_popup_fields *)data; + Evas_Object *entry = popup_fields->entry; + const char *fanSpeedString = elm_entry_entry_get(entry); + // Remove white spaces(if any) at the beginning + string logMessage = ""; + int beginning = 0; + while (fanSpeedString[beginning] == ' ') + { + (beginning)++; + } + + int len = strlen(fanSpeedString); + if (NULL == fanSpeedString || 1 > len) + { + dlog_print(DLOG_INFO, LOG_TAG, "#### Read NULL Fan Speed Value"); + logMessage = "Fan Speed Cannot be NULL
"; + } + else + { + if (checkServer) + { + int fanSpeed = atoi(fanSpeedString); + nestedAtrribute attr = createNestedAttribute(fanSpeed, DEFAULT_AIRSPEED); + + RCSResourceObject::LockGuard lock(server); + server->getAttributes()[attributeKey] = attr; + logMessage = "Fan Speed Changed
"; + } + else + { + logMessage += "NO SERVER
"; + } + } + dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str()); + logMessage += "----------------------
"; + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); + + evas_object_del(popup_fields->popup); + free(popup_fields); +} + +static void +popup_setAirSpeed_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + datetime_popup_fields *popup_fields = (datetime_popup_fields *)data; + Evas_Object *entry = popup_fields->entry; + const char *airSpeedString = elm_entry_entry_get(entry); + // Remove white spaces(if any) at the beginning + string logMessage = ""; + int beginning = 0; + while (airSpeedString[beginning] == ' ') + { + (beginning)++; + } + + int len = strlen(airSpeedString); + if (NULL == airSpeedString || 1 > len) + { + dlog_print(DLOG_INFO, LOG_TAG, "#### Read NULL Air Circulation Speed Value"); + logMessage = "Air Circulation Speed Cannot be NULL
"; + } + else + { + if (checkServer) + { + int airSpeed = atoi(airSpeedString); + nestedAtrribute attr = createNestedAttribute(DEFAULT_FANSPEED, airSpeed); + + RCSResourceObject::LockGuard lock(server); + server->getAttributes()[attributeKey] = attr; + logMessage = "Air Circulation Speed Changed
"; + } + else + { + logMessage += "NO SERVER
"; + } + } + dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str()); + logMessage += "----------------------
"; + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); + + evas_object_del(popup_fields->popup); + free(popup_fields); +} + +static void +list_get_fanSpeed_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *popup, *btn; + Evas_Object *nf = naviframe; + Evas_Object *entry; + Evas_Object *layout; + + /* pop up */ + popup = elm_popup_add(nf); + elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_part_text_set(popup, "title,text", "Enter the fan speed"); + + layout = elm_layout_add(popup); + elm_layout_file_set(layout, ELM_DEMO_EDJ, "popup_datetime_text"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_content_set(popup, layout); + + entry = elm_entry_add(layout); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_entry_scrollable_set(entry, EINA_TRUE); + evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + eext_entry_selection_back_event_allow_set(entry, EINA_TRUE); + elm_object_part_text_set(entry, "elm.guide", "Range : 0-100"); + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBER); + elm_object_part_content_set(layout, "elm.swallow.content", entry); + + datetime_popup_fields *popup_fields; + popup_fields = (datetime_popup_fields *)malloc(sizeof(datetime_popup_fields)); + if (NULL == popup_fields) + { + dlog_print(DLOG_INFO, LOG_TAG, "#### Memory allocation failed"); + } + else + { + popup_fields->popup = popup; + popup_fields->entry = entry; + } + + /* Cancel button */ + btn = elm_button_add(popup); + elm_object_style_set(btn, "popup"); + elm_object_text_set(btn, "Cancel"); + elm_object_part_content_set(popup, "button1", btn); + evas_object_smart_callback_add(btn, "clicked", popup_cancel_clicked_cb, popup_fields); + + /* Set button */ + btn = elm_button_add(popup); + elm_object_style_set(btn, "popup"); + elm_object_text_set(btn, "Set"); + elm_object_part_content_set(popup, "button2", btn); + evas_object_smart_callback_add(btn, "clicked", popup_setFanSpeed_clicked_cb, popup_fields); + + evas_object_show(popup); +} + +static void +list_get_airSpeed_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *popup, *btn; + Evas_Object *nf = naviframe; + Evas_Object *entry; + Evas_Object *layout; + + /* pop up */ + popup = elm_popup_add(nf); + elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_part_text_set(popup, "title,text", "Enter the Air Circulation speed"); + + layout = elm_layout_add(popup); + elm_layout_file_set(layout, ELM_DEMO_EDJ, "popup_datetime_text"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_content_set(popup, layout); + + entry = elm_entry_add(layout); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_entry_scrollable_set(entry, EINA_TRUE); + evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + eext_entry_selection_back_event_allow_set(entry, EINA_TRUE); + elm_object_part_text_set(entry, "elm.guide", "Range : 0-100"); + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBER); + elm_object_part_content_set(layout, "elm.swallow.content", entry); + + datetime_popup_fields *popup_fields; + popup_fields = (datetime_popup_fields *)malloc(sizeof(datetime_popup_fields)); + if (NULL == popup_fields) + { + dlog_print(DLOG_INFO, LOG_TAG, "#### Memory allocation failed"); + } + else + { + popup_fields->popup = popup; + popup_fields->entry = entry; + } + + /* Cancel button */ + btn = elm_button_add(popup); + elm_object_style_set(btn, "popup"); + elm_object_text_set(btn, "Cancel"); + elm_object_part_content_set(popup, "button1", btn); + evas_object_smart_callback_add(btn, "clicked", popup_cancel_clicked_cb, popup_fields); + + /* Set button */ + btn = elm_button_add(popup); + elm_object_style_set(btn, "popup"); + elm_object_text_set(btn, "Set"); + elm_object_part_content_set(popup, "button2", btn); + evas_object_smart_callback_add(btn, "clicked", popup_setAirSpeed_clicked_cb, popup_fields); + + evas_object_show(popup); +} + +void *showGroupAPIs(void *data) +{ + // Add items to the list only if the list is empty + const Eina_List *eina_list = elm_list_items_get(list); + int count = eina_list_count(eina_list); + if (!count) + { + elm_list_item_append(list, "1. Print Nested attributes", NULL, NULL, + printNestedAttribute, NULL); + + elm_list_item_append(list, "2. Set Fan Speed", NULL, NULL, + list_get_fanSpeed_cb, NULL); + + elm_list_item_append(list, "3. Set Air Circulation speed", NULL, NULL, + list_get_airSpeed_cb, NULL); + + elm_list_go(list); + } + return NULL; +} + +static Eina_Bool +naviframe_pop_cb(void *data, Elm_Object_Item *it) +{ + onDestroy(); + + if (NULL != log_entry) + { + evas_object_del(log_entry); + log_entry = NULL; + } + if (NULL != list) + { + evas_object_del(list); + list = NULL; + } + return EINA_TRUE; +} + +// Method to set up server screens +void serverCreateUI(void *data) +{ + Evas_Object *layout; + Evas_Object *scroller; + Evas_Object *nf = (Evas_Object *)data; + Elm_Object_Item *nf_it; + naviframe = nf; + + // Scroller + scroller = elm_scroller_add(nf); + elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE); + elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); + + // Layout + layout = elm_layout_add(nf); + elm_layout_file_set(layout, ELM_DEMO_EDJ, "server_layout"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_object_content_set(scroller, layout); + + // List + list = elm_list_add(layout); + elm_list_mode_set(list, ELM_LIST_COMPRESS); + evas_object_smart_callback_add(list, "selected", list_selected_cb, NULL); + elm_object_part_content_set(layout, "list", list); + elm_list_go(list); + + // log_entry - text area for log + log_entry = elm_entry_add(layout); + elm_entry_scrollable_set(log_entry, EINA_TRUE); + elm_entry_editable_set(log_entry, EINA_FALSE); + elm_object_part_text_set(log_entry, "elm.guide", "Logs will be updated here!!!"); + evas_object_size_hint_weight_set(log_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(log_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(layout, "log", log_entry); + + nf_it = elm_naviframe_item_push(nf, "Resource Encapsulation", NULL, NULL, scroller, NULL); + elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, NULL); +} + +void start_server(void *data, Evas_Object *obj, void *event_info) +{ + server = NULL; + string logMessage = "SERVER WITHOUT CALLBACK
"; + + serverCallback = false; + serverCreateUI(data); + initServer(); + + dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); +} + +void start_server_cb(void *data, Evas_Object *obj, void *event_info) +{ + server = NULL; + string logMessage = "SERVER WITH CALLBACK
"; + + serverCallback = true; + serverCreateUI(data); + initServer(); + + if (checkServer) + { + server->setGetRequestHandler(requestHandlerForGet); + server->setSetRequestHandler(requestHandlerForSet); + logMessage = "HANDLERS SET
"; + } + else + { + logMessage = "NO SERRVER FOUND
"; + } + + dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str()); + ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, + &logMessage); + +} diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/src/reservermain.cpp b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/src/reservermain.cpp new file mode 100644 index 0000000..381406b --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/src/reservermain.cpp @@ -0,0 +1,257 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#include "reservermain.h" +#include + +typedef struct appdata +{ + Evas_Object *win; + Evas_Object *conform; + Evas_Object *layout; + Evas_Object *nf; + Evas_Object *findButton; + Evas_Object *logtext; + Evas_Object *listview; +} appdata_s; + +static void +win_delete_request_cb(void *data , Evas_Object *obj , void *event_info) +{ + ui_app_exit(); +} + +static void +list_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + elm_list_item_selected_set(it, EINA_FALSE); +} + +static Eina_Bool +naviframe_pop_cb(void *data, Elm_Object_Item *it) +{ + ui_app_exit(); + return EINA_FALSE; +} + +static void +create_list_view(appdata_s *ad) +{ + Evas_Object *list; + Evas_Object *btn; + Evas_Object *nf = ad->nf; + Elm_Object_Item *nf_it; + + // List + list = elm_list_add(nf); + elm_list_mode_set(list, ELM_LIST_COMPRESS); + evas_object_smart_callback_add(list, "selected", list_selected_cb, NULL); + + // Main Menu Items Here + elm_list_item_append(list, "Create Resource [Auto control]", NULL, NULL, start_server, nf); + + elm_list_item_append(list, "Create Resource [Developer control]", NULL, NULL, start_server_cb, nf); + + elm_list_go(list); + + // This button is set for devices which doesn't have H/W back key. + btn = elm_button_add(nf); + elm_object_style_set(btn, "naviframe/end_btn/default"); + nf_it = elm_naviframe_item_push(nf, "Resource Encapsulation", btn, NULL, list, NULL); + elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, ad->win); +} + + +static void +create_base_gui(appdata_s *ad) +{ + // Window + ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE); + elm_win_conformant_set(ad->win, EINA_TRUE); + elm_win_autodel_set(ad->win, EINA_TRUE); + + if (elm_win_wm_rotation_supported_get(ad->win)) + { + int rots[4] = { 0, 90, 180, 270 }; + elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4); + } + + evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL); + + // Conformant + ad->conform = elm_conformant_add(ad->win); + evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(ad->win, ad->conform); + evas_object_show(ad->conform); + + // Base Layout + ad->layout = elm_layout_add(ad->conform); + evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_layout_theme_set(ad->layout, "layout", "application", "default"); + evas_object_show(ad->layout); + + elm_object_content_set(ad->conform, ad->layout); + + // Naviframe + ad->nf = elm_naviframe_add(ad->layout); + create_list_view(ad); + elm_object_part_content_set(ad->layout, "elm.swallow.content", ad->nf); + eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL); + eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL); + + // Show window after base gui is set up + evas_object_show(ad->win); +} + +// Configures the OCPlatform +static void +configure_platform() +{ + try + { + PlatformConfig config + { OC::ServiceType::InProc, ModeType::Server, "0.0.0.0", 0, OC::QualityOfService::LowQos }; + + OCPlatform::Configure(config); + + dlog_print(DLOG_INFO, LOG_TAG, "#### Platform configuration done!!!!"); + } + catch (OCException &e) + { + dlog_print(DLOG_ERROR, LOG_TAG, "Exception occured! (%s)", e.what()); + } +} + +static bool +app_create(void *data) +{ + /* Hook to take necessary actions before main event loop starts + Initialize UI resources and application's data + If this function returns true, the main loop of application starts + If this function returns false, the application is terminated */ + appdata_s *ad = (appdata_s *)data; + + elm_app_base_scale_set(1.8); + + create_base_gui(ad); + + configure_platform(); + + return true; +} + +static void +app_control(app_control_h app_control, void *data) +{ + // Handle the launch request. +} + +static void +app_pause(void *data) +{ + // Take necessary actions when application becomes invisible. +} + +static void +app_resume(void *data) +{ + // Take necessary actions when application becomes visible. +} + +static void +app_terminate(void *data) +{ + // Release all resources. +} + +static void +ui_app_lang_changed(app_event_info_h event_info, void *user_data) +{ + // APP_EVENT_LANGUAGE_CHANGED + char *locale = NULL; + system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale); + elm_language_set(locale); + free(locale); + return; +} + +static void +ui_app_orient_changed(app_event_info_h event_info, void *user_data) +{ + // APP_EVENT_DEVICE_ORIENTATION_CHANGED + return; +} + +static void +ui_app_region_changed(app_event_info_h event_info, void *user_data) +{ + // APP_EVENT_REGION_FORMAT_CHANGED +} + +static void +ui_app_low_battery(app_event_info_h event_info, void *user_data) +{ + // APP_EVENT_LOW_BATTERY +} + +static void +ui_app_low_memory(app_event_info_h event_info, void *user_data) +{ + // APP_EVENT_LOW_MEMORY +} + +int +main(int argc, char *argv[]) +{ + appdata_s ad = {0,}; + int ret = 0; + + ui_app_lifecycle_callback_s event_callback = {0,}; + app_event_handler_h handlers[5] = {NULL, }; + + event_callback.create = app_create; + event_callback.terminate = app_terminate; + event_callback.pause = app_pause; + event_callback.resume = app_resume; + event_callback.app_control = app_control; + + ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, + ui_app_low_battery, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, + ui_app_low_memory, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], + APP_EVENT_DEVICE_ORIENTATION_CHANGED, + ui_app_orient_changed, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], + APP_EVENT_LANGUAGE_CHANGED, + ui_app_lang_changed, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], + APP_EVENT_REGION_FORMAT_CHANGED, + ui_app_region_changed, &ad); + ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]); + + ret = ui_app_main(argc, argv, &event_callback, &ad); + if (APP_ERROR_NONE != ret) + { + dlog_print(DLOG_ERROR, LOG_TAG, "app_main() is failed. err = %d", ret); + } + return ret; +} diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/tizen-manifest.xml b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/tizen-manifest.xml new file mode 100644 index 0000000..1da85cd --- /dev/null +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/tizen-manifest.xml @@ -0,0 +1,13 @@ + + + + + + resampleapp.png + + + http://tizen.org/privilege/network.get + http://tizen.org/privilege/internet + + true + -- 2.7.4