User Tools

Site Tools


webos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
webos [2018/06/11 11:02]
Sungmok Shin
webos [2018/06/19 23:46] (current)
Seokhee Lee
Line 35: Line 35:
   * ${ROOT_PATH_OF_YOUR_IOTIVITY_LOCAL_SRC} refers to "​${YOUR_HOME}/​iotivity"​.   * ${ROOT_PATH_OF_YOUR_IOTIVITY_LOCAL_SRC} refers to "​${YOUR_HOME}/​iotivity"​.
  
-==== Step 2: Add IoTivity recipe in the webOS build layer ====+==== Step 2: Add IoTivity recipe ​and patches ​in the webOS build layer ====
  
 webOS OSE uses OpenEmbedded build system to support a wide range of platform architectures easily. webOS OSE uses OpenEmbedded build system to support a wide range of platform architectures easily.
-Here is a list of available IoTivity recipes for webOS OSE (click the link to download):+Here is a list of available IoTivity recipes ​and patches ​for webOS OSE (click the link to download):
  
   * v1.2.1 (built-in): https://​sourceforge.net/​projects/​webos-iotivity-patches/​files/​iotivity_1.2.1_for_webos.tar.gz/​download ​   * v1.2.1 (built-in): https://​sourceforge.net/​projects/​webos-iotivity-patches/​files/​iotivity_1.2.1_for_webos.tar.gz/​download ​
   * v1.3.1: https://​sourceforge.net/​projects/​webos-iotivity-patches/​files/​iotivity_1.3.1_for_webos.tar.gz/​download   * v1.3.1: https://​sourceforge.net/​projects/​webos-iotivity-patches/​files/​iotivity_1.3.1_for_webos.tar.gz/​download
-  * master: https://​sourceforge.net/​projects/​webos-iotivity-patches/​files/​iotivity_1.3.1_for_webos.tar.gz/download + Step 2.1+  * master 
 +    * IoTivity patches for webOS OSE have been merged in IoTivity upstream master branch. 
 +    * Building upstream master branch should be performed based on the iotivity ​recipe for v1.3.1. 
 +    * Refer to Step 2.1 for the additional steps to build the IoTivity master branch
  
 Copy the downloaded file to your webOS build root directory. Copy the downloaded file to your webOS build root directory.
Line 48: Line 51:
 <​code>​$ cp iotivity_<​version>​_for_webos.tar.gz ${ROOT_PATH_OF_YOUR_WEBOS_BUILD} <​code>​$ cp iotivity_<​version>​_for_webos.tar.gz ${ROOT_PATH_OF_YOUR_WEBOS_BUILD}
 $ tar xvfz iotivity_<​version>​_for_webos.tar.gz</​code>​ $ tar xvfz iotivity_<​version>​_for_webos.tar.gz</​code>​
- 
- 
- 
-Please note: 
- 
-  * **Perform Step 2.1 if you want to build IoTivity upstream master branch. If not, you can skip.** 
- 
  
  
Line 62: Line 58:
 <​code>​$ cd ${YOUR_HOME} <​code>​$ cd ${YOUR_HOME}
 $ git clone ssh://​gerrit.iotivity.org:​29418/​iotivity</​code>​ $ git clone ssh://​gerrit.iotivity.org:​29418/​iotivity</​code>​
-  
-Cherry-pick https://​gerrit.iotivity.org/​gerrit/#/​c/​23935 (will be removed once the code review is merged). 
-<​code>​$ cd ${ROOT_PATH_OF_YOUR_IOTIVITY_LOCAL_SRC} 
-$ git fetch ssh://​sungmok.shin@gerrit.iotivity.org:​29418/​iotivity refs/​changes/​35/​23935/​60 && git cherry-pick FETCH_HEAD</​code>​ 
-  
    
 Fetch other build dependencies. Fetch other build dependencies.
Line 83: Line 74:
 EXTERNALSRC_BUILD_pn-iotivity = "​${ROOT_PATH_OF_YOUR_IOTIVITY_SOURCE}/"</​code>​ EXTERNALSRC_BUILD_pn-iotivity = "​${ROOT_PATH_OF_YOUR_IOTIVITY_SOURCE}/"</​code>​
  
-Update ​the LICENSE ​checksum ​in iotivity recipe +Get the checksum ​of LICENSE.md. 
-<​code>​$ cd {ROOT_PATH_OF_YOUR_WEBOS_BUILD+ 
-sed -i '​s/​22bf216f3077c279aed7b36b1fa9e6d1/​86d3f3a95c324c9479bd8986968f4327/​g' ​meta-webosose/​meta-webos/​recipes-core/​iotivity/​iotivity_1.3.1.bb</​code>​ +<​code>​$ cd ${ROOT_PATH_OF_YOUR_IOTIVITY_LOCAL_SRC
- +md5sum LICENSE.md 
 +86d3f3a95c324c9479bd8986968f4327 ​LICENSE.md 
 +</​code>​ 
 + 
 +Update LIC_FILES_CHKSUM value with the checksum of master branch in IoTivity recipe (.bb) of ${ROOT_PATH_OF_YOUR_WEBOS_BUILD}/​meta-webosose/​meta-webos/​recipes-core/​iotivity/ ​directory, as follows: 
 + 
 +<​code>​$ SECTION = "​libs"​ 
 +LICENSE = "​Apache-2.0" 
 +LIC_FILES_CHKSUM = "​file://​LICENSE.md;​md5=86d3f3a95c324c9479bd8986968f4327"​</​code>​
  
 Fix the install source path according to latest folder structure Fix the install source path according to latest folder structure
Line 139: Line 138:
   * IoTivity resource library: /usr/lib   * IoTivity resource library: /usr/lib
   * iotivity-node add-ons: /​usr/​lib/​node_modules/​iotivity-node   * iotivity-node add-ons: /​usr/​lib/​node_modules/​iotivity-node
-  * webOS sample native application/​usr/​palm/​services/​iotivity/examples/secure+  * webOS sample native application 
 +    * /​usr/​palm/​services/​org.ocf.webossample.ocserverbasicops 
 +    * /usr/​palm/​services/​org.ocf.webossample.occlientbasicops 
 +    * /​user/​palm/​services/​org.ocf.webossample.ocserver 
 +    * /​user/​palm/​services/org.ocf.webossample.occlient
   * webOS sample web application:​ /​usr/​palm/​applications/​com.example.app.iotivity   * webOS sample web application:​ /​usr/​palm/​applications/​com.example.app.iotivity
  
 ===== webOS Sample Apps ===== ===== webOS Sample Apps =====
  
-==== Execute sample native app ====+==== Execute sample native app (Secured) ​====
  
 Open the webOS log by below commands. (In below command, OCSERVERBASICOPS & OCCLIENTBASICSOPS is the log context of sample app) Open the webOS log by below commands. (In below command, OCSERVERBASICOPS & OCCLIENTBASICSOPS is the log context of sample app)
Line 151: Line 154:
 Execute the server app by below commands. Execute the server app by below commands.
  
-<​code>#​ cd /​usr/​palm/​services/​iotivity/​examples/​secure+<​code>#​ cd /​usr/​palm/​services/​org.ocf.webossample.ocserverbasicops
 # ./​ocserverbasicops [For Server sample]</​code>​ # ./​ocserverbasicops [For Server sample]</​code>​
  
Line 162: Line 165:
 In another terminal, execute the client app by below commands. In another terminal, execute the client app by below commands.
  
-<​code>#​ ./​occlientbasicops -t 2 [For Client sample] </​code>​+<​code>​ 
 +# cd /​usr/​palm/​services/​org.ocf/​webossample.occlientbasicops 
 + 
 +# ./​occlientbasicops 
 + 
 +Usage : occlient -u <0|1> -t <​1|2|3>​ -c <​0|1>​ 
 +-u <0|1> : Perform multicast/​unicast discovery of resources 
 +-t 1 : Discover Resources 
 +-t 2 : Discover Resources and Initiate Nonconfirmable Get/​Put/​Post Requests 
 +-t 3 : Discover Resources and Initiate Confirmable Get/​Put/​Post Requests 
 +-c 0 : Default auto-selection 
 +-c 1 : IP Connectivity Type 
 +-d 0 : Client as Non Device Owner 
 +-d 1 : Client as Device Owner 
 +-p 0 : Use UDP protocol 
 +-p 1 : Use TCP protocol 
 + 
 +# ./​occlientbasicops -t 2 [For Client sample]</​code>​
  
 Completion of '​GET',​ '​PUT',​ and '​POST'​ query successfully indicates success! Completion of '​GET',​ '​PUT',​ and '​POST'​ query successfully indicates success!
Line 210: Line 230:
 user.info occlientbasicops [] OCCLIENTBASICOPS occlientbasicops {} =============>​ Post Response user.info occlientbasicops [] OCCLIENTBASICOPS occlientbasicops {} =============>​ Post Response
 </​code>​ </​code>​
 +
 +==== Execute sample native app (Unsecured) ====
 +
 +Execute the server app by below commands.
 +<​code>#​ cd /​usr/​palm/​services/​org.ocf.webossample.ocserver
 +# ./ocserver
 +Usage : ocserver -o <0|1>
 +-o 0 : Notify all observers
 +-o 1 : Notify list of observers
 +-e 0 : Display supported endpoint flags
 +-e 1 : Create resource without endpoint flags
 +-e 2 : Create resource with endpoint flag OC_COAP
 +
 +# ./ocserver -o 0 [For Server sample]</​code>​
 +
 +Below message indicates that server runs successfully.
 +<​code>​user.info ocserver [] OCSERVER ocserver {} OCServer is starting...
 +user.info ocserver [] OCSERVER ocserver {} Device information initialized successfully.
 +user.info ocserver [] OCSERVER ocserver {} Created Light resource with result: OC_STACK_OK
 +user.info ocserver [] OCSERVER ocserver {} Entering ocserver main loop...
 +user.info ocserver [] OCSERVER ocserver {} Will send out presence in 10 seconds
 +user.info ocserver [] OCSERVER ocserver {} Entering ocserver main loop...</​code>​
 +
 +In another terminal, execute the client app by below commands.
 +<​code>#​ cd /​usr/​palm/​services/​org.ocf.webossample.occlient
 +
 +# ./occlient
 +
 +Usage : occlient -u <0|1> -t <​1..24>​ -c <0|1> -i <0|1> -s <0|1>
 +-u <0|1> : Perform multicast/​unicast discovery of resources
 +-c 0 : Use Default connectivity(IP)
 +-c 1 : IP Connectivity Type
 +-t 1 : Discover Resources
 +-t 2 : Discover Resources and Initiate Nonconfirmable Get Request
 +-t 3 : Discover Resources and Initiate Nonconfirmable Get Request with query filter.
 +-t 4 : Discover Resources and Initiate Nonconfirmable Put Requests
 +-t 5 : Discover Resources and Initiate Nonconfirmable Post Requests
 +-t 6 : Discover Resources and Initiate Nonconfirmable Delete Requests
 +-t 7 : Discover Resources and Initiate Nonconfirmable Observe Requests
 +-t 8 : Discover Resources and Initiate Nonconfirmable Get Request for a resource which is unavailable
 +-t 9 : Discover Resources and Initiate Confirmable Get Request
 +-t 10 : Discover Resources and Initiate Confirmable Post Request
 +-t 11 : Discover Resources and Initiate Confirmable Delete Requests
 +-t 12 : Discover Resources and Initiate Confirmable Observe Requests and cancel with Low QoS
 +-t 13 : Discover Resources and Initiate Nonconfirmable presence
 +-t 14 : Discover Resources and Initiate Nonconfirmable presence with filter
 +-t 15 : Discover Resources and Initiate Nonconfirmable presence with 2 filters
 +-t 16 : Discover Resources and Initiate Nonconfirmable multicast presence.
 +-t 17 : Discover Resources and Initiate Nonconfirmable Observe Requests then cancel immediately with High QOS
 +-t 18 : Discover Resources and Initiate Nonconfirmable Get Request and add vendor specific header options
 +-t 19 : Discover Platform
 +-t 20 : Discover Devices
 +-t 21 : Discover Resources and Display endpoints of the server information
 +-t 22 : Discover Resources and Perform Get Requests by IPv4 + COAP + UDP using server'​s endpoints information
 +-t 23 : Discover Resources and Perform Get Requests by IPv4 + COAP + TCP using server'​s endpoints information
 +-t 24 : Discover Introspection Resources and Perform Get Request
 +-s 0 : Specify the device spec version as core.0.0.0
 +-s 1 : Specify the device spec version as ocf.1.1.0
 +
 +# ./occlient -t 2 [For Client sample]</​code>​
 +
 +Completion of '​GET'​ query successfully indicates success!
 +
 +<​code>​user.info occlient [] OCCLIENT occlient {} Executing InitGetRequest with query /a/light
 +user.info ocserver [] OCSERVER ocserver {} Inside entity handler - flags: 0x2
 +user.info ocserver [] OCSERVER ocserver {} Flag includes OC_REQUEST_FLAG
 +user.info ocserver [] OCSERVER ocserver {} Received OC_REST_GET from client
 +user.info ocserver [] OCSERVER ocserver {} Received vendor specific options
 +user.info ocserver [] OCSERVER ocserver {} Received option with OC_COAP_ID and ID 17 with
 +user.info ocserver [] OCSERVER ocserver {} Received option with OC_COAP_ID and ID 2049 with
 +user.info ocserver [] OCSERVER ocserver {} accept version option exists
 +user.info ocserver [] OCSERVER ocserver {} accept version equals to default OC_SPEC_VERSION_VALUE.
 +user.info occlient [] OCCLIENT occlient {} Callback Context for GET query recvd successfully
 +user.info occlient [] OCCLIENT occlient {} StackResult:​ OC_STACK_OK
 +user.info occlient [] OCCLIENT occlient {} SEQUENCE NUMBER: 16777216
 +user.info occlient [] OCCLIENT PayloadLog {} Payload Type: Representation
 +user.info occlient [] OCCLIENT PayloadLog {} Resource #1
 +user.info occlient [] OCCLIENT PayloadLog {} URI:/​a/​light
 +user.info occlient [] OCCLIENT PayloadLog {} Values:
 +user.info occlient [] OCCLIENT PayloadLog {} state(bool):​false
 +user.info occlient [] OCCLIENT PayloadLog {} power(int):​0
 +user.info occlient [] OCCLIENT occlient {} =============>​ Get Response
 +user.info occlient [] OCCLIENT occlient {} Received vendor specific options
 +user.info occlient [] OCCLIENT occlient {} Received option with OC_COAP_ID and ID 12 with
 +user.info occlient [] OCCLIENT occlient {} Received format value of 10000
 +user.info occlient [] OCCLIENT occlient {} Received option with OC_COAP_ID and ID 2053 with
 +user.info occlient [] OCCLIENT occlient {} Received version value of 2048</​code>​
  
 ==== Execute sample web app ==== ==== Execute sample web app ====
Line 220: Line 327:
  
 {{:​webos_sample_webapp.png?​1000|}} {{:​webos_sample_webapp.png?​1000|}}
 +
 +Start server with START SERVER button.
 +{{:​webos_sample_webapp_server.png?​1000|}} ​
 +
 +Create new resources to fill input items and to click CREAT RESOURCE button.
 +{{:​webos_sample_webapp_server2.png?​1000|}}
 +Notes: ​ this sample app includes a cbor format file for sample server. It has 2 resources such as /a/fan and /a/light. In order to create the other resources with this app, the included cbor file should be replaced with your own new cbor file.
 +
 +Discover resources with DISCOVER RESOURCE button in UI for client role.
 +The devices including the discovered resources will be listed by address and port like: 
 +{{:​webos_sample_webapp_client.png?​1000|}}
 +
 +Check the detailed resources information to select a device from the list. You can get, delete, and observe a resource with the resource URI and question.
 +{{:​webos_sample_webapp_client2.png?​1000|}}
 +
 +The response from the server is displayed in the UI as follows:
 +{{:​webos_sample_webapp_client3.png?​1000|}}
 +Result of GET RESOURCE
 +{{:​webos_sample_webapp_client4.png?​1000|}}
 +Result of OBSERVE RESOURCE ​
  
 ===== Customize Build Option ===== ===== Customize Build Option =====
Line 225: Line 352:
 The following argument options can be passed to the yocto recipe to build IoTivity for webOS: The following argument options can be passed to the yocto recipe to build IoTivity for webOS:
  
-| **TARGET_TRANSPORT** | **Supported transport types:​** ​ +| **TARGET_TRANSPORT** ​ | **Supported transport types:​** ​                                          ​
-                     | ALL (default) ​                  ​+                      ​| ALL (default) ​                                                           
-                     | IP                              +                      ​| IP                                                                       ​
-| **RELEASE** ​         | **Supported release modes:​** ​   +| **RELEASE** ​          ​| **Supported release modes:​** ​                                            ​
-                     | 1 (release mode) (default) ​     +                      ​| 1 (release mode) (default) ​                                              ​
-                     | 0 (debug mode)                  +                      ​| 0 (debug mode)                                                           ​
-| **SECURED** ​         | **Supported security modes:​** ​ DTLS (Datagram Transport Layer Security) | +| **SECURED** ​          ​| **Supported security modes:​** ​ DTLS (Datagram Transport Layer Security) ​ 
-                     | 1 (DTLS enabled) (default) ​     +                      ​| 1 (DTLS enabled) (default) ​                                              ​
-                     | 0 (DTLS disabled) ​              ​+                      ​| 0 (DTLS disabled) ​                                                       
-| **VERBOSE** ​         | **Supported verbose modes:​** ​   +| **VERBOSE** ​          ​| **Supported verbose modes:​** ​                                            ​
-                     | 1 (show compilation) ​           +                      ​| 1 (show compilation) ​                                                    ​
-                     | 0 (do not show compilation) (default) ​   +                      ​| 0 (do not show compilation) (default) ​                                   
-| **RD_MODE** ​         | **Supported directory modes:​** ​ +| **RD_MODE** ​          ​| **Supported directory modes:​** ​                                          ​
-                     | SERVER (build resource directory server) ​    ​+                      ​| SERVER (build resource directory server) ​                                ​
-                     | CLIENT (build resource directory client) (default) ​    ​+                      ​| CLIENT (build resource directory client) (default) ​                      | 
-| **LOGGING** ​         | **Supported logging modes:​** ​   +|                       | all (build both resource directory server and client) ​                   ​
-                     | true (enable stack logging) ​    ​+| **LOGGING** ​          ​| **Supported logging modes:​** ​                                            ​
-                     | false (disable stack logging) (default) ​ +                      ​| true (enable stack logging) ​                                             
-| **LOG_LEVEL** ​       | **Supported logging types:** valid when LOGGING is true    +                      ​| false (disable stack logging) (default) ​                                 
-                     | DEBUG (default) ​                ​+| **LOG_LEVEL** ​        ​| **Supported logging types:** valid when LOGGING is true                  
-                     | INFO                            +                      ​| DEBUG (default) ​                                                         
-                     | ERROR                           ​+                      ​| INFO                                                                     ​
-                     | WARNING ​                        ​+                      ​| ERROR                                                                    
-                     | FATAL                           ​|+                      ​| WARNING ​                                                                 
 +                      ​| FATAL                                                                    | 
  
  
webos.1528714949.txt.gz · Last modified: 2018/06/11 11:02 by Sungmok Shin