TR-0025-Application Developer Guide

Total Page:16

File Type:pdf, Size:1020Kb

TR-0025-Application Developer Guide

1 TR-0025-Application developer guide

1

2

3

4

5

6

7 ONEM2M TECHNICAL REPORT Document Number TR-0025 V1.2.0

Document Name: Application Developer Guide

Date: 2016-October-29

Abstract: Provides a use case for guiding application developers to develop applications using functionalities provided by a oneM2M service platform.

Template Version:23 February 2015 (Dot not modify)

8 9 10 11 12 13 This Specification is provided for future development work within oneM2M only. The Partners accept no 14 liability for any use of this Specification. 15 The present document has not been subject to any approval process by the oneM2M Partners Type 1. 16 Published oneM2M specifications and reports for implementation should be obtained via the oneM2M 17 Partners' Publications Offices.

18

19

2 3 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 1 of 52 4 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 5 TR-0025-Application developer guide

20 About oneM2M

21 The purpose and goal of oneM2M is to develop technical specifications which address the 22 need for a common M2M Service Layer that can be readily embedded within various 23 hardware and software, and relied upon to connect the myriad of devices in the field with 24 M2M application servers worldwide.

25 More information about oneM2M may be found at: http//www.oneM2M.org

26 Copyright Notification

27 © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).

28 All rights reserved.

29 The copyright and the foregoing restriction extend to reproduction in all media. 30 31 Notice of Disclaimer & Limitation of Liability

32 The information provided in this document is directed solely to professionals who have the 33 appropriate degree of experience to understand and interpret its contents in accordance with 34 generally accepted engineering or other professional standards and applicable regulations. 35 No recommendation as to products or vendors is made or should be implied.

36 NO REPRESENTATION OR WARRANTY IS MADE THAT THE INFORMATION IS 37 TECHNICALLY ACCURATE OR SUFFICIENT OR CONFORMS TO ANY STATUTE, 38 GOVERNMENTAL RULE OR REGULATION, AND FURTHER, NO 39 REPRESENTATION OR WARRANTY IS MADE OF MERCHANTABILITY OR 40 FITNESS FOR ANY PARTICULAR PURPOSE OR AGAINST INFRINGEMENT OF 41 INTELLECTUAL PROPERTY RIGHTS. NO oneM2M PARTNER TYPE 1 SHALL BE 42 LIABLE, BEYOND THE AMOUNT OF ANY SUM RECEIVED IN PAYMENT BY 43 THAT PARTNER FOR THIS DOCUMENT, WITH RESPECT TO ANY CLAIM, AND IN 44 NO EVENT SHALL oneM2M BE LIABLE FOR LOST PROFITS OR OTHER 45 INCIDENTAL OR CONSEQUENTIAL DAMAGES. oneM2M EXPRESSLY ADVISES 46 ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PROVIDED IN 47 THIS DOCUMENT IS AT THE RISK OF THE USER.

6 7 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 2 of 52 8 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 9 TR-0025-Application developer guide

48 Contents

49 Contents...... 3 50 1 Scope...... 5 51 2 References...... 5 52 2.1 Normative references...... 5 53 2.2 Informative references...... 5 54 3 Definitions and abbreviations...... 5 55 3.1 Definitions...... 5 56 3.2 Abbreviations...... 6 57 4 Conventions...... 6 58 5 Use case...... 6 59 6 Architecture...... 7 60 7 Procedures...... 8 61 7.1 Introduction...... 8 62 7.2 Call Flows...... 9 63 7.2.1 Application registration and Access control policy creation...... 9 64 7.2.2 Initial resource creation...... 9 65 7.2.3 Discovery of group resources...... 10 66 7.2.4 Discovery and retrieval of contentInstance resources...... 11 67 7.3 Remote control scenarios...... 13 68 7.3.1 Introduction...... 13 69 7.3.2 Single light control...... 13 70 7.3.3 Multiple light control...... 13 71 8 Implementation...... 14 72 8.1 Introduction...... 14 73 8.2 Assumptions...... 14 74 8.3 Addressing for Entities...... 15 75 8.4 Modelling for Light State Data...... 15 76 8.5 Resource Structure...... 15 77 8.5.1 Resource Structure of IN-CSE...... 15 78 8.5.2 Resource Structure of MN-CSE...... 16 79 8.6 Role of Entities...... 17 80 8.6.1 oneM2M service platform (IN-CSE)...... 17 81 8.6.2 Home gateway application (MN-AE)...... 18 82 8.6.3 Light applications (ADN-AE1 and ADN-AE2)...... 18 83 8.6.4 Smartphone application (IN-AE)...... 18 84 8.7 Implementation Procedures...... 18 85 8.7.1 Introduction...... 18 86 8.7.2 MN-CSE registration...... 18 87 8.7.3 Access control policy creation...... 19 88 8.7.4 Application entities registration...... 21 89 8.7.4.1 Light application ADN-AE1...... 21 90 8.7.4.2 Light application ADN-AE2...... 22 91 8.7.4.3 Home gateway application MN-AE...... 23 92 8.7.4.4 Smartphone application IN-AE...... 23 93 8.7.5 Containers creation...... 24 94 8.7.5.1 Create a container of ADN-AE1...... 24 95 8.7.5.2 Create a container of ADN-AE2...... 25 96 8.7.6 ContentInstances creation...... 26 97 8.7.6.1 Create a content instance of ADN-AE1...... 26 98 8.7.6.2 Create a content instance of ADN-AE2...... 27 99 8.7.7 Group creation...... 27 100 8.7.8 Subscriptions creation...... 28

10 11 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 3 of 52 12 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 13 TR-0025-Application developer guide

101 8.7.8.1 Subscription to the content instance of ADN-AE1...... 28 102 8.7.8.2 Subscription to the content instance of ADN-AE2...... 29 103 8.7.9 Discovery...... 30 104 8.7.9.1 Introduction...... 30 105 8.7.9.2 Discovery of single light registered with MN-CSE...... 31 106 8.7.9.3 Discovery of groups located in MN-CSE...... 31 107 8.7.10 Latest content instances retrieval...... 32 108 8.7.10.1 Introduction...... 32 109 8.7.10.2 Retrieve the latest content instance of ADN-AE1...... 33 110 8.7.10.3 Retrieve the latest content instance of ADN-AE2...... 34 111 8.7.10.4 Retrieve a group of latest content instances for all light states...... 35 112 8.7.11 Light state modification...... 37 113 8.7.11.1 Introduction...... 37 114 8.7.11.2 Create a content instance under container of ADN-AE1...... 37 115 8.7.11.3 Create a content instance under container of ADN-AE2...... 38 116 8.7.11.4 Update the state of all lights using group fanout...... 39 117 8.7.12 Notifications...... 41 118 8.7.12.1 Introduction...... 41 119 8.7.12.2 Post a notification to ADN-AE1...... 41 120 8.7.12.3 Post a notification to ADN-AE2...... 42 121 9 Conclusion...... 43 122 Annex A: Reading Resources...... 44 123 Annex A.1 Introduction...... 44 124 Annex A.2 CSE resources...... 44 125 Annex A.2.1 IN-CSE...... 44 126 Annext A.2.2 MN-CSE...... 44 127 Annex A.3 Gateway device application MN-AE...... 45 128 Annex A.4. Light device applications...... 45 129 Annex A.4.1 ADN-AE1...... 45 130 Annex A.4.2 ADN-AE2...... 46 131 Annex A.5 Smartphone application IN-AE...... 46 132 Annex A.6 Access control policy...... 47 133 Annex A.7 Containers...... 47 134 Annex A.7.1 Container under ADN-AE1...... 47 135 Annex A.7.2 Container under ADN-AE2...... 48 136 Annex A.8 ContentInstances...... 48 137 Annex A.8.1 Latest contentInstance in ADN-AE1...... 48 138 Annex A.8.2 Latest contentInstance in ADN-AE2...... 49 139 Annex A.9 Subscriptions...... 50 140 Annex A.9.1 Subscription to container in ADN-AE1...... 50 141 Annex A.9.2 Subscription to container in ADN-AE2...... 50 142 Annex A.10 Groups...... 51 143 Annex A.10.1 Group1...... 51 144 History...... 51 145

14 15 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 4 of 52 16 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 17 TR-0025-Application developer guide

146 1 Scope

147 The present document provides a guide for application developers to develop applications using functionalities provided 148 by any oneM2M compliant service platform with the scope of as follows:

149  Objective of the use case,

150  The architecture of the use case mapped into an oneM2M service platform,

151  The execution procedures for implementation of the use case, and

152  Implementation details of the use case.

153 2 References

154 2.1 Normative references

155 References are either specific (identified by date of publication and/or edition number or version number) or 156 non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the 157 reference document (including any amendments) applies.

158 The following referenced documents are necessary for the application of the present document.

159 Not applicable.

160 2.2 Informative references

161 The following referenced documents are not necessary for the application of the present document but they assist the 162 user with regard to a particular subject area.

163 [i.1] oneM2M Drafting Rules

164 NOTE: Available at http://www.onem2m.org/images/files/oneM2M-Drafting-Rules.pdf

165 [i.2] oneM2M TS-0001 (V1.13.0): "Functional Architecture".

166 [i.3] oneM2M TS-0004 (V1.5.0): "Service Layer Core protocol Specification”.

167 [i.4] oneM2M TS-0009 (V1.4.0): "HTTP Protocol Binding".

168 [i.5] oneM2M TS-0011: "Common Terminology".

169

170 3 Definitions and abbreviations

171 3.1 Definitions

172 For the purposes of the present document, the terms and definitions given in oneM2M TS-0011 [i.5] and the following 173 apply.

174 NOTE: A term defined in the present document takes precedence over the definition of the same term, if any, in oneM2M TS-0011 [i.5].

175 176 M2M service provider domain: part of the M2M System that is associated with a specific M2M Service Provider

18 19 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 5 of 52 20 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 21 TR-0025-Application developer guide

177 registrar CSE: CSE where an Application or another CSE has registered

178 resource: uniquely addressable entity in oneM2M architecture

179 3.2 Abbreviations

180 For the purposes of the present document, the following abbreviations apply:

181 ACP Access Control Policy 182 ADN Application Dedicated Node 183 ADN-AE AE which resides in the Application Dedicated Node 184 AE Application Entity 185 CoAP Constrained Application Protocol 186 CSE Common Services Entity 187 CSE-ID Common Service Entity Identifier 188 DNS Domain Name System 189 FQDN Fully Qualified Domain Name 190 HTTP HyperText Transfer Protocol 191 IN Infrastructure Node 192 IN-AE Application Entity that is registered with the CSE in the Infrastructure Node 193 IN-CSE CSE which resides in the Infrastructure Node 194 IP Internet Protocol 195 JSON JavaScript Object Notation 196 M2M Machine to Machine 197 Mca Reference Point for M2M Communication with AE 198 Mcc Reference Point for M2M Communication with CSE 199 MN Middle Node 200 MN-AE Application Entity that is registered with the CSE in Middle Node 201 MN-CSE CSE which resides in the Middle Node 202 PoA Point of Access 203 SP Service Provider 204 URI Uniform Resource Identifier 205 XML eXtensible Markup Language 206

207

208 4 Conventions

209 The key words "Shall", "Shall not", "May", "Need not", "Should", "Should not" in this document are to be interpreted as 210 described in the oneM2M Drafting Rules [i.1].

211 5 Use case

212 This guide is based on a home lighting use case involving lights in a home that can be remotely controlled by a user's 213 smartphone leveraging the capabilities of oneM2M. An overview of the use case is shown in figure 5.1. The main 214 components are introduced as follows:

215 1 The lights are deployed in a home and are attached to a home gateway. 216 2 The home gateway communicates with a cloud service platform allowing the lights to be controlled remotely 217 by the smartphone. 218 3 The cloud service platform supports a set of services to enable the smartphone to more easily control the 219 lights in the home. Some examples of services include registration, discovery, data management, group 220 management, subscription/notification etc 221 4 The smartphone hosts an application used to remotely control the lights in the home and supports the 222 following capabilities:

22 23 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 6 of 52 24 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 25 TR-0025-Application developer guide

223  Discovery of lights deployed in the home. 224  Sending commands to change light states i.e. ON and OFF. 225  Retrieval of light states. 226

Cloud Service Light#1 Platform

Light#2 Home Gateway Smartphone With embedded application acting as a remote light controller

227

228 Figure 5.1: Overview of remote lights control use case 229

230

231 6 Architecture

232 This clause describes how the different components of this use case can be represented by corresponding oneM2M 233 architectural entities as shown in figure 6.1.

Mcc IN-CSE

Mca Mca ADN-AE -1 IN-AE MN-AE Light#1 Cloud Service Smartphone ADN-AE-2 Platform Mca MN-CSE With embedded application Light#2 Home Gateway acting as a remote light Home Domain controller

234

26 27 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 7 of 52 28 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 29 TR-0025-Application developer guide

235 Figure 6.1: oneM2M functional architecture of remote lights control use case 236 237 In the oneM2M functional architecture two basic types of entities are defined. One is an AE (short for Application 238 Entity) and the other is a CSE (short for Common Services Entity). In this use case, the lights and smartphone each host 239 an AE. Also an IN-CSE (short for Infrastructure Node CSE) is hosted in the cloud by the oneM2M Service Provider 240 and a MN-CSE (short for Middle Node CSE) is hosted on the Home Gateway.

241 The oneM2M defined Mca reference point is used to interface an AE and CSE. The oneM2M defined Mcc reference 242 point is used to interface CSEs. In this use case, the reference point used between a Light AE and home gateway MN- 243 CSE or Smartphone AE and IN-CSE is Mca while reference point used between the home gateway MN-CSE and 244 oneM2M service platform IN-CSE is Mcc

245 In summary, applications used in the current use case are classified as follows:

246 1 ADN-AE1: an application embedded in Light#1 with capabilities to control Light#1 and interact with the 247 home gateway MN-CSE through Mca reference point;

248 2 ADN-AE2: an application embedded in Light#2 with capabilities to control Light#2 and interact with the 249 home gateway MN-CSE through Mca reference point;

250 3 IN-AE: a smartphone application embedded in the smartphone device with capabilities to interact directly 251 with the oneM2M service platform IN-CSE through Mcc reference point and thereby remotely control Light#1 252 and Light#2;

253 4 MN-AE: a gateway application embedded into the home gateway that interacts with the MN-CSE through 254 Mca reference point.

255

256 7 Procedures

257 7.1 Introduction

258 The deployment of the oneM2M standard in the present use case requires procedures that are classified as follows:

259 1 Registration: The current procedure contains light application registration, gateway application registration, 260 and accessControlPolicy resource creation for selective access to data storage resources.

261 2 Initial resource creation: The current procedure contains group resource creation, container resources 262 creation with specific access control policies, content instance resources creation with initial light states, 263 subscription resources creation for notifications.

264 3 Discovery of container resource: all containers with a specific filter criteria are discovered by the gateway 265 application and then configured as members of a group resource.

266 4 Discovery and retrieval lights states: all containers with a specific filter criteria are discovered and retrieved 267 using resource identities through a smartphone application which gains access to oneM2M service platform so 268 content information can be retrieved.

269 5 Single light switch on/off: Any light that is discovered by and connected to the smartphone application is 270 able to be switched on and off via a smartphone application.

271 6 Multiple lights switch on/off: Multiple lights that are discovered are able to be switched on and off together 272 via a smartphone application.

273

30 31 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 8 of 52 32 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 33 TR-0025-Application developer guide

274 7.2 Call Flows

275 7.2.1 Application registration and Access control policy creation

276 Call flows regarding the registration phase depicted in figure 7.2.1-1 are ordered as follows:

277 1 Gateway (MN-CSE) registers with the oneM2M service platform (IN-CSE).

278 2 Gateway application (MN-AE) registers with the gateway (MN-CSE).

279 3 Light applications (ADN-AE1 and ADN-AE2) register with the gateway (MN-CSE).

280 4 Smartphone application (IN-AE) registers with the oneM2M service platform (IN-CSE).

281 5 Gateway application (MN-AE) discovers the smartphone application (IN-AE) from gateway (MN-CSE) 282 with specific filter criteria. The discovered IN-AE is granted access to the remote light control service 283 containers.

284 6 Gateway application (MN-AE) creates an accessControlPolicy resource granting all the entities playing 285 roles in the current use case including ADN-AE1, ADN-AE2, MN-AE and IN-AE access to the created 286 container and content instance resources.

ADN-AE1 ADNAND-AE22 MN-AE MN-CSE IN-CSE IN-AE

Gateway (MN-CSE) registration into oneM2M service platform (IN-CSE) Gateway 1 application(MN-AE) registration into gateway (MN-CSE) Light application 2 (ADN-AE1) registration into gateway (MN-CSE) 3-1

Light application (ADN-AE2) registration into smartphone gateway (MN-CSE) application (IN-AE) 3-2 registration into oneM2M service Announcement of platform (IN-CSE) IN-AE to MN-CSE by 4-1 IN-CSE

4-2 Discovery (GET) of IN-AE announced to MN-CSE

5 Access control policy creation granting ADN- AEs, MN-AE and IN-AE can access to remote light control service containers

6 287

288 Figure 7.2.1-1: Registration phase call flows

289 7.2.2 Initial resource creation

290 Call flows regarding the initial resource creation phase depicted in figure 7.2.2-1 are ordered as follows:

291 1 Gateway application (MN-AE) creates a group resource on gateway (MN-CSE), for updating and 292 retrieving group light state named as containers_group. The group members are added from the list of 293 discovered container resources that the MN-AE discovers. The group resource is created with a link to the 294 same access control policy.

34 35 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 9 of 52 36 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 37 TR-0025-Application developer guide

295 2 Two container resources are created in the gateway (MN-CSE) to store the light states under the 296 registered light application ADN-AE1 and ADN-AE2, respectively. The containers are created with a link to 297 the same access control policy.

298 3 Content Instance resources are created by light applications (ADN-AE1 and ADN-AE2) under each 299 created container and represent the controlled light states.

300 4 Subscription resources are created under the containers in the gateway (MN-CSE) so that subscribers, i.e. 301 light applications, can be notified whenever there is a new contentInstance resource created by the IN-AE.

302

ADN-AE1 ADNAND-AE22 MN-AE MN-CSE IN-CSE IN-AE

Group resource creation for updating and retrieval of the state of a group of lights.

Group resource is 1-1 created with a specific access control policy under MN-CSE container resource creation for light#1 2-1 Container resources are created with a container resource specific access creation for light#2 control policy under MN-CSE 2-2 contentInstance resource creation under container of light#1 3-1 contentInstance ContentInstance resource creation resources are under container of created under created containers in light#2 MN-CSE 3-2 subscription resource creation to subscription container of light#1 resources to 4-1 containers in MN- subscription CSE are created for resource creation to monitoring contentInstance container of light#2 update 4-2 303

304 Figure 7.2.2-1: Initial resource creation phase call flows

305 7.2.3 Discovery of group resources

306 Call flows regarding the discovery and update of group resources are depicted in figure 7.2.3-1 and ordered as follows:

307 1 Gateway application (MN-AE) periodically sends a RETRIEVE request including the parameter 308 filterUsage and specific filter criteria condition(s) as a query string for discovery of container resources 309 stored in the MN-CSE of gateway. The filter criteria conditions for the discovery operation include 310 createdBefore, createdAfter, modifiedSince, unmodifiedSInce, label, creator, expireAfter, resourceType etc.

311 2 Gateway (MN-CSE) responds with URIs of the discovered container resources, if any, to the gateway 312 application (MN-AE) according to the filter criteria(s).

313 3 Gateway application (MN-AE) sends a update request to update the list of group members within the 314 previously created group resource with identifiers of the discovered containers.

38 39 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 10 of 52 40 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 41 TR-0025-Application developer guide

ADN-AE1 ADNAND-AEAE22 MN-AE MN-CSE IN-CSE ININ--AE

Discovery (GET) with filter

MN-AE discovers criteria(s) the container resources stored in 1 MN-CSE with specific filter criteria(s) IDs of discovered container resources

2

MN-AE updates the Update group resource members group resource with with IDs of discovered container the IDs of the resources discovered container resources

3

315

316 Figure 7.2.3-1: Discovery and group light state update phase call flows

317 7.2.4 Discovery and retrieval of contentInstance resources

318 Call flows regarding the discovery and retrieval of contentInstance resources depicted in figure 7.2.4-1 and 7.2.4-2 are 319 ordered as follows:

320 1 The smartphone application (IN-AE) periodically sends a RETRIEVE request including the parameter 321 filterUsage and specific filter criteria condition(s) as a query string for discovery of container resources 322 stored in the MN-CSE of gateway.

323 The IN-AE also sends a Discovery request to the MN-CSE for the discovery of the group resources 324 located in the MN-CSE.

325 2 The gateway (MN-CSE) responds to the IN-AE with URIs of the discovered container resources under 326 ADN-AE1 and ADN-AE2, if any.

327 For the case where the IN-AE sends a Discovery request for the discovery of group resources, the MN-CSE 328 responds to the IN-AE with the URIs of the discovered group resources located in the MN-CSE, if any.

329 3 The IN-AE sends GET requests for retrieval of the latest contentInstance resources from each discovered 330 light container resource.

331 In the case of retrieval of the latest contentInstance resources of the group of containers, the IN-AE sends a 332 retrieve request to the fanOutPoint of the discovered group resource.

333 4 The MN-CSE responds to the IN-AE with the latest light state(s).

42 43 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 11 of 52 44 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 45 TR-0025-Application developer guide

ADN-AE1 ADNAND-AE22 MN-AE MN-CSE IN-CSE IN-AE

Discovery single light container with filter criterias 1-2 1-1

IN-AE discovers each URIs of discovered single light container container resources located in MN-CSE are responded

2-1 2-2

retrieval of the latest content instance from discovered light container light1

3-1-2 3-1-1 retrieval of the latest content instance the latest content from each instance of container discovered single light1 is responded light container 4-1-1 4-1-2

retrieval of the latest content instance from discovered light container light2

3-2-2 3-2-1

the latest content instance of container light2 is responded

4-2-1 4-2-2

334

335 Figure 7.2.4-1: Discovery and single light retrieval phase call flows

ADN-AE1 ADNAND-AE22 MN-AE MN-CSE IN-CSE IN-AE

Discovery group resources with filter criterias

1-2 1-1 IN-AE discovery of group resources stored in MN-CSE Respond with URIs of discovered group resources

2-1 2-2

Send a fanOutPoint request to the group for retrieval latest contentInstances

IN-AE retrieves a group of latest 3-2 3-1 content instances having the state of Respond with latest all lights contentInstances

4-1 4-2 336

337 Figure 7.2.4-2 Discovery and a group of lights retrieval phase call flows 338

46 47 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 12 of 52 48 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 49 TR-0025-Application developer guide

339 7.3 Remote control scenarios

340 7.3.1 Introduction

341 Lights are able to be controlled remotely through the smartphone application accessing the oneM2M service platform. 342 Two scenarios are introduced in clauses 7.3.2 and 7.3.3.

343 7.3.2 Single light control

344 Light#1 and Light#2 are controlled remotely by a human user through a smartphone application (IN-AE). A call flow 345 for single light control is depicted in figure 7.3.2-1 and the steps are ordered as follows:

346 1 When the user updates the light state on her/his smartphone, the IN-AE creates a new contentInstance 347 representing a new light state under the targeted container of a Light ADN-AE stored in the MN-CSE.

348 2 If the contentInstance is created sucessfully, the MN-CSE sends a notification to the corresponsding Light 349 ADN-AE to notify it that a new contentInstance resource was created.

ADN-AE1 ADNAND-AE22 MN-AE MN-CSE IN-CSE IN-AE

1-2 1-1 creation of a processing LIGHT#1 notifications with contentInstance contentInstance with the latest light creation new light state state to be executed to the controlled light#1 2-1

1-4 1-3 creation of a notifications with processing LIGHT#2 the latest light contentInstance contentInstance with state to be creation new light state executed to the controlled light#2 2-2

350

351 Figure 7.3.2-1: Single light remote control phase call flows 352

353 7.3.3 Multiple light control

354 Users can also remotely control multiple lights through the smartphone application (IN-AE) by sending a single light 355 control command to the group resource. A call flow for multiple lights control is depicted in figure 7.3.3-1 and the steps 356 are ordered as follows:

357 1 When the user updates the state of a group of lights on her/his smartphone, the IN-AE sends a 358 contentInstance create request targeting the group resource on the MN-CSE. The MN-CSE then fans out the 359 request to the individual Light container member resources on the MN-CSE..

360 2 For each contentInstances created sucessfully, the MN-CSE sends a notification to the corresponsding Light 361 ADN-AE.

50 51 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 13 of 52 52 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 53 TR-0025-Application developer guide

ADN-AE1 ADNAND-AEAE22 MN-AE MN-CSE IN-CSE IN-AE

1-2 1-1

create a group of processing contentInstances in MN-CSE sends contentInstance MN-CSE when state notifications to each creation of a group of lights is Light AND-AE in updated on user’s group smartphone 2-1-1 2-1-2

362

363 Figure 7.3.3-1: Multiple lights remote control phase call flows 364

365 8 Implementation

366 8.1 Introduction

367 Clause 8 presents necessary procedures required for the implementation of the remote lights control use case, including 368 conditions that must be met for the correct implementation of the current use case, and resource tree etc.

369 8.2 Assumptions

370 Assumptions are presented as below in order to ensure the remote lights control use case can be correctly implemented.

371  All the applications are server capable;

372  Devices and application entites are independently addressable with host names resolved by DNS network 373 services;

374  Host port number 8080 is reserved for oneM2M services;

375  Security is not considered in the current use case;

376  HTTP binding of oneM2M primitives is used in the current use case;

377  Both XML and JSON serializations of oneM2M primitives are used in the current use case;

378  All mandatory HTTP headers are presented in the HTTP requests while optional headers are selectively used 379 in the current use case;

380  All mandatory resource attributes for resources presented in the current use case are presented in the HTTP 381 requests while optional resource attributes are selectively used in the current use case;

382  The IN-CSE and MN-CSE in the current use case are deployed within the same oneM2M Service Provider 383 domain;

384  All AEs in the current use case are initially registered with CSEs and the identifier of the AEs are assigned 385 by the Registrar CSE of the AE accordinlgy, starting with a character of ‘C’;

386  All resources created in the current use case are addressable with the oneM2M Resource Identifier form of 387 Hierarchical address;

54 55 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 14 of 52 56 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 57 TR-0025-Application developer guide

388  Short names for the representation of the resources and attributes are used in the current use case;

389  Default access control policy has already been created under IN-CSE and it is used for MN-CSE registration 390 with IN-CSE;

391  All request originators send Blocking Requests for accessing resources located in CSEs.

392 8.3 Addressing for Entities

393 Each oneM2M entity including AE and CSE are addressable with correct host address that can be IP addresses or 394 FQDN addresses resolved to IP addresses by DNS network services according to addressing rules specified in oneM2M 395 standards.

396 The IN-CSE and MN-CSE entities presented in this use case are addressable with the following identifiers.

397  IN-CSE:

398  CSE-ID: in-cse

399  resourceName of IN-CSE’s CSEBase resource: server

400  MN-CSE:

401  CSE-ID: mn-cse

402  resourceName of MN-CSE’s CSEBase resource: home_gateway

403

404 8.4 Modelling for Light State Data

405 The light state ON or OFF stored as the content of content instance resource is modelled as string in XML 406 representation and can be represented as ON or OFF, while represented as { … 407 "con":"ON" …} or {… "con":"OFF" …}, respectively.

408 8.5 Resource Structure

409 The development of an oneM2M application includes the design of the resource trees of service capability layers i.e. 410 IN-CSE and MN-CSE in the current use case. The resource tree is constructed with child resources created according to 411 the high level procedures presented in oneM2M application developer guide clause 7. All the child resources shown in 412 the resource trees are mandatorily required in order to correctly implement the remote lights control use case.

413 8.5.1 Resource Structure of IN-CSE

414 The resource tree of IN-CSE starts with a CSEBase named server depicted in figure 8.5.1-1.

415 The root CSEBase has two direct child resources, a remoteCSE named home_gateway and an AE named 416 smartphone_ae.

server

home_gateway

smartphone_ae 417

58 59 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 15 of 52 60 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 61 TR-0025-Application developer guide

418 Figure 8.5.1-1: IN-CSE resource structure 419

420 8.5.2 Resource Structure of MN-CSE

421 The resource tree of MN-CSE starts with a CSEBase named home_gateway depicted in figure 8.5.2-1.

422 The resource tree of MN-CSE is constructed with child resources as follows:

423  an accessControlPolicy named gateway_acp,

424  an ADN-AE named light_ae1 which contains sub-resources of a container named light and multiple 425 contentInstances,

426  an ADN-AE named light_ae2 which contains sub-resources of a container named light and multiple 427 contentInstances,

428  light_state_sub1 and light_state_sub2 subscription resources that are child resources of the two light 429 containers, and

430  a MN-AE named gateway_ae which contains a group child resource,

431  A group resource named containers_group whose members are the light containers of each AND-AEs. 432 Smartphone application users with proper access control privileges can send a fanOutPoint request to this 433 group to create and retrieve content instances in the two light containers.

62 63 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 16 of 52 64 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 65 TR-0025-Application developer guide

home_gateway

gateway_acp

light_ae1

light

CI1

CI2

CIN

lightstate_sub1

light_ae2

light

CI1

CI2

CIN

lightstate_sub2

gateway_ae

containers_group

434

435 Figure 8.5.2-1: MN-CSE resource tree

436 8.6 Role of Entities

437 8.6.1 oneM2M service platform (IN-CSE)

438 The oneM2M service platform is modelled as an IN-CSE and is responsible for

439  handling the registration requests from the smartphone AE and home gateway MN-CSE

66 67 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 17 of 52 68 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 69 TR-0025-Application developer guide

440 8.6.2 Home gateway application (MN-AE)

441 The home gateway application is modelled as a MN-AE and is responsible for

442  initializing the home gateway device,

443  creating an access control policy resource gateway_acpin the MN-CSE,

444  registering the home gateway application with the MN-CSE,

445  creating the group resource with access control policy gateway_acp in the MN-CSE,

446  discovering device applications registered with the MN-CSE, and

447 8.6.3 Light applications (ADN-AE1 and ADN-AE2)

448 Each of the light applications are modelled as an ADN-AE and are responsible for

449  initializing the light control device,

450  registering the light devices with the MN-CSE,

451  creating container resources named “light” with access control policy gateway_acp in the MN-CSE, 452 respectively,

453  creating subscription resources lightstate_sub1 and lightstate_sub2 under the two light containers, and

454  creating content instance resources under containers light1 and light2 with initial light state, respectively.

455 8.6.4 Smartphone application (IN-AE)

456 The smartphone application is modelled as a IN-AE, which directly communicates with the oneM2M service platform 457 IN-CSE and is responsible for

458  initializing the smartphone light control application,

459  registering the smartphone application with the IN-CSE,

460  discovering the two light containers,

461  displaying the discovered light states,

462  accepting the light state modification commands from the smartphone application user,

463  executing the light state modification commands for single and multiple lights.

464 8.7 Implementation Procedures

465 8.7.1 Introduction

466 The implementation procedures in the current use case are mapped into HTTP bindings with both XML and JSON seria 467 lizations of oneM2M primitives according to the standard APIs describing the reference points Mca and Mcc, as 468 defined in oneM2M TS-0001 [i.2], oneM2M TS-0004 [i.3], the HTTP binding TS-0009 [i.4].

469 In addition, short names for the representation of the resources and attributes are used in the implementation 470 procedures.

471 8.7.2 MN-CSE registration

472 The implementation starts with the registration of MN-CSE with IN-CSE as shown in the following procedure.

70 71 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 18 of 52 72 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 73 TR-0025-Application developer guide

473 The following example shows the MN-CSE registration request and response using XML serialization

474 475 HTTP Request: 476 477 POST /~/in-cse/server?rcn=0 HTTP/1.1 478 Host: http://in.provider.com:8080 479 X-M2M-Origin: /mn-cse 480 Content-Type: application/vnd.onem2m-res+xml;ty=16 481 X-M2M-RI: incse-88643

483 484 485 mn-cse 486 mn.provider.com/mn-cse 487 true 488 http://mn.provider.com:8080 489 2 490 /in-cse/acp-666957710 491 492 493 HTTP Response: 494 495 201 Created 496 X-M2M-RSC: 2001 497 X-M2M-RI: incse-88643 498 Content-Location: /in-cse/csr-299409504 499 500 The following example shows the MN-CSE registration request and response using HTTP with JSON serialization.: 501 502 HTTP Request: 503 504 POST /~/in-cse/server?rcn=0 HTTP/1.1 505 Host: http://in.provider.com:8080 506 X-M2M-Origin: /mn-cse 507 Content-Type: application/vnd.onem2m-res+json;ty=16 508 X-M2M-RI: incse-88643

510 { 511 "m2m:csr": 512 { 513 "rn": "home_gateway", 514 "csi": "mn-cse", 515 "cb": "mn.provider.com/mn-cse", 516 "rr": true, 517 "poa": ["http://mn.provider.com:8080"], 518 "cst": 2, 519 "acpi": ["/in-cse/acp-666957710"] 520 } 521 } 522 523 HTTP Response: 524 525 201 Created 526 X-M2M-RSC: 2001 527 X-M2M-RI: incse-88643 528 Content-Location: /in-cse/csr-299409504 529 530 8.7.3 Access control policy creation

531 When an access control policy resource is created, a list of one or more allowed request originators must be specified in 532 the acor field and the allowed operations in the acop field.

533 The value of acop is set to 63 which indicates that the specified originator is granted privileges to conduct CREATE, 534 RETRIEVE, UPDATE, DELETE, DISCOVERY,and NOTIFY operations.

535 The creation of access control policy resource gateway_acp in MN-CSE is implemented in the following procedure.

74 75 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 19 of 52 76 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 77 TR-0025-Application developer guide

536 The following example shows an access control policy create request and response using HTTP with XML serialization.

537 HTTP Request: 538 539 POST /~/mn-cse/home_gateway?rcn=0 HTTP/1.1 540 Host: http://mn.provider.com:8080 541 X-M2M-Origin: Cgateway_ae 542 Content-Type: application/vnd.onem2m-res+xml;ty=1 543 X-M2M-RI: mncse-62948 544 545 546 547 548 549 Cgateway_ae Clight_ae1 Clight_ae2 /in- 550 cse/Csmartphone_ae 551 63 552 553 554 555 556 Cgateway_ae 557 51 558 559 560 561 562 HTTP Response: 563 564 201 Created 565 X-M2M-RSC: 2001 566 X-M2M-RI: mncse-62948 567 Content-Location: /mn-cse/acp-805496226 568 569 570 The following example shows an access control policy create request and response using HTTP with XML serialization.

571 HTTP Request: 572 573 POST /~/mn-cse/home_gateway?rcn=0 HTTP/1.1 574 Host: http://mn.provider.com:8080 575 X-M2M-Origin: Cgateway_ae 576 Content-Type: application/vnd.onem2m-res+json;ty=1 577 X-M2M-RI: mncse-62948 578 579 { 580 "m2m:acp": 581 { 582 "rn": "gateway_acp", 583 "pv": 584 { 585 "acr":[{ 586 "acor": 587 [ 588 "Cgateway_ae", 589 "Clight_ae1", 590 "Clight_ae2", 591 "/in-cse/Csmartphone_ae" 592 ], 593 "acop":63 594 }] 595 }, 596 "pvs": 597 { 598 "acr":[{ 599 "acor": 600 [ 601 "Cgateway_ae"

78 79 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 20 of 52 80 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 81 TR-0025-Application developer guide

602 ], 603 "acop":51 604 }] 605 } 606 } 607 } 608 609 HTTP Response: 610 611 201 Created 612 X-M2M-RSC: 2001 613 X-M2M-RI: mncse-62948 614 Content-Location: /mn-cse/acp-805496226 615 616 617 The access control policy resource is used to grant applications the access rights to conduct specific operations and 618 access to specific resources. The list of applications could be obtained with a discovery procedure using filter criteria 619 conditions. For more details about the discovery procedure, please go to clause 8.7.9. Here it is required that the list of 620 applications has been discovered before creating the access control policy resource.

621 8.7.4 Application entities registration

622 8.7.4.1 Light application ADN-AE1

623 The registration of ADN-AE1 with MN-CSE is shown in the following procedure. Note that the access control policy 624 identifier (unstructured SP-relative resourceID) which is assigned to ADN-AE1 is /mn-cse/acp-805496226.

625 The following example shows an ADN-AE registration request and response using HTTP with XML serialization.

626 HTTP Request: 627 628 POST /home_gateway?rcn=0 HTTP/1.1 629 Host: http://mn.provider.com:8080 630 X-M2M-Origin: C 631 Content-Type: application/vnd.onem2m-res+xml;ty=2 632 X-M2M-RI: mncse-92345

634 635 636 A01.com.company.lightApp1 637 true 638 http://192.168.0.10:9090 639 /mn-cse/acp-805496226 640 641 642 HTTP Response: 643 644 201 Created 645 X-M2M-RSC: 2001 646 X-M2M-RI: mncse-92345 647 Content-Location: /mn-cse/ae-CAE340304071 648 649 The following example shows an ADN-AE registration request and response using HTTP with JSON serialization.

650 HTTP Request: 651 652 POST /home_gateway?rcn=0 HTTP/1.1 653 Host: http://mn.provider.com:8080 654 X-M2M-Origin: C 655 Content-Type: application/vnd.onem2m-res+json;ty=2 656 X-M2M-RI: mncse-92345

658 { 659 "m2m:ae": 660 { 661 "rn": "light_ae1",

82 83 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 21 of 52 84 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 85 TR-0025-Application developer guide

662 "api": "A01.com.company.lightApp1", 663 "rr": true, 664 "poa": ["http://192.168.0.10:9090"], 665 "acpi": ["/mn-cse/acp-805496226"] 666 } 667 } 668 669 HTTP Response: 670 671 201 Created 672 X-M2M-RSC: 2001 673 X-M2M-RI: mncse-92345 674 Content-Location: /mn-cse/ae-CAE340304071 675 676 8.7.4.2 Light application ADN-AE2

677 The registration of ADN-AE2 with MN-CSE is shown in the following procedure. Note that the access control policy 678 identifier (unstructured SP-relative resourceID) which is assigned to ADN-AE2 is /mn-cse/acp-805496226.

679 The following example shows an ADN-AE registration request and response using HTTP with XML serialization.

680 HTTP Request: 681 682 POST /home_gateway?rcn=0 HTTP/1.1 683 Host: http://mn.provider.com:8080 684 X-M2M-Origin: C 685 Content-Type: application/vnd.onem2m-res+xml;ty=2 686 X-M2M-RI: mncse-18346

688 689 690 A01.com.company.lightApp2 691 true 692 http://192.168.0.20:9090 693 /mn-cse/acp-805496226 694 695 696 HTTP Response: 697 698 201 Created 699 X-M2M-RSC: 2001 700 X-M2M-RI: mncse-18346 701 Content-Location: /mn-cse/ae-CAE340304042 702 703 The following example shows an ADN-AE registration request and response using HTTP with JSON serialization.

704 HTTP Request: 705 706 POST /home_gateway?rcn=0 HTTP/1.1 707 Host: http://mn.provider.com:8080 708 X-M2M-Origin: C 709 Content-Type: application/vnd.onem2m-res+json;ty=2 710 X-M2M-RI: mncse-18346 711 712 { 713 "m2m:ae": 714 { 715 "rn": "light_ae2", 716 "api": "A01.com.company.lightApp2", 717 "rr": true, 718 "poa": ["http://192.168.0.20:9090"], 719 "acpi": ["/mn-cse/acp-805496226"] 720 } 721 } 722 723 HTTP Response: 724 725 201 Created

86 87 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 22 of 52 88 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 89 TR-0025-Application developer guide

726 X-M2M-RSC: 2001 727 X-M2M-RI: mncse-18346 728 Content-Location: /mn-cse/ae-CAE340304042

729 8.7.4.3 Home gateway application MN-AE

730 The registration of MN-AE with MN-CSE is shown in the following procedure. Note that the access control policy 731 identifier (unstructured SP-relative resourceID) which is assigned to MN-AE is /mn-cse/acp-805496226.

732 The following example shows an MN-AE registration request and response using HTTP with XML serialization. 733 734 HTTP Request: 735 736 POST /home_gateway?rcn=0 HTTP/1.1 737 Host: http://mn.provider.com:8080 738 X-M2M-Origin: C 739 Content-Type: application/vnd.onem2m-res+xml;ty=2 740 X-M2M-RI: mncse-19347 741 742 743 744 A01.com.company.gatewayApp 745 false 746 /mn-cse/acp-805496226 747 748 749 HTTP Response: 750 751 201 Created 752 X-M2M-RSC: 2001 753 X-M2M-RI: mncse-19347 754 Content-Location: /mn-cse/ae-CAE340303271 755 756 The following example shows an MN-AE registration request and response using HTTP with JSON serialization.

757 HTTP Request: 758 759 POST /home_gateway?rcn=0 HTTP/1.1 760 Host: http://mn.provider.com:8080 761 X-M2M-Origin: C 762 Content-Type: application/vnd.onem2m-res+json;ty=2 763 X-M2M-RI: mncse-19347 764 765 { 766 "m2m:ae": 767 { 768 "rn": "gateway_ae", 769 "api": "A01.com.company.gatewayApp", 770 "rr": false, 771 "acpi": ["/mn-cse/acp-805496226"] 772 } 773 } 774 775 HTTP Response: 776 777 201 Created 778 X-M2M-RSC: 2001 779 X-M2M-RI: mncse-19347 780 Content-Location: /mn-cse/ae-CAE340303271 781 782 8.7.4.4 Smartphone application IN-AE

783 The registration of IN-AE with IN-CSE is shown in the following procedure. Note that the access control policy 784 identifier (unstructured SP-relative resourceID) which is assigned to IN-AE is /in-cse/acp-666957710.

785 The following example shows an IN-AE registration request and response using HTTP with XML serialization.

90 91 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 23 of 52 92 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 93 TR-0025-Application developer guide

786 HTTP Request: 787 788 POST /server?rcn=0 HTTP/1.1 789 Host: http://mn.provider.com:8080 790 X-M2M-Origin: C 791 Content-Type: application/vnd.onem2m-res+xml;ty=2 792 X-M2M-RI: incse-16346

794 795 796 A01.com.company.lightControlApp 797 false 798 /in-cse/acp-666957710 799 800 801 HTTP Response: 802 803 201 Created 804 X-M2M-RSC: 2001 805 X-M2M-RI: incse-16346 806 Content-Location: /in-cse/ae-CAE340304178 807 808 The following example shows an IN-AE registration request and response using HTTP with JSON serialization.

809 HTTP Request: 810 811 POST /server?rcn=0 HTTP/1.1 812 Host: http://mn.provider.com:8080 813 X-M2M-Origin: C 814 Content-Type: application/vnd.onem2m-res+json;ty=2 815 X-M2M-RI: incse-16346

817 { 818 "m2m:ae": 819 { 820 "rn": "smartphone_ae", 821 "api": "A01.com.company.lightControlApp", 822 "rr": false, 823 "acpi": ["/in-cse/acp-666957710"] 824 } 825 } 826 827 HTTP Response: 828 829 201 Created 830 X-M2M-RSC: 2001 831 X-M2M-RI: incse-16346 832 Content-Location: /in-cse/ae-CAE340304178 833 834 835 8.7.5 Containers creation

836 8.7.5.1 Create a container of ADN-AE1

837 The creation of a container resource for ADN-AE1 is shown in the following procedure.

838 The following example shows a container create request and response using HTTP with XML serialization.

839 HTTP Request:

840 POST /home_gateway/light_ae1?rcn=0 HTTP/1.1 841 Host: http://mn.provider.com:8080 842 X-M2M-Origin: Clight_ae1 843 Content-Type: application/vnd.onem2m-res+xml;ty=3 844 X-M2M-RI: mncse/13345

846

94 95 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 24 of 52 96 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 97 TR-0025-Application developer guide

847 848 849 HTTP Response: 850 851 201 Created 852 X-M2M-RSC: 2001 853 X-M2M-RI: mncse-13345 854 Content-Location: /mn-cse/cnt-582759912 855 856 The following example shows a container create request and response using HTTP with JSON serialization.

857 HTTP Request: 858 859 POST /home_gateway/light_ae1?rcn=0 HTTP/1.1 860 Host: http://mn.provider.com:8080 861 X-M2M-Origin: Clight_ae1 862 Content-Type: application/vnd.onem2m-res+json;ty=3 863 X-M2M-RI: mncse-13345 864 865 { 866 "m2m:cnt": 867 { 868 "rn": "light" 869 } 870 } 871 872 HTTP Response: 873 874 201 Created 875 X-M2M-RSC: 2001 876 X-M2M-RI: mncse-13345 877 Content-Location: /mn-cse/cnt-582759912 878 879 880 8.7.5.2 Create a container of ADN-AE2

881 The creation of a container resource for ADN-AE2 is shown in the following procedure.

882 The following example shows a container create request and response using HTTP with XML serialization.

883 HTTP Request: 884 885 POST /home_gateway/light_ae2?rcn=0 HTTP/1.1 886 Host: http://mn.provider.com:8080 887 X-M2M-Origin: Clight_ae2 888 Content-Type: application/vnd.onem2m-res+xml;ty=3 889 X-M2M-RI: mncse-62345

891 892 893 894 HTTP Response: 895 896 201 Created 897 X-M2M-RSC: 2001 898 X-M2M-RI: mncse-62345 899 Content-Location: /mn-cse/cnt-582769893 900 901 The following example shows a container create request and response using HTTP with JSON serialization.

902 HTTP Request: 903 904 POST /home_gateway/light_ae2?rcn=0 HTTP/1.1 905 Host: http://mn.provider.com:8080 906 X-M2M-Origin: Clight_ae2 907 Content-Type: application/vnd.onem2m-res+json;ty=3 908 X-M2M-RI: mncse-62345 909

98 99 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 25 of 52 100 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 101 TR-0025-Application developer guide

910 { 911 "m2m:cnt": 912 { 913 "rn": "light" 914 } 915 } 916 917 HTTP Response: 918 201 Created 919 X-M2M-RSC: 2001 920 X-M2M-RI: mncse-62345 921 Content-Location: /mn-cse/cnt-582769893 922 923 8.7.6 ContentInstances creation

924 8.7.6.1 Create a content instance of ADN-AE1

925 The creation of a content instance resource under the light container of ADN-AE1 with initial content OFF is shown in 926 the following procedure.

927 The following example shows a contentInstance create request and response using HTTP with XML serialization.:

928 HTTP Request: 929 930 POST /home_gateway/light_ae1/light?rcn=0 HTTP/1.1 931 Host: http://mn.provider.com:8080 932 X-M2M-Origin: Clight_ae1 933 Content-Type: application/vnd.onem2m-res+xml;ty=4 934 X-M2M-RI: mncse-24345 935 936 937 text/plain:0 938 OFF 939 940 941 HTTP Response: 942 943 201 Created 944 X-M2M-RSC: 2001 945 X-M2M-RI: mncse-24345 946 Content-Location: /mn-cse/cin-394798749 947 Content-Type: application/vnd.onem2m-res+xml 948 949 The following example shows a contentInstance create request and response using HTTP with JSON serialization.

950 951 HTTP Request: 952 953 POST /home_gateway/light_ae1/light?rcn=0 HTTP/1.1 954 Host: http://mn.provider.com:8080 955 X-M2M-Origin: Clight_ae1 956 Content-Type: application/vnd.onem2m-res+json;ty=4 957 X-M2M-RI: mncse-24345 958 959 { 960 "m2m:cin": 961 { 962 "cnf": "text/plains:0", 963 "con": "OFF" 964 } 965 } 966 967 HTTP Response: 968 969 201 Created 970 X-M2M-RSC: 2001 971 X-M2M-RI: mncse-24345

102 103 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 26 of 52 104 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 105 TR-0025-Application developer guide

972 Content-Location: /mn-cse/cin-394798749 973 Content-Type: application/vnd.onem2m-res+json 974 975 8.7.6.2 Create a content instance of ADN-AE2

976 The creation of a content instance resource under the light container of ADN-AE2 with initial content OFF is shown in 977 the following procedure.

978 The following example shows a contentInstance create request and response using HTTP with XML serialization.

979 HTTP Request: 980 981 POST /home_gateway/light_ae2/light?rcn=0 HTTP/1.1 982 Host: http://mn.provider.com:8080 983 X-M2M-Origin: Clight_ae1 984 Content-Type: application/vnd.onem2m-res+xml;ty=4 985 X-M2M-RI: mncse-22345 986 987 988 text/plain:0 989 OFF 990 991 992 HTTP Response: 993 994 201 Created 995 X-M2M-RSC: 2001 996 X-M2M-RI: mncse-22345 997 Content-Location: /mn-cse/cin-256599578 998 999 The following example shows a contentInstance create request and response using HTTP with JSON serialization.

1000 HTTP Request: 1001 1002 POST /home_gateway/light_ae2/light?rcn=0 HTTP/1.1 1003 Host: http://mn.provider.com:8080 1004 X-M2M-Origin: Clight_ae1 1005 Content-Type: application/vnd.onem2m-res+json;ty=4 1006 X-M2M-RI: mncse-22345 1007 1008 { 1009 "m2m:cin": 1010 { 1011 "cnf": "text/plains:0", 1012 "con": "OFF" 1013 } 1014 } 1015 1016 HTTP Response: 1017 1018 201 Created 1019 X-M2M-RSC: 2001 1020 X-M2M-RI: mncse-22345 1021 Content-Location: /mn-cse/cin-256599578 1022 1023 1024 8.7.7 Group creation

1025 The creation of a group resource by the MN-AE is shown in the following procedure. The group resource is created 1026 with two initial member ids of the light container resources..

1027 The following example shows a group create request and response using HTTP with XML serialization.

1028 HTTP Request: 1029 1030 POST /home_gateway/gateway_ae?rcn=0 HTTP/1.1 1031 Host: http://mn.provider.com:8080

106 107 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 27 of 52 108 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 109 TR-0025-Application developer guide

1032 X-M2M-Origin: Cgateway_ae 1033 Content-Type: application/vnd.onem2m-res+xml;ty=9 1034 X-M2M-RI: mncse-76905

1036 1037 1038 3 1039 /mn-cse/cnt-582759912 /mn-cse/cnt-582769893 1040 10 1041 1042 1043 HTTP Response: 1044 1045 201 Created 1046 X-M2M-RSC: 2001 1047 X-M2M-RI: mncse-76905 1048 Content-Location: /mn-cse/grp-977978327 1049 1050 The following example shows a group create request and response using HTTP with JSON serialization. 1051 1052 HTTP Request: 1053 1054 POST /home_gateway/gateway_ae?rcn=0 HTTP/1.1 1055 Host: http://mn.provider.com:8080 1056 X-M2M-Origin: Cgateway_ae 1057 Content-Type: application/vnd.onem2m-res+json;ty=9 1058 X-M2M-RI: mncse-76905

1060 { 1061 "m2m:grp": 1062 { 1063 "rn":"containers_grp", 1064 "mt": 3, 1065 "mid":["/mn-cse/cnt-582759912", "/mn-cse/cnt-582769893"], 1066 "mnm": 10 1067 } 1068 } 1069 1070 HTTP Response: 1071 1072 201 Created 1073 X-M2M-RSC: 2001 1074 X-M2M-RI: mncse-76905 1075 Content-Location: /mn-cse/grp-977978327 1076 1077 1078 8.7.8 Subscriptions creation

1079 8.7.8.1 Subscription to the content instance of ADN-AE1

1080 When a subscription resource is created, the notification content type (short for nct) parameter is set to a value 1 to 1081 indicate that all attributes of the subscribed resource will be notified to the subscriber.

1082 ADN-AE1 creates a subscription resource including the notification URI set to the resource identifier of ADN-AE1 so 1083 that the ADN-AE1 will get notified whenever a content instance child resource is created in the container . The 1084 corresponding subscription create request is shown in the following procedure.

1085 The following example shows a subscription create request and response using HTTP with XML serialization.

1086 HTTP Request: 1087 1088 POST /home_gateway/light_ae1/light?rcn=0 HTTP/1.1 1089 Host: http://mn.provider.com:8080 1090 X-M2M-Origin: Clight_ae1 1091 Content-Type: application/vnd.onem2m-res+xml;ty=23 1092 X-M2M-RI: mncse-67891

110 111 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 28 of 52 112 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 113 TR-0025-Application developer guide

1093 1094 1095 1096 1097 3 1098 1099 Clight_ae1 1100 1 1101 1102 1103 HTTP Response: 1104 1105 201 Created 1106 X-M2M-RSC: 2001 1107 X-M2M-RI: mncse-67891 1108 Content-Location: /mn-cse/sub-856593979 1109 1110 The following example shows a subscription create request and response using HTTP with JSON serialization.

1111 HTTP Request: 1112 1113 POST /home_gateway/light_ae1/light?rcn=0 HTTP/1.1 1114 Host: http://mn.provider.com:8080 1115 X-M2M-Origin: Clight_ae1 1116 Content-Type: application/vnd.onem2m-res+json;ty=23 1117 X-M2M-RI: mncse-67891 1118 1119 { 1120 "m2m:sub": 1121 { 1122 "rn": "lightstate_sub1", 1123 "enc": 1124 { 1125 "net":[3] 1126 }, 1127 "nu":["Clight_ae1"], 1128 "nct":1 1129 } 1130 } 1131 1132 HTTP Response: 1133 1134 201 Created 1135 X-M2M-RSC: 2001 1136 X-M2M-RI: mncse-67891 1137 Content-Location: /mn-cse/sub-856593979 1138 1139

1140 8.7.8.2 Subscription to the content instance of ADN-AE2

1141 When a subscription resource is created, the notification content type (short for nct) parameter is set to a value 1 to 1142 indicate that all attributes of the subscribed resource will be notified to the subscriber.

1143 ADN-AE1 creates a subscription resource including the notification URI set to the resource identifier of ADN-AE1 so 1144 that the ADN-AE1 will get notified whenever a content instance child resource is created in the container . The 1145 corresponding subscription create request is shown in the following procedure.

1146 When a subscription resource is created, the notification content type (short for nct) parameter is set to value 1 to 1147 indicate that all attributes of the subscribed resource will be notified to the subscriber.

1148 ADN-AE2 creates a subscription resource including the notification URI set to the resource identifier of ADN-AE2 so 1149 that the ADN-AE2 will get notified whenever a content instance child resource is created in the container. The 1150 corresponding subscription create request is shown in the following procedures.

1151 The following example shows a subscription create request and response using HTTP with XML serialization.

114 115 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 29 of 52 116 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 117 TR-0025-Application developer guide

1152 HTTP Request: 1153 1154 POST /home_gateway/light_ae2/light?rcn=0 HTTP/1.1 1155 Host: http://mn.provider.com:8080 1156 X-M2M-Origin: Clight_ae2 1157 Content-Type: application/vnd.onem2m-res+xml;ty=23 1158 X-M2M-RI: mncse-29387 1159 1160 1161 1162 1163 3 1164 1165 Clight_ae2 1166 1 1167 1168 1169 HTTP Response: 1170 1171 201 Created 1172 X-M2M-RSC: 2001 1173 X-M2M-RI: mncse-29387 1174 Content-Location: /mn-cse/sub-856463728 1175 1176 The following example shows a subscription create request and response using HTTP with JSON serialization.

1177 HTTP Request: 1178 1179 POST /home_gateway/light_ae2/light?rcn=0 HTTP/1.1 1180 Host: http://mn.provider.com:8080 1181 X-M2M-Origin: Clight_ae2 1182 Content-Type: application/vnd.onem2m-res+json;ty=23 1183 X-M2M-RI: mncse-29387 1184 1185 { 1186 "m2m:sub": 1187 { 1188 "rn": "lightstate_sub2", 1189 "enc": 1190 { 1191 "net":[3] 1192 }, 1193 "nu":["Clight_ae2"], 1194 "nct":1 1195 } 1196 } 1197 1198 HTTP Response: 1199 1200 201 Created 1201 X-M2M-RSC: 2001 1202 X-M2M-RI: mncse-29387 1203 Content-Location: /mn-cse/sub-856463728 1204 1205 8.7.9 Discovery

1206 8.7.9.1 Introduction

1207 The discovery functionality in oneM2M is implemented using a RETRIEVE operation along with one or multiple filter 1208 criteria parameters.

1209 In order to enable the retrieve operation for resource discovery, parameter filterUsage (short for fu) is included in the 1210 RETRIEVE request as a query string.

1211 In addition, parameter resource type (short for rty) is used as a filterCriteria condition for the discovery of single light 1212 and group light members. The parameter discovery result type (short for drt) is set to 2 to indicate that the format of 1213 elements of URIList is unstructured. The detailed discovery procedures are presented in clauses 8.7.9.2 and 8.7.9.3.

118 119 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 30 of 52 120 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 121 TR-0025-Application developer guide

1214 8.7.9.2 Discovery of single light registered with MN-CSE

1215 The discovery of containers for each light registered with the MN-CSE by the smartphone AE is shown in the 1216 following procedure.

1217 If the discovery response is preferred to be returned with a XML representation, the HTTP request message is sent as 1218 following example:

1219 HTTP Request: 1220 1221 GET /~/mn-cse/home_gateway?fu=1&rty=3&drt=2 HTTP/1.1 1222 Host: http://in.provider.com:8080 1223 X-M2M-Origin: /in-cse/Csmartphone_ae 1224 X-M2M-RI: mncse-99882 1225 Accept: application/xml 1226 1227 HTTP Response: 1228 1229 200 OK 1230 X-M2M-RSC: 2000 1231 X-M2M-RI: mncse-99882 1232 X-M2M-CNST: 2 1233 Content-Type: application/xml 1234 1235 1236 1237 /mn-cse/cnt-582759912 1238 /mn-cse/cnt-582769893 1239 1240 1241 If the discovery response is preferred to be returned with a JSON representation, the HTTP request message is sent as 1242 following example:

1243 HTTP Request: 1244 1245 GET /~/mn-cse/home_gateway?fu=1&rty=3&drt=2 HTTP/1.1 1246 Host: http://in.provider.com:8080 1247 X-M2M-Origin: /in-cse/Csmartphone_ae 1248 X-M2M-RI: mncse-99882 1249 Accept: application/json 1250 1251 HTTP Response: 1252 1253 200 OK 1254 X-M2M-RSC: 2000 1255 X-M2M-RI: mncse-99882 1256 X-M2M-CNST: 2 1257 Content-Type: application/json 1258 1259 { 1260 "m2m:uril": 1261 [ 1262 "/mn-cse/cnt-582759912", 1263 "/mn-cse/cnt-582769893" 1264 ] 1265 } 1266 1267 1268 The smartphone application retrieves a list of URIs representing containers registered with MN-CSE from the response 1269 message, e.g. /mn-cse/cnt-582759912 which is the URI of container created in ADN-AE1. The retrieved URIs of 1270 the discovered containers are then used for the group member update operation. 1271 1272 8.7.9.3 Discovery of groups located in MN-CSE

1273 The discovery of groups located in MN-CSE by the smartphone AE is shown in the following procedures.

122 123 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 31 of 52 124 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 125 TR-0025-Application developer guide

1274 If the discovery response is preferred to be returned with a XML representation, the HTTP request message is sent as 1275 following example:

1276 HTTP Request: 1277 1278 GET /~/mn-cse/home_gateway?fu=1&rty=9&drt=2 HTTP/1.1 1279 Host: http://in.provider.com:8080 1280 X-M2M-Origin: /in-cse/Csmartphone_ae 1281 X-M2M-RI: mncse-15001 1282 Accept: application/xml

1284 HTTP Response: 1285 1286 200 OK 1287 X-M2M-RSC: 2000 1288 X-M2M-RI: mncse-15001 1289 X-M2M-CNST: 2 1290 Content-Type: application/xml 1291 1292 1293 1294 /mn-cse/grp-977978327 1295 1296 1297 If the discovery response is preferred to be returned with a JSON representation, the HTTP request message is sent as 1298 following example:

1299 HTTP Request: 1300 1301 GET /~/mn-cse/home_gateway?fu=1&rty=9&drt=2 HTTP/1.1 1302 Host: http://in.provider.com:8080 1303 X-M2M-Origin: /in-cse/Csmartphone_ae 1304 X-M2M-RI: mncse-15001 1305 Accept: application/json

1307 HTTP Response: 1308 1309 200 OK 1310 X-M2M-RSC: 2000 1311 X-M2M-RI: mncse-15001 1312 X-M2M-CNST: 2Content-Type: application/json 1313 1314 { 1315 "m2m:uril": 1316 [ 1317 "/mn-cse/grp-977978327" 1318 ] 1319 } 1320 1321 1322 The smartphone application retrieves a list of URIs representing group resources located in MN-CSE from the response 1323 message, e.g. /mn-cse/grp-977978327 which is the URI of the group resource. The retrieved URIs of the 1324 discovered group resource are then used for the group member update operation. 1325 8.7.10 Latest content instances retrieval

1326 8.7.10.1 Introduction

1327 The smartphone application can retrieve the latest light states via sending a RETRIEVE request targeting a container’s 1328 la (short for latest) virtual resource.

1329 The smartphone application can also retrieve a group of latest light states via sending a RETRIEVE request targeting 1330 the group fanOutPoint virtual resource.

126 127 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 32 of 52 128 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 129 TR-0025-Application developer guide

1331 8.7.10.2 Retrieve the latest content instance of ADN-AE1

1332 The latest content instance of the light container resource for ADN-AE1 can be retrieved by the following procedure.

1333 If the response is preferred to be returned with a XML representation, the following is a HTTP request message 1334 example:

1335 HTTP Request: 1336 1337 GET /~/mn-cse/home_gateway/light_ae1/light/latest HTTP/1.1 1338 Host: http://in.provider.com:8080 1339 X-M2M-Origin: /in-cse/Csmartphone_ae 1340 X-M2M-RI: mncse-11223 1341 Accept: application/xml 1342 1343 HTTP Response: 1344 1345 200 OK 1346 X-M2M-RSC: 2000 1347 X-M2M-RI: mncse-11223 1348 Content-Type: application/xml 1349 1350 1351 1353 4 1354 cin-394798749 1355 cnt-181049109 1356 20150925T045938 1357 20150925T045938 1358 20151107T154802 1359 0 1360 text/plain:0 1361 3 1362 OFF 1363 1364 1365 If the response is preferred to be returned with a JSON representation, the following is a HTTP request message 1366 example:

1367 GET /~/mn-cse/home_gateway/light_ae1/light/latest HTTP/1.1 1368 Host: http://in.provider.com:8080 1369 X-M2M-Origin: /in-cse/Csmartphone_ae 1370 X-M2M-RI: mncse-11223 1371 Accept: application/json 1372 1373 HTTP Response: 1374 1375 200 OK 1376 X-M2M-RSC: 2000 1377 X-M2M-RI: mncse-11223 1378 Content-Type: application/json 1379 1380 { 1381 "m2m:cin": 1382 { 1383 "ty":4, 1384 "ri":"cin-394798749", 1385 "pi":"cnt-181049109", 1386 "rn":"cin-394798749", 1387 "ct":"20150925T045938", 1388 "lt":"20150925T045938", 1389 "et":"20151107T154802", 1390 "st":0, 1391 "cnf":"text/plain:0", 1392 "cs":3,

130 131 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 33 of 52 132 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 133 TR-0025-Application developer guide

1393 "con":"OFF" 1394 } 1395 } 1396

1397 8.7.10.3 Retrieve the latest content instance of ADN-AE2

1398 The latest content instance of the light container resource for ADN-AE2 can be retrieved by the following procedures.

1399 If the response is preferred to be represented in XML, the following is a HTTP request message example:

1400 HTTP Request: 1401 1402 GET /~/mn-cse/home_gateway/light_ae2/light/latest HTTP/1.1 1403 Host: http://mn.provider.com:8080 1404 X-M2M-Origin: /in-cse/Csmartphone_ae 1405 X-M2M-RI: mncse-22336 1406 Accept: application/xml 1407 1408 HTTP Response: 1409 1410 200 OK 1411 X-M2M-RSC: 2000 1412 X-M2M-RI: mncse-22336 1413 Content-Type: application/xml 1414 1415 1416 1418 4 1419 cin-256599578 1420 cnt-790965889 1421 20150925T050515 1422 20150925T050515 1423 20151107T154802 1424 0 1425 text/plain:0 1426 3 1427 OFF 1428 1429 1430 If the response is preferred be returned in representation of JSON, the following is a HTTP request message example:

1431 GET /~/mn-HTTP/1.1 1432 Host: http://mn.provider.com:8080 1433 X-M2M-Origin: /in-cse/Csmartphone_ae 1434 X-M2M-RI: mncse-22336 1435 Accept: application/json 1436 1437 HTTP Response: 1438 1439 200 OK 1440 X-M2M-RSC: 2000 1441 X-M2M-RI: mncse-22336 1442 Content-Type: application/json 1443 1444 { 1445 "m2m:cin": 1446 { 1447 "ty":4, 1448 "ri": "cin-256599578", 1449 "pi": "cnt-790965889", 1450 "rn": "cin-256599578", 1451 "ct": "20150925T050515", 1452 "lt": "20150925T050515", 1453 "et": "20151107T154802", 1454 "st": 0, 1455 "cnf": "text/plain:0",

134 135 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 34 of 52 136 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 137 TR-0025-Application developer guide

1456 "vcs": 3, 1457 "con": "OFF" 1458 } 1459 } 1460 1461 1462 8.7.10.4 Retrieve a group of latest content instances for all light states

1463 A group of latest content instances can be retrieved via sending a RETRIEVE request targeting the group fanOutPoint 1464 virtual resource and appending latest as shown in the following procedures.

1465 If the response is preferred to be returned with a XML representation, the following is a HTTP request message 1466 example:

1467 HTTP Request: 1468 1469 GET /~/mn-cse/home_gateway/gateway_ae/containers_grp/fanOutPoint/latest 1470 HTTP/1.1 1471 Host: http://in.provider.com:8080 1472 X-M2M-Origin: /in-cse/Csmartphone_ae 1473 X-M2M-RI: mncse-55667 1474 Accept: application/xml 1475 1476 HTTP Response: 1477 1478 200 OK 1479 X-M2M-RSC: 2000 1480 X-M2M-RI: mncse-55667 1481 Content-Type: application/xml 1482 1483 1484 1486 1487 2000 1488 mncse-55667 1489 1490 1491 4 1492 cin-394798749 1493 cnt-181049109 1494 20150925T045938 1495 20150925T045938 1496 20151107T154802 1497 0 1498 text/plain:0 1499 3 1500 OFF 1501 1502 1503 /in-cse/Csmartphone_ae 1504 /mn-cse/cnt-582759912/latest 1505 1506 1507 2000 1508 mncse-55667 1509 1510 1511 4 1512 cin-256599578 1513 cnt-790965889 1514 20150925T050515 1515 20150925T050515 1516 20151107T154802 1517 0 1518 text/plain:0 1519 3 1520 OFF

138 139 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 35 of 52 140 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 141 TR-0025-Application developer guide

1521 1522 1523 /in-cse/Csmartphone_ae /mn-cse/cnt- 1524 582769893/latest 1525 1526 1527 1528 1529 If the response is preferred to be returned with a JSON representation, the following is a HTTP request message 1530 example:

1531 HTTP Request: 1532 1533 GET /~/mn-cse/home_gateway/containers_grp/fanOutPoint/latest HTTP/1.1 1534 Host: http://in.provider.com:8080 1535 X-M2M-Origin: /in-cse/Csmartphone_ae 1536 X-M2M-RI: mncse-55667 1537 Accept: application/json 1538 1539 HTTP Response: 1540 1541 200 OK 1542 X-M2M-RSC: 2000 1543 X-M2M-RI: mncse-55667 1544 Content-Type: application/json 1545 1546 { 1547 "m2m:agr": 1548 { 1549 "m2m:rsp":[ 1550 { 1551 "rsc": 2000, 1552 "rqi": "mncse-55667", 1553 "pc": 1554 { 1555 "m2m:cin": 1556 { 1557 "ty":4, 1558 "ri": "cin-394798749", 1559 "pi": "cnt-181049109", 1560 "rn": "cin-394798749", 1561 "ct": "20150925T045938", 1562 "lt": "20150925T045938", 1563 "et": "20151107T154802", 1564 "st": 0, 1565 "cnf":"text/plain:0", 1566 "cs": 3, 1567 "con": "OFF" 1568 } 1569 }, 1570 "to":"/in-cse/Csmartphone_ae", 1571 "fr":"/mn-cse/cnt-582759912/la" 1572 }, 1573 { 1574 "rsc":2000, 1575 "rqi": "mncse-55667", 1576 "pc": 1577 { 1578 "m2m:cin": 1579 { 1580 "ty":4, 1581 "ri":"cin-256599578", 1582 "pi":"cnt-790965889", 1583 "rn":"cin-256599578", 1584 "ct":"20150925T050515", 1585 "lt":"20150925T050515", 1586 "et":"20151107T154802", 1587 "st":0, 1588 "cnf":"text/plain:0",

142 143 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 36 of 52 144 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 145 TR-0025-Application developer guide

1589 "cs":3, 1590 "con":"OFF" 1591 } 1592 }, 1593 "to":"/in-cse/Csmartphone_ae", 1594 "fr":"/mn-cse/cnt-582769893/la" 1595 } 1596 ]} 1597 } 1598 1599 1600 8.7.11 Light state modification

1601 8.7.11.1 Introduction

1602 Once the smartphone application is registered with the IN-CSE, it can be granted access to resources including 1603 containers located in the MN-CSE so that smartphone application users can send light control commands for modifying 1604 the light states.

1605 When the user makes a change to the light state via the smartphone user interface, the smartphone application performs 1606 a new content instance creation procedure carrying the new state.

1607 The modification of a single light state is implemented by creating a new content instance resource for the specific 1608 container with access control policy acp1 (gateway_acp) while the modification of all light states is implemented by 1609 creating a new content instance resource for each member of group (containers_grp) with access control policy acp1 1610 (gateway_acp). The implementation of the latter case is to target the virtual resource of 1611 containers_grp resource with a content instance create request so that the content of all members of the group is 1612 updated together.

1613 8.7.11.2 Create a content instance under container of ADN-AE1

1614 1615 If the contentInstance create request body is represented in XML, the following is a HTTP request message example:

1616 HTTP Request: 1617 1618 POST /~/mn-cse/home_gateway/light_ae1/light?rcn=0 HTTP/1.1 1619 Host: http://mn.provider.com:8080 1620 X-M2M-Origin: /in-cse/Csmartphone_ae 1621 Content-Type: application/vnd.onem2m-res+xml;ty=4 1622 X-M2M-RI: mncse-11123 1623 1624 1625 text/plain:0 1626 ON 1627 1628 1629 HTTP Response: 1630 1631 201 Created 1632 X-M2M-RSC: 2001 1633 X-M2M-RI: mncse-11123 1634 Content-Location: /mn-cse/cin-789356234 1635 1636 If the contentInstance create request body is represented in JSON, the following is a HTTP request message example:

1637 HTTP Request: 1638 1639 POST /~/mn-cse/home_gateway/light_ae1/light?rcn=0 HTTP/1.1 1640 Host: http://mn.provider.com:8080 1641 X-M2M-Origin: /in-cse/Csmartphone_ae 1642 Content-Type: application/vnd.onem2m-res+json;ty=4 1643 X-M2M-RI: mncse-11123 1644 1645 {

146 147 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 37 of 52 148 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 149 TR-0025-Application developer guide

1646 "m2m:cin": 1647 { 1648 "cnf": "text/plains:0", 1649 "con": "ON" 1650 } 1651 } 1652 1653 HTTP Response: 1654 1655 201 Created 1656 X-M2M-RSC: 2001 1657 X-M2M-RI: mncse-11123 1658 Content-Location: /mn-cse/cin-789356234 1659 1660 1661 8.7.11.3 Create a content instance under container of ADN-AE2

1662 If the contentInstance create request body is represented in XML, the following is an HTTP request message the 1663 example:

1664 HTTP Request: 1665 1666 POST /~/mn-cse/home_gateway/light_ae2/light?rcn=0 HTTP/1.1 1667 Host: http://mn.provider.com:8080 1668 X-M2M-Origin: /in-cse/Csmartphone_ae 1669 Content-Type: application/vnd.onem2m-res+xml;ty=4 1670 X-M2M-RI: mncse-12222 1671 1672 1673 text/plain:0 1674 ON 1675 1676 1677 HTTP Response: 1678 1679 201 Created 1680 X-M2M-RSC: 2001 1681 X-M2M-RI: mncse/12222 1682 Content-Location: /mn-cse-cin-237896783 1683 1684 If the contentInstance create request body is represented in JSON, the following is a HTTP request message example:

1685 HTTP Request: 1686 1687 POST /~/mn-cse/home_gateway/light_ae2/light?rcn=0 HTTP/1.1 1688 Host: http://mn.provider.com:8080 1689 X-M2M-Origin: /in-cse/Csmartphone_ae 1690 Content-Type: application/vnd.onem2m-res+json;ty=4 1691 X-M2M-RI: mncse-12222 1692 1693 { 1694 "m2m:cin": 1695 { 1696 "cnf": "text/plains:0", 1697 "con": "ON" 1698 } 1699 } 1700 1701 HTTP Response: 1702 1703 201 Created 1704 X-M2M-RSC: 2001 1705 X-M2M-RI: mncse-12222 1706 Content-Location: /mn-cse/cin-237896783 1707 1708

150 151 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 38 of 52 152 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 153 TR-0025-Application developer guide

1709 8.7.11.4 Update the state of all lights using group fanout

1710 If the fanOutPoint request body is represented in XML, the following is a HTTP request message example:

1711 HTTP Request: 1712 1713 POST /~/mn-cse/home_gateway/gateway_ae/containers_grp/fanOutPoint HTTP/1.1 1714 Host: http://mn.provider.com:8080 1715 X-M2M-Origin: /in-cse/Csmartphone_ae 1716 Content-Type: application/vnd.onem2m-res+xml 1717 X-M2M-RI: mncse-33344 1718 1719 1720 1721 text/plain:0 1722 ON 1723 1724 1725 HTTP Response: 1726 1727 200 OK 1728 X-M2M-RSC: 2000 1729 X-M2M-RI: mncse-33344 1730 Content-Type: application/xml 1731 1732 1733 1735 1736 2001 1737 mncse-33344 1738 1739 1740 4 1741 cin-479874939 1742 cnt-181049109 1743 20151025T045938 1744 20151025T045938 1745 20151207T154802 1746 0 1747 2 1748 1749 1750 /in-cse/Csmartphone_ae 1751 /mn-cse/cnt-582759912 1752 1753 1754 2001 1755 mncse-33344 1756 1757 1758 4 1759 cin-659957825 1760 cnt-790965889 1761 20151025T045938 1762 20151025T045938 1763 20151207T154802 1764 0 1765 2 1766 1767 1768 /in-cse/Csmartphone_ae 1769 /mn-cse/cnt-582769893 1770 1771 1772 1773 If the fanOutPoint request body is represented in JSON, the following is a HTTP request message example:

1774 HTTP Request:

154 155 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 39 of 52 156 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 157 TR-0025-Application developer guide

1775 1776 POST /~/mn-cse/home_HTTP/1.1 1777 Host: http://mn.provider.com:8080 1778 X-M2M-Origin: /in-cse/Csmartphone_ae 1779 Content-Type: application/vnd.onem2m-res+json 1780 X-M2M-RI: mncse-33344 1781 1782 { 1783 "m2m:cin": 1784 { 1785 "cnf": "text/plains:0", 1786 "con": "ON" 1787 } 1788 } 1789 1790 HTTP Response: 1791 1792 200 OK 1793 X-M2M-RSC: 2000 1794 X-M2M-RI: mncse-33344 1795 Content-Type: application/json 1796 1797 { 1798 "m2m:agr": 1799 { 1800 "m2m:rsp": 1801 [{ 1802 "rsc": 2001, 1803 "rqi":"mncse-33344", 1804 "pc": 1805 { 1806 "m2m:cin": 1807 { 1808 "ty": 4, 1809 "ri": "cin-479874939", 1810 "pi": "cnt-181049109", 1811 "rn": "cin-479874939", 1812 "ct": "20151025T045938", 1813 "lt": "20151025T045938", 1814 "et": "20151207T154802", 1815 "st": 0, 1816 "cs": 2 1817 } 1818 }, 1819 "to": "/in-cse/Csmartphone_ae", 1820 "fr": "/mn-cse/cnt-582759912" 1821 }, 1822 { 1823 "rsc": 2001, 1824 "rqi": "mncse-33344", 1825 "pc": 1826 { 1827 "m2m:cin": 1828 { 1829 "ty": 4, 1830 "ri": "cin-659957825", 1831 "pi": "cnt-790965889", 1832 "rn": "cin-659957825", 1833 "ct": "20151025T050515", 1834 "lt": "20151025T050515", 1835 "et": "20151207T154802", 1836 "st": 0, 1837 "cs": 2 1838 } 1839 }, 1840 "to": "/in-cse/Csmartphone_ae ", 1841 "fr": "/mn-cse/cnt-582769893" 1842 } 1843 ]}

158 159 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 40 of 52 160 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 161 TR-0025-Application developer guide

1844 } 1845 1846 1847 8.7.12 Notifications

1848 8.7.12.1 Introduction

1849 Each time a content instance is created under a container of an ADN-AE, then a notification containing the whole create 1850 d content instance is posted to the targeted subscriber i.e. ADN-AE1 or ADN-AE2, that can actuate the light with the ne 1851 w state received in the notification.

1852 8.7.12.2 Post a notification to ADN-AE1

1853 If the notification request body is represented in XML, the following is a HTTP request message example:

1854 HTTP Request: 1855 1856 POST / HTTP/1.1 1857 Host: http://192.168.0.10:9090 1858 X-M2M-Origin: /mn-cse 1859 X-M2M-RI: notif-12345 1860 Content-Type: application/vnd.onem2m-ntfy+xml 1861 1862 1863 1865 1866 1867 1868 text/plain:0 1869 ON 1870 1871 1872 1873 1874 /mn-cse/sub-856593979 1875 1876 1877 1878 1879 HTTP Response: 1880 1881 200 OK 1882 X-M2M-RSC: 2000 1883 X-M2M-RI: notif-12345 1884 1885 If the notification request body is represented in JSON, the following is a HTTP request message: 1886 1887 HTTP Request: 1888 1889 POST / HTTP/1.1 1890 Host: http://192.168.0.10:9090 1891 X-M2M-Origin: /mn-cse 1892 X-M2M-RI: notif-12345 1893 Content-Type: application/vnd.onem2m-ntfy+json 1894 1895 { 1896 "m2m:sgn": 1897 { 1898 "nev":{ 1899 "rep": 1900 { 1901 "cin": 1902 { 1903 "cnf": "text/plain:0", 1904 "con": "ON"

162 163 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 41 of 52 164 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 165 TR-0025-Application developer guide

1905 }, 1906 "rss":201 1907 } 1908 }, 1909 "sur":"/mn-cse/sub-856593979" 1910 } 1911 } 1912 1913 HTTP Response: 1914 1915 200 OK 1916 X-M2M-RSC: 2000 1917 X-M2M-RI: notif-12345 1918 1919 8.7.12.3 Post a notification to ADN-AE2

1920 If the notification request body is represented in XML, the following is a HTTP request message example:

1921 HTTP Request: 1922 1923 POST / HTTP/1.1 1924 Host: http://192.168.0.20:9090 1925 X-M2M-Origin: /mn-cse 1926 X-M2M-RI: notif-12346 1927 Content-Type: application/vnd.onem2m-ntfy+xml 1928 1929 1930 1932 1933 1934 1935 text/plain:0 1936 ON 1937 1938 201 1939 1940 1941 1942 /mn-cse/sub-856463728 1943 1944 1945 1946 HTTP Response: 1947 1948 200 OK 1949 X-M2M-RSC: 2000 1950 X-M2M-RI: notif-12346 1951 1952 If the notification request body is represented in JSON, the following is a HTTP request message example: 1953 1954 HTTP Request: 1955 1956 POST / HTTP/1.1 1957 Host: http://192.168.0.20:9090 1958 X-M2M-Origin: /mn-cse 1959 X-M2M-RI: notif-12346 1960 Content-Type: application/vnd.onem2m-ntfy+json 1961 1962 1963 { 1964 "m2m:sgn": 1965 { 1966 "nev":{ 1967 "rep": 1968 { 1969 "cin": 1970 {

166 167 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 42 of 52 168 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 169 TR-0025-Application developer guide

1971 "cnf": "text/plain:0", 1972 "con": "ON" 1973 }, 1974 "rss":201 1975 } 1976 }, 1977 "sur":"/mn-cse/sub-856463728" 1978 } 1979 } 1980 1981 HTTP Response: 1982 1983 200 OK 1984 X-M2M-RSC: 2000 1985 X-M2M-RI: notif-12346 1986

1987 9 Conclusion

1988 A remote light control use case is proposed to remotely control lights in a home using a smartphone application which 1989 is granted access to the oneM2M service platform resources. The current use case is realized by following the high level 1990 procedures such as registration of smart devices, gateway with the oneM2M service platform, container and content 1991 instances creation, group resource creation, content instance retrieveal, content instances subscription and notifications 1992 etc.

1993 The practice of current remote lights control use case mapping into an oneM2M service platform leads to serveral 1994 attention points as follows.

1995  JSON serialization and CoAP binding of oneM2M primitives are intended to be covered in other use cases;

1996  The current use case will be updated to oneM2M Release 2.0.

1997

170 171 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 43 of 52 172 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 173 TR-0025-Application developer guide

1998 Annex A: 1999 Reading Resources

2000 Annex A.1 Introduction

2001 The information of resources created during each call flow of current use case can be retrieved via smartphone 2002 application IN-AE initiates a RETRIEVE request to the target resources as following.

2003 Annex A.2 CSE resources

2004 Annex A.2.1 IN-CSE

2005 HTTP Request: 2006 2007 GET /~/in-cse/server HTTP/1.1 2008 Host: http://in.provider.com:8080 2009 X-M2M-Origin: /mn-cse/Cgateway_ae 2010 X-M2M-RI: incse-12345 2011 Accept: application/xml 2012 2013 HTTP Response: 2014 2015 200 OK 2016 X-M2M-RSC: 2000 2017 X-M2M-RI: incse-12345 2018 Content-Type: application/vnd.onem2m-res+xml 2019 2020 2021 2023 5 2024 /in-cse 2025 20150925T045938 2026 20150925T045938 2027 /in-cse/acp-666957710 2028 1 2029 in-cse 2030 1 2 3 4 5 9 14 15 16 17 23 2031 http://in.provider.com:8080/ 2032 2033

2034 Annext A.2.2 MN-CSE

2035 HTTP Request: 2036 2037 GET /~/in-cse/server/home_gateway HTTP/1.1 2038 Host: http://mn.provider.com:8080 2039 X-M2M-Origin: /in-cse/Csmartphone_ae 2040 X-M2M-RI: incse-12346 2041 Accept: application/xml 2042 2043 HTTP Response: 2044 2045 200 OK 2046 X-M2M-RSC: 2000 2047 X-M2M-RI: incse-12346 2048 Content-Type: application/vnd.onem2m-res+xml

174 175 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 44 of 52 176 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 177 TR-0025-Application developer guide

2049 2050 2051 2052 16 2053 csr-299409504 2054 /in-cse 2055 20150925T045938 2056 20150925T045938 2057 20171005T105550 2058 /in-cse/acp-666957710 2059 http://mn.provider.com:8080/ 2060 mn.provider.com/mn-cse 2061 /mn-cse 2062 true 2063

2064 Annex A.3 Gateway device application MN-AE

2065 HTTP Request: 2066 2067 GET /~/mn-cse/home_gateway/gateway_ae HTTP/1.1 2068 Host: http://mn.provider.com:8080 2069 X-M2M-Origin: /in-cse/Csmartphone_ae 2070 X-M2M-RI: mncse-12347 2071 Accept: application/xml 2072 2073 HTTP Response: 2074 2075 200 OK 2076 X-M2M-RSC: 2000 2077 X-M2M-RI: mncse-12347 2078 Content-Type: application/vnd.onem2m-res+xml 2079 2080 2081 2082 2 2083 ae-CAE340303271 2084 /mn-cse 2085 20150925T052438 2086 20150925T052438 2087 20171005T105550 2088 /mn-cse/acp-805496226 2089 A01.com.company.gatewayApp 2090 CAE340303271 2091 false 2092

2093 Annex A.4. Light device applications

2094 Annex A.4.1 ADN-AE1

2095 HTTP Request: 2096 2097 GET /~/mn-cse/home_gateway/light_ae1 HTTP/1.1 2098 Host: http://mn.provider.com:8080 2099 X-M2M-Origin: /mn-cse/Cgateway_ae 2100 X-M2M-RI: mncse-12347 2101 Accept: application/xml 2102 2103 HTTP Response: 2104 2105 200 OK 2106 X-M2M-RSC: 2000 2107 X-M2M-RI: mncse-12347 2108 Content-Type: application/vnd.onem2m-res+xml

178 179 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 45 of 52 180 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 181 TR-0025-Application developer guide

2109 2110 2111 2112 2 2113 ae-CAE340304071 2114 /mn-cse 2115 20150925T052455 2116 20150925T052455 2117 20171005T105550 2118 /mn-cse/acp-805496226 2119 A01.com.company.lightApp1 2120 CAE340304071 2121 true 2122 2123

2124 Annex A.4.2 ADN-AE2

2125 HTTP Request: 2126 2127 GET /~/mn-cse/home_gateway/light_ae2 HTTP/1.1 2128 Host: http://mn.provider.com:8080 2129 X-M2M-Origin: /mn-cse/Cgateway_ae 2130 X-M2M-RI: mncse-12348 2131 Accept: application/xml 2132 2133 HTTP Response: 2134 2135 200 OK 2136 X-M2M-RSC: 2000 2137 X-M2M-RI: mncse-12348 2138 Content-Type: application/vnd.onem2m-res+xml 2139 2140 2141 2142 2 2143 ae-CAE340304042 2144 /mn-cse 2145 20150925T052542 2146 20150925T052542 2147 20171005T105550 2148 /mn-cse/acp-805496226 2149 A01.com.company.lightApp2 2150 CAE340304042 2151 true 2152 2153

2154 Annex A.5 Smartphone application IN-AE

2155 HTTP Request: 2156 2157 GET /~/in-cse/server/smartphone_ae HTTP/1.1 2158 Host: http://in.provider.com:8080 2159 X-M2M-Origin: /mn-cse/Cgateway_ae 2160 X-M2M-RI: incse-12349 2161 Accept: application/xml 2162 2163 Resonse status: 2164 2165 200 OK 2166 X-M2M-RSC: 2000 2167 X-M2M-RI: incse-12349 2168 Content-Type: application/vnd.onem2m-res+xml 2169

182 183 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 46 of 52 184 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 185 TR-0025-Application developer guide

2170 Resonse message: 2171 2172 2173 2174 2 2175 ae-CAE340304178 2176 /in-cse 2177 20150925T052622 2178 20150925T052622 2179 20171005T105550 2180 /in-cse/acp-666957710 2181 A01.com.company.lightControlApp 2182 CAE340304178 2183 false 2184

2185 Annex A.6 Access control policy

2186 HTTP Request: 2187 2188 GET /~/mn-cse/home_gateway/gateway_acp HTTP/1.1 2189 Host: http://mn.provider.com:8080 2190 X-M2M-Origin: /mn-cse/Cgateway_ae 2191 X-M2M-RI: mncse-12350 2192 Accept: application/xml 2193 2194 HTTP Response: 2195 2196 200 OK 2197 X-M2M-RSC: 2000 2198 X-M2M-RI: mncse-12350 2199 Content-Type: application/vnd.onem2m-res+xml 2200 2201 2202 1 2203 acp-805496226 2204 /mn-cse 2205 20150925T050238 2206 20150925T050238 2207 20171005T105550 2208 2209 2210 /in-cse/home_gateway /mn-cse/Cgateway_ae /mn-cse/Clight_ae1 /mn- 2211 cse/Clight_ae2 /in-cse/Csmartphone_ae 2212 63 2213 2214 2215 2216 2217 /in-cse/home_gateway /mn-cse/Cgateway_ae /mn-cse/Clight_ae1 /mn- 2218 cse/Clight_ae2 /in-cse/Csmartphone_ae 2219 51 2220 2221 2222 2223

2224 Annex A.7 Containers

2225 Annex A.7.1 Container under ADN-AE1

2226 HTTP Request: 2227 2228 GET /~/mn-cse/home_gateway/light_ae1/light HTTP/1.1 2229 Host: http://mn.provider.com:8080

186 187 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 47 of 52 188 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 189 TR-0025-Application developer guide

2230 X-M2M-Origin: /mn-cse/Cgateway_ae 2231 X-M2M-RI: mncse-12351 2232 Accept: application/xml 2233 2234 HTTP Response: 2235 2236 200 OK 2237 X-M2M-RSC: 2000 2238 X-M2M-RI: mncse-12351 2239 Content-Type: application/vnd.onem2m-res+xml 2240 2241 2242 2243 3 2244 cnt-582759912 2245 /mn-cse/ae-CAE340304071 2246 20150925T052955 2247 20150925T052955 2248 20171005T105550 2249 /mn-cse/acp-805496226 2250 0 2251 1 2252 3 2253 2254

2255 Annex A.7.2 Container under ADN-AE2

2256 HTTP Request: 2257 2258 GET /~/mn-cse/home_gateway/light_ae2/light HTTP/1.1 2259 Host: http://mn.provider.com:8080 2260 X-M2M-Origin: /mn-cse/Cgateway_ae 2261 X-M2M-RI: mncse-12352 2262 Accept: application/xml 2263 2264 HTTP Response: 2265 2266 200 OK 2267 X-M2M-RSC: 2000 2268 X-M2M-RI: mncse-12352 2269 Content-Type: application/vnd.onem2m-res+xml 2270 2271 2272 2273 3 2274 cnt-582769893 2275 /mn-cse/ae-CAE340304042 2276 20150925T053135 2277 20150925T053135 2278 20171005T105550 2279 /mn-cse/acp-805496226 2280 0 2281 1 2282 3 2283 2284

2285 Annex A.8 ContentInstances

2286 Annex A.8.1 Latest contentInstance in ADN-AE1

2287 HTTP Request: 2288

190 191 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 48 of 52 192 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 193 TR-0025-Application developer guide

2289 GET /~/mn-cse/home_gateway/light_ae1/light/latest HTTP/1.1 2290 Host: http://mn.provider.com:8080 2291 X-M2M-Origin: /mn-cse/Cgateway_ae 2292 X-M2M-RI: mncse-12353 2293 Accept: application/xml 2294 2295 HTTP Response: 2296 2297 200 OK 2298 X-M2M-RSC: 2000 2299 X-M2M-RI: mncse-12353 2300 Content-Type: application/vnd.onem2m-res+xml 2301 2302 2303 2305 4 2306 cin-394798749 2307 /mn-cse/cnt-582759912 2308 20150925T053225 2309 20150925T053225 2310 20171005T105550 2311 0 2312 text/plain:0 2313 2 2314 ON 2315 2316

2317 Annex A.8.2 Latest contentInstance in ADN-AE2

2318 HTTP Request: 2319 2320 GET /~/mn-cse/home_gateway/light_ae2/light/latest HTTP/1.1 2321 Host: http://mn.provider.com:8080 2322 X-M2M-Origin: /mn-cse/Cgateway_ae 2323 X-M2M-RI: mncse-12354 2324 Accept: application/xml 2325 2326 HTTP Response: 2327 2328 200 OK 2329 X-M2M-RSC: 2000 2330 X-M2M-RI: mncse-12354 2331 Content-Type: application/vnd.onem2m-res+xml 2332 2333 2334 2336 4 2337 cin-256599578 2338 /mn-cse/cnt-582769893 2339 20150925T053425 2340 20150925T053425 2341 20171005T105550 2342 0 2343 text/plain:0 2344 2 2345 ON 2346 2347

194 195 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 49 of 52 196 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 197 TR-0025-Application developer guide

2348 Annex A.9 Subscriptions

2349 Annex A.9.1 Subscription to container in ADN-AE1

2350 HTTP Request: 2351 2352 GET /~/mn-cse/home_gateway/light_ae1/light/lightstate_sub1 HTTP/1.1 2353 Host: http://mn.provider.com:8080 2354 X-M2M-Origin: /mn-cse/Cgateway_ae 2355 X-M2M-RI: mncse-12355 2356 Accept: application/xml 2357 2358 HTTP Response: 2359 2360 200 OK 2361 X-M2M-RSC: 2000 2362 X-M2M-RI: mncse-12355 2363 Content-Type: application/vnd.onem2m-res+xml 2364 2365 2366 2367 23 2368 sub-856593979 2369 /mn-cse/cnt-582759912 2370 20150926T052955 2371 20150926T052955 2372 20171005T105550 2373 /mn-cse/acp-805496226 2374 2375 3 2376 2377 /mn-cse/ae-CAE340304071 2378 1 2379 2380

2381 Annex A.9.2 Subscription to container in ADN-AE2

2382 HTTP Request: 2383 2384 GET /~/mn-cse/home_gateway/light_ae2/light/lightstate_sub2 HTTP/1.1 2385 Host: http://mn.provider.com:8080 2386 X-M2M-Origin: /mn-cse/Cgateway_ae 2387 X-M2M-RI: mncse-12356 2388 Accept: application/xml 2389 2390 HTTP Response: 2391 2392 200 OK 2393 X-M2M-RSC: 2000 2394 X-M2M-RI: mncse-12356 2395 Content-Type: application/vnd.onem2m-res+xml 2396 2397 2398 2399 23 2400 sub-856463728 2401 /mn-cse/cnt-582759912 2402 20150926T053055 2403 20150926T053055 2404 20171005T105550 2405 /mn-cse/acp-805496226 2406 2407 3 2408

198 199 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 50 of 52 200 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 201 TR-0025-Application developer guide

2409 /mn-cse/ae-CAE340304042 2410 1 2411

2412 Annex A.10 Groups

2413 Annex A.10.1 Group1

2414 HTTP Request: 2415 2416 GET /~/mn-cse/home_gateway/gateway_ae/containers_grp HTTP/1.1 2417 Host: http://mn.provider.com:8080 2418 X-M2M-Origin: /in-cse/Csmartphone_ae 2419 X-M2M-RI: mncse-12357 2420 Accept: application/xml 2421 2422 HTTP Response: 2423 2424 200 OK 2425 X-M2M-RSC: 2000 2426 X-M2M-RI: mncse-12357 2427 Content-Type: application/vnd.onem2m-res+xml 2428 2429 2430 2431 9 2432 grp-977978327 2433 /mn-cse/ae-CAE340303271 2434 20151004T045954 2435 20151004T045954 2436 20171005T105550 2437 /mn-cse/acp-805496226 /mn-cse/acp-805496226 2438 3 2439 2 2440 10 2441 /mn-cse/cnt-582759912 /mn-cse/cnt-582769893 2442 true 2443 1 2444 /mn-cse/grp-977978327/fanOutPoint 2445

2446 2447

2448

2449

2450

2451 History

2452 Publication history V.1.0.0 02 Feb 2016 Updated Release 1 - Publication

2453

202 203 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 51 of 52 204 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1. 205 TR-0025-Application developer guide

2454

Draft history (to be removed on publication)

V.1.1.0 31 Aug 2016 Implemented the agreed contribution from TST#24.1

TST-2016-0117R03-CR_Adding_JSON_support_into_app_developer_guide

V1.2.0 29 Oct 2016 Implemented the agreed contribution from TST#25

TST-2016-0186R02-TR-0025_Developer_Guide_Correction

2455

2456

206 207 © oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) Page 52 of 52 208 This is a draft oneM2M document and should not be relied upon; the final version, if any, will be made available by oneM2M Partners Type 1.

Recommended publications