8.7 Implementation Procedures
8.7.1 Introduction
The implementation procedures in the current use case are mapped into HTTP bindings with both XML and JSON serializations of oneM2M primitives according to the standard APIs describing the reference points Mca and Mcc, as defined in oneM2M TS-0001 [i.2], oneM2M TS-0004 [i.3], the HTTP binding TS-0009 [i.4].
In addition, short names for the representation of the resources and attributes are used in the implementation procedures.
8.7.2 MN-CSE registration
The implementation starts with the registration of MN-CSE with IN-CSE as shown in the following procedure.
The following example shows the MN-CSE registration request and response using XML serialization.
HTTP Request:
POST /~/in-cse/server?rcn=0 HTTP/1.1
Host: in.provider.com:8080
X-M2M-Origin: /mn-cse
Content-Type: application/xml;ty=16
X-M2M-RI: incse-88643
<?xml version="1.0" encoding="UTF-8"?>
<m2m:csr xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="home_gateway">
<csi>mn-cse</csi>
<cb>mn.provider.com/mn-cse</cb>
<rr>true</rr>
<poa>http://mn.provider.com:8080</poa>
<cst>2</cst>
<acpi>/in-cse/acp-666957710</acpi>
</m2m:csr>
HTTP Response:
The following example shows the MN-CSE registration request and response using HTTP with JSON serialization:
HTTP Request:
POST /~/in-cse/server?rcn=0 HTTP/1.1
Host: in.provider.com:8080
X-M2M-Origin: /mn-cse
Content-Type: application/json;ty=16
X-M2M-RI: incse-88643
{
"m2m:csr": {
"rn": "home_gateway",
"csi": "mn-cse",
"cb": "mn.provider.com/mn-cse",
"rr": true,
"poa": [
"http://mn.provider.com:8080"
],
"cst": 2,
"acpi": [
"/in-cse/acp-666957710"
]
}
}
HTTP Response:
8.7.3 Access control policy creation
When an access control policy resource is created, a list of one or more allowed request originators is specified in the acor field and the allowed operations in the acop field.
The value of acop is set to 63 which indicates that the specified originator is granted privileges to conduct CREATE, RETRIEVE, UPDATE, DELETE, DISCOVERY, and NOTIFY operations.
The creation of access control policy resource gateway_acp in MN-CSE is implemented in the following procedure.
The following example shows an access control policy create request and response using HTTP with XML serialization.
HTTP Request:
POST /~/mn-cse/home_gateway?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Cgateway_ae
Content-Type: application/xml;ty=1
X-M2M-RI: mncse-62948
<m2m:acp xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="gateway_acp">
<pv>
<acr>
<acor>Cgateway_ae Clight_ae1 Clight_ae2 /in-cse/Csmartphone_ae</acor>
<acop>63</acop>
</acr>
</pv>
<pvs>
<acr>
<acor>Cgateway_ae</acor>
<acop>51</acop>
</acr>
</pvs>
</m2m:acp>
HTTP Response:
The following example shows an access control policy create request and response using HTTP with XML serialization.
HTTP Request:
POST /~/mn-cse/home_gateway?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Cgateway_ae
Content-Type: application/json;ty=1
X-M2M-RI: mncse-62948
{
"m2m:acp": {
"rn": "gateway\_acp",
"pv": {
"acr": [
{
"acor": [
"Cgateway_ae",
"Clight_ae1",
"Clight_ae2",
"/in-cse/Csmartphone_ae"
],
"acop": 63
}
]
},
"pvs": {
"acr": [
{
"acor": [
"Cgateway_ae"
],
"acop": 51
}
]
}
}
}
HTTP Response:
The access control policy resource is used to grant applications the access rights to conduct specific operations and access to specific resources. The list of applications could be obtained with a discovery procedure using filter criteria conditions. For more details about the discovery procedure, please go to clause 8.7.9. Here it is required that the list of applications has been discovered before creating the access control policy resource.
8.7.4 Application entities registration
8.7.4.1 Light application ADN-AE1
The registration of ADN-AE1 with MN-CSE is shown in the following procedure. Note that the access control policy identifier (unstructured SP-relative resourceID) which is assigned to ADN-AE1 is /mn-cse/acp-805496226
.
The following example shows an ADN-AE registration request and response using HTTP with XML serialization.
HTTP Request:
POST /home_gateway?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: C
Content-Type: application/xml;ty=2
X-M2M-RI: mncse-92345
<xml version="1.0" encoding="UTF-8"?>
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="light_ae1">
<api>A01.com.company.lightApp1</api>
<rr>true</rr>
<poa>http://192.168.0.10:9090</poa>
<acpi>/mn-cse/acp-805496226</acpi>
</m2m:ae>
HTTP Response:
The following example shows an ADN-AE registration request and response using HTTP with JSON serialization.
HTTP Request:
POST /home_gateway?rcn=0 HTTP/1.1
Host: mn.provider.com:8080#
X-M2M-Origin: C
Content-Type: application/json;ty=2
X-M2M-RI: mncse-92345
{
"m2m:ae": {
"rn": "light_ae1",
"api": "A01.com.company.lightApp1",
"rr": true,
"poa": [
"http://192.168.0.10:9090"
],
"acpi": [
"/mn-cse/acp-805496226"
]
}
}
HTTP Response:
8.7.4.2 Light application ADN-AE2
The registration of ADN-AE2 with MN-CSE is shown in the following procedure. Note that the access control policy identifier (unstructured SP-relative resourceID) which is assigned to ADN-AE2 is /mn-cse/acp-805496226
.
The following example shows an ADN-AE registration request and response using HTTP with XML serialization.
HTTP Request:
POST /home_gateway?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: C
Content-Type: application/xml;ty=2
X-M2M-RI: mncse-18346
<?xml version="1.0" encoding="UTF-8"?>
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="light_ae2">
<api>A01.com.company.lightApp2</api>
<rr>true</rr>
<poa>http://192.168.0.20:9090</poa>
<acpi>/mn-cse/acp-805496226</acpi>
</m2m:ae>
HTTP Response:
The following example shows an ADN-AE registration request and response using HTTP with JSON serialization.
HTTP Request:
POST /home_gateway?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: C
Content-Type: application/json;ty=2
X-M2M-RI: mncse-18346
{
"m2m:ae": {
"rn": "light_ae2",
"api": "A01.com.company.lightApp2",
"rr": true,
"poa": [
"http://192.168.0.20:9090"
],
"acpi": [
"/mn-cse/acp-805496226"
]
}
}
HTTP Response:
8.7.4.3 Home gateway application MN-AE
The registration of MN-AE with MN-CSE is shown in the following procedure. Note that the access control policy identifier (unstructured SP-relative resourceID) which is assigned to MN-AE is /mn-cse/acp-805496226
.
The following example shows an MN-AE registration request and response using HTTP with XML serialization.
HTTP Request:
POST /home_gateway?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: C
Content-Type: application/xml;ty=2
X-M2M-RI: mncse-19347
<?xml version="1.0" encoding="UTF-8"?>
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="gateway_ae">
<api>A01.com.company.gatewayApp</api>
<rr>false</rr>
<acpi>/mn-cse/acp-805496226</acpi>
</m2m:ae>
HTTP Response:
The following example shows an MN-AE registration request and response using HTTP with JSON serialization.
HTTP Request:
POST /home_gateway?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: C
Content-Type: application/json;ty=2
X-M2M-RI: mncse-19347
{
"m2m:ae": {
"rn": "gateway_ae",
"api": "A01.com.company.gatewayApp",
"rr": false,
"acpi": [
"/mn-cse/acp-805496226"
]
}
}
HTTP Response:
8.7.4.4 Smartphone application IN-AE
The registration of IN-AE with IN-CSE is shown in the following procedure. Note that the access control policy identifier (unstructured SP-relative resourceID) which is assigned to IN-AE is /in-cse/acp-666957710
.
The following example shows an IN-AE registration request and response using HTTP with XML serialization.
HTTP Request:
POST /server?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: C
Content-Type: application/xml;ty=2
X-M2M-RI: incse-16346
<?xml version="1.0" encoding="UTF-8"?>
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="smartphone_ae">
<api>A01.com.company.lightControlApp</api>
<rr>false</rr>
<acpi>/in-cse/acp-666957710</acpi>
</m2m:ae>
HTTP Response:
The following example shows an IN-AE registration request and response using HTTP with JSON serialization.
HTTP Request:
POST /server?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: C
Content-Type: application/json;ty=2
X-M2M-RI: incse-16346
{
"m2m:ae": {
"rn": "smartphone_ae",
"api": "A01.com.company.lightControlApp",
"rr": false,
"acpi": [
"/in-cse/acp-666957710"
]
}
}
HTTP Response:
8.7.5 Containers creation
8.7.5.1 Create a container of ADN-AE1
The creation of a container resource for ADN-AE1 is shown in the following procedure.
The following example shows a container create request and response using HTTP with XML serialization.
Editor note: \<?xml version="1.0" encoding="UTF-8"?> header is missing
HTTP Request:
POST /home_gateway/light\_ae1?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae1
Content-Type: application/xml;ty=3
X-M2M-RI: mncse/13345
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="light">
</m2m:cnt>
HTTP Response:
The following example shows a container create request and response using HTTP with JSON serialization.
HTTP Request:
POST /home\_gateway/light_ae1?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae1
Content-Type: application/json;ty=3
X-M2M-RI: mncse-13345
{
"m2m:cnt": {
"rn": "light"
}
}
HTTP Response:
8.7.5.2 Create a container of ADN-AE2
The creation of a container resource for ADN-AE2 is shown in the following procedure.
The following example shows a container create request and response using HTTP with XML serialization.
Editor note: \<?xml version="1.0" encoding="UTF-8"?> header is missing
HTTP Request:
POST /home_gateway/light_ae2?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae2
Content-Type: application/xml;ty=3
X-M2M-RI: mncse-62345
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="light">
</m2m:cnt>
HTTP Response:
The following example shows a container create request and response using HTTP with JSON serialization.
HTTP Request:
POST /home_gateway/light_ae2?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae2
Content-Type: application/json;ty=3
X-M2M-RI: mncse-62345
{
"m2m:cnt": {
"rn": "light"
}
}
HTTP Response:
8.7.6 ContentInstances creation
8.7.6.1 Create a content instance of ADN-AE1
The creation of a content instance resource under the light container of ADN-AE1 with initial content OFF is shown in the following procedure.
The following example shows a contentInstance create request and response using HTTP with XML serialization.
Editor note: \<?xml version="1.0" encoding="UTF-8"?> header is missing
HTTP Request:
POST /home_gateway/light_ae1/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae1
Content-Type: application/xml;ty=4
X-M2M-RI: mncse-24345
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols">
<cnf>text/plain:0</cnf>
<con>OFF</con>
</m2m:cin>
HTTP Response:
201 Created
X-M2M-RSC: 2001
X-M2M-RI: mncse-24345
Content-Location: /mn-cse/cin-394798749
Content-Type: application/xml
The following example shows a contentInstance create request and response using HTTP with JSON serialization.
HTTP Request:
POST /home_gateway/light_ae1/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae1
Content-Type: application/json;ty=4
X-M2M-RI: mncse-24345
{
"m2m:cin": {
"cnf": "text/plains:0",
"con": "OFF"
}
}
HTTP Response:
201 Created
X-M2M-RSC: 2001
X-M2M-RI: mncse-24345
Content-Location: /mn-cse/cin-394798749
Content-Type: application/json
8.7.6.2 Create a content instance of ADN-AE2
The creation of a content instance resource under the light container of ADN-AE2 with initial content OFF is shown in the following procedure.
The following example shows a contentInstance create request and response using HTTP with XML serialization.
Editor note: \<?xml version="1.0" encoding="UTF-8"?> header is missing
HTTP Request:
POST /home_gateway/light_ae2/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae1
Content-Type: application/xml;ty=4
X-M2M-RI: mncse-22345
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols">
<cnf>text/plain:0/cnf>
<con>OFF</con>
</m2m:cin>
HTTP Response:
The following example shows a contentInstance create request and response using HTTP with JSON serialization.
HTTP Request:
POST /home_gateway/light_ae2/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae1
Content-Type: application/json;ty=4
X-M2M-RI: mncse-22345
{
"m2m:cin": {
"cnf": "text/plains:0",
"con": "OFF"
}
}
HTTP Response:
8.7.7 Group creation
The creation of a group resource by the MN-AE is shown in the following procedure. The group resource is created with two initial member ids of the light container resources..
The following example shows a group create request and response using HTTP with XML serialization.
HTTP Request:
POST /home_gateway/gateway_ae?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Cgateway_ae
Content-Type: application/xml;ty=9
X-M2M-RI: mncse-76905
<?xml version="1.0" encoding="UTF-8"?>
<m2m:grp xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="containers_grp">
<mt>3</mt>
<mid>/mn-cse/cnt-582759912 /mn-cse/cnt-582769893</mid>
<mnm>10</mnm>
</m2m:grp>
HTTP Response:
The following example shows a group create request and response using HTTP with JSON serialization.
HTTP Request:
POST /home_gateway/gateway_ae?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Cgateway_ae
Content-Type: application/json;ty=9
X-M2M-RI: mncse-76905
{
"m2m:grp": {
"rn":"containers_grp",
"mt": 3,
"mid": [
"/mn-cse/cnt-582759912",
"/mn-cse/cnt-582769893"
],
"mnm": 10
}
}
HTTP Response:
8.7.8 Subscriptions creation
8.7.8.1 Subscription to the content instance of ADN-AE1
When a subscription resource is created, the notification content type (short for nct ) parameter is set to a value 1 to indicate that all attributes of the subscribed resource will be notified to the subscriber.
ADN-AE1 creates a subscription resource including the notification URI set to the resource identifier of ADN-AE1 so that the ADN-AE1 will get notified whenever a content instance child resource is created in the container . The corresponding subscription create request is shown in the following procedure.
The following example shows a subscription create request and response using HTTP with XML serialization.
HTTP Request:
POST /home_gateway/light_ae1/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae1
Content-Type: application/xml;ty=23
X-M2M-RI: mncse-67891
<?xml version="1.0" encoding="UTF-8"?>
<m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="lightstate_sub1">
<enc>
<net>3</net>
</enc>
<nu>Clight_ae1</nu>
<nct>1</nct>
</m2m:sub>
HTTP Response:
The following example shows a subscription create request and response using HTTP with JSON serialization.
HTTP Request:
POST /home_gateway/light_ae1/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae1
Content-Type: application/json;ty=23
X-M2M-RI: mncse-67891
{
"m2m:sub": {
"rn": "lightstate_sub1",
"enc": {
"net":<a href="#_ref_3">[
3
]</a>
},
"nu": ["Clight_ae1"
],
"nct": 1
}
}
HTTP Response:
8.7.8.2 Subscription to the content instance of ADN-AE2
When a subscription resource is created, the notification content type (short for nct ) parameter is set to a value 1 to indicate that all attributes of the subscribed resource will be notified to the subscriber.
ADN-AE1 creates a subscription resource including the notification URI set to the resource identifier of ADN-AE1 so that the ADN-AE1 will get notified whenever a content instance child resource is created in the container. The corresponding subscription create request is shown in the following procedure.
When a subscription resource is created, the notification content type (short for nct ) parameter is set to value 1 to indicate that all attributes of the subscribed resource will be notified to the subscriber.
ADN-AE2 creates a subscription resource including the notification URI set to the resource identifier of ADN-AE2 so that the ADN-AE2 will get notified whenever a content instance child resource is created in the container. The corresponding subscription create request is shown in the following procedures.
The following example shows a subscription create request and response using HTTP with XML serialization.
HTTP Request:
POST /home_gateway/light_ae2/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae2
Content-Type: application/xml;ty=23
X-M2M-RI: mncse-29387
<?xml version="1.0" encoding="UTF-8"?>
<m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="lightstate_sub2">
<enc>
<net>3</net>
</enc>
<nu>Clight_ae2</nu>
<nct>1</nct>
</m2m:sub>
HTTP Response:
The following example shows a subscription create request and response using HTTP with JSON serialization.
HTTP Request:
POST /home_gateway/light_ae2/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Clight_ae2
Content-Type: application/json;ty=23
X-M2M-RI: mncse-29387
{
"m2m:sub": {
"rn": "lightstate_sub2",
"enc": {
"net":<a href="#_ref_3">[
3
]</a>
},
"nu": ["Clight_ae2"
],
"nct": 1
}
}
HTTP Response:
8.7.9 Discovery
8.7.9.1 Introduction
The discovery functionality in oneM2M is implemented using a RETRIEVE operation along with one or multiple filter criteria parameters.
In order to enable the retrieve operation for resource discovery, parameter filterUsage (short for fu) is included in the RETRIEVE request as a query string.
In addition, parameter resource type (short for rty) is used as a filterCriteria condition for the discovery of single light and group light members. The parameter discovery result type (short for drt ) is set to 2 to indicate that the format of elements of URIList is unstructured. The detailed discovery procedures are presented in clauses 8.7.9.2 and 8.7.9.3.
8.7.9.2 Discovery of single light registered with MN-CSE
The discovery of containers for each light registered with the MN-CSE by the smartphone AE is shown in the following procedure.
If the discovery response is preferred to be returned with a XML representation, the HTTP request message is sent as following example.
HTTP Request:
GET /~/mn-cse/home_gateway?fu=1&rty=3&drt=2 HTTP/1.1
Host: in.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
X-M2M-RI: mncse-99882
Accept: application/xml
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-99882
X-M2M-CNST: 2
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:uril xmlns:m2m="http://www.onem2m.org/xml/protocols">
/mn-cse/cnt-582759912
/mn-cse/cnt-582769893
</m2m:uril>
If the discovery response is preferred to be returned with a JSON representation, the HTTP request message is sent as following example.
HTTP Request:
GET /~/mn-cse/home_gateway?fu=1&rty=3&drt=2 HTTP/1.1
Host: in.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
X-M2M-RI: mncse-99882
Accept: application/json
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-99882
X-M2M-CNST: 2
Content-Type: application/json
{
"m2m:uril": [
"/mn-cse/cnt-582759912",
"/mn-cse/cnt-582769893"
]
}
The smartphone application retrieves a list of URIs representing containers registered with MN-CSE from the response message, e.g. /mn-cse/cnt-582759912 which is the URI of container created in ADN-AE1. The retrieved URIs of the discovered containers are then used for the group member update operation.
8.7.9.3 Discovery of groups located in MN-CSE
The discovery of groups located in MN-CSE by the smartphone AE is shown in the following procedures.
If the discovery response is preferred to be returned with a XML representation, the HTTP request message is sent as following example:
HTTP Request:
GET /~/mn-cse/home_gateway?fu=1&rty=9&drt=2 HTTP/1.1
Host: in.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
X-M2M-RI: mncse-15001
Accept: application/xml
````
**HTTP Response**:
```http
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-15001
X-M2M-CNST: 2
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:uril xmlns:m2m="http://www.onem2m.org/xml/protocols">
/mn-cse/grp-977978327
</m2m:uril>
``````
If the discovery response is preferred to be returned with a JSON representation, the HTTP request message is sent as following example.
**HTTP Request**:
```http
GET /~/mn-cse/home_gateway?fu=1&rty=9&drt=2 HTTP/1.1
Host: in.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
X-M2M-RI: mncse-15001
Accept: application/json
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-15001
X-M2M-CNST: 2Content-Type: application/json
{
"m2m:uril": [
"/mn-cse/grp-977978327"
]
}
The smartphone application retrieves a list of URIs representing group resources located in MN-CSE from the response message, e.g. /mn-cse/grp-977978327
which is the URI of the group resource. The retrieved URIs of the discovered group resource are then used for the group member update operation.
8.7.10 Latest content instances retrieval
8.7.10.1 Introduction
The smartphone application can retrieve the latest light states via sending a RETRIEVE request targeting a container's la (short for latest ) virtual resource.
The smartphone application can also retrieve a group of latest light states via sending a RETRIEVE request targeting the group fanOutPoint virtual resource.
8.7.10.2 Retrieve the latest content instance of ADN-AE1
The latest content instance of the light container resource for ADN-AE1 can be retrieved by the following procedure.
If the response is preferred to be returned with a XML representation, the following is a HTTP request message example.
HTTP Request:
GET /~/mn-cse/home_gateway/light_ae1/light/la HTTP/1.1
Host: in.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
X-M2M-RI: mncse-11223
Accept: application/xml
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-11223
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="cin-394798749">
<ty>4</ty>
<ri>cin-394798749</ri>
<pi>cnt-181049109</pi>
<ct>20150925T045938</ct>
<lt>20150925T045938</lt>
<et>20151107T154802</et>
<st>0</st>
<cnf>text/plain:0</cnf>
<cs>3</cs>
<con>OFF</con>
</m2m:cin>
If the response is preferred to be returned with a JSON representation, the following is a HTTP request message example.
Editor note: correct the "lat" typo below.
GET /~/mn-cse/home_gateway/light_ae1/light/lat HTTP/1.1
Host: in.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
X-M2M-RI: mncse-11223
Accept: application/json
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-11223
Content-Type: application/json
{
"m2m:cin": {
"ty": 4,
"ri": "cin-394798749",
"pi": "cnt-181049109",
"ct": "20150925T045938",
"lt": "20150925T045938",
"et": "20151107T154802",
"st": 0,
"cnf": "text/plain:0",
"cs": 3,
"con": "OFF"
}
}
8.7.10.3 Retrieve the latest content instance of ADN-AE2
The latest content instance of the light container resource for ADN-AE2 can be retrieved by the following procedures.
If the response is preferred to be represented in XML, the following is a HTTP request message example.
HTTP Request:
GET /~/mn-cse/home_gateway/light_ae2/light/la HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
X-M2M-RI: mncse-22336
Accept: application/xml
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-22336
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="cin-256599578">
<ty>4</ty>
<ri>cin-256599578</ri>
<pi>cnt-790965889</pi>
<ct>20150925T050515</ct>
<lt>20150925T050515</lt>
<et>20151107T154802</et>
<st>0</st>
<cnf>text/plain:0</cnf>
<cs>3</cs>
<con>OFF</con>
</m2m:cin>
If the response is preferred be returned in representation of JSON, the following is a HTTP request message example.
HTTP Request:
GET /~/mn-HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
X-M2M-RI: mncse-22336
Accept: application/json
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-22336
Content-Type: application/json
{
"m2m:cin": {
"ty": 4,
"ri": "cin-256599578",
"pi": "cnt-790965889",
"ct": "20150925T050515",
"lt": "20150925T050515",
"et": "20151107T154802",
"st": 0,
"cnf": "text/plain:0",
"cs": 3,
"con": "OFF"
}
}
8.7.10.4 Retrieve a group of latest content instances for all light states
A group of latest content instances can be retrieved via sending a RETRIEVE request targeting the group fanOutPoint virtual resource and appending latest as shown in the following procedures.
If the response is preferred to be returned with a XML representation, the following is a HTTP request message example.
HTTP Request:
GET /~/mn-cse/home_gateway/containers_grp/fopt/la HTTP/1.1
Host: in.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
X-M2M-RI: mncse-55667
Accept: application/xml
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-55667
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:agr xmlns:m2m="http://www.onem2m.org/xml/protocols">
<m2m:rsp>
<rsc>2000</rsc>
<rqi>mncse-55667</rqi>
<pc>
<m2m:cin rn="cin-394798749">
<ty>4</ty>
<ri>cin-394798749</ri>
<pi>cnt-181049109</pi>
<ct>20150925T045938</ct>
<lt>20150925T045938</lt>
<et>20151107T154802</et>
<st>0</st>
<cnf>text/plain:0</cnf>
<cs>3</cs>
<con>OFF</con>
</m2m:cin>
</pc>
<to>/in-cse/Csmartphone_ae</to>
<fr>/mn-cse/cnt-582759912/la</fr>
</m2m:rsp>
<m2m:rsp>
<rsc>2000</rsc>
<rqi>mncse-55667</rqi>
<pc>
<m2m:cin rn="cin-256599578">
<ty>4</ty>
<ri>cin-256599578</ri>
<pi>cnt-790965889</pi>
<ct>20150925T050515</ct>
<lt>20150925T050515</lt>
<et>20151107T154802</et>
<st>0</st>
<cnf>text/plain:0</cnf>
<cs>3</cs>
<con>OFF</con>
</m2m:cin>
</pc>
<to>/in-cse/Csmartphone_ae</to>
<fr>/mn-cse/cnt-582769893/la</fr>
</m2m:rsp>
</m2m:agr>
If the response is preferred to be returned with a JSON representation, the following is a HTTP request message example.
HTTP Request:
GET /~/mn-cse/home_gateway/containers_grp/fopt/la HTTP/1.1
Host: in.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
X-M2M-RI: mncse-55667
Accept: application/json
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-55667
Content-Type: application/json
{
"m2m:agr": {
"m2m:rsp": [
{
"rsc": 2000,
"rqi": "mncse-55667",
"pc": {
"m2m:cin": {
"ty": 4,
"ri": "cin-394798749",
"pi": "cnt-181049109",
"ct": "20150925T045938",
"lt": "20150925T045938",
"et": "20151107T154802",
"st": 0,
"cnf": "text/plain:0",
"cs": 3,
"con": "OFF"
}
},
"to": "/in-cse/Csmartphone_ae",
"fr": "/mn-cse/cnt-582759912/la"
},
{
"rsc": 2000,
"rqi": "mncse-55667",
"pc": {
"m2m:cin": {
"ty": 4,
"ri": "cin-256599578",
"pi": "cnt-790965889",
"ct": "20150925T050515",
"lt": "20150925T050515",
"et": "20151107T154802",
"st": 0,
"cnf": "text/plain:0",
"cs": 3,
"con": "OFF"
}
},
"to": "/in-cse/Csmartphone_ae",
"fr": "/mn-cse/cnt-582769893/la"
}
]
}
}
8.7.11 Light state modification
8.7.11.1 Introduction
Once the smartphone application is registered with the IN-CSE, it can be granted access to resources including containers located in the MN-CSE so that smartphone application users can send light control commands for modifying the light states.
When the user makes a change to the light state via the smartphone user interface, the smartphone application performs a new content instance creation procedure carrying the new state.
The modification of a single light state is implemented by creating a new content instance resource for the specific container with access control policy acp1 (gateway_acp ) while the modification of all light states is implemented by creating a new content instance resource for each member of group (containers_grp ) with access control policy acp1 (gateway_acp ). The implementation of the latter case is to target the <fopt> virtual resource of containers_grp resource with a content instance create request so that the content of all members of the group is updated together.
8.7.11.2 Create a content instance under container of ADN-AE1
If the contentInstance create request body is represented in XML, the following is a HTTP request message example.
HTTP Request:
Editor note: \<?xml version="1.0" encoding="UTF-8"?> header is missing
POST /~/mn-cse/home_gateway/light_ae1/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
Content-Type: application/xml;ty=4
X-M2M-RI: mncse-11123
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols">
<cnf>text/plain:0</cnf>
<con>ON</con>
</m2m:cin>
HTTP Response:
If the contentInstance create request body is represented in JSON, the following is a HTTP request message example.
HTTP Request:
POST /~/mn-cse/home_gateway/light_ae1/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
Content-Type: application/json;ty=4
X-M2M-RI: mncse-11123
{
"m2m:cin": {
"cnf": "text/plains:0",
"con": "ON"
}
}
HTTP Response:
8.7.11.3 Create a content instance under container of ADN-AE2
If the contentInstance create request body is represented in XML, the following is an HTTP request message the example.
Editor note: \<?xml version="1.0" encoding="UTF-8"?> header is missing
HTTP Request:
POST /~/mn-cse/home_gateway/light_ae2/light?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
Content-Type: application/xml;ty=4
X-M2M-RI: mncse-12222
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols">
<cnf>text/plain:0</cnf>
<con>ON</con>
</m2m:cin>
HTTP Response:
If the contentInstance create request body is represented in JSON, the following is a HTTP request message example.
HTTP Request:
POST /~/mn-cse/home_HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
Content-Type: application/json;ty=4
X-M2M-RI: mncse-12222
{
"m2m:cin": {
"cnf": "text/plains:0",
"con": "ON"
}
}
HTTP Response:
8.7.11.4 Update the state of all lights using group fanout
If the fanOutPoint request body is represented in XML, the following is a HTTP request message example:.
HTTP Request:
POST /~/mn-cse/home_gateway/gateway_ae/containers_grp/fopt HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
Content-Type: application/xml;ty=4
X-M2M-RI: mncse-33344
<xml version="1.0" encoding="UTF-8"?>
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols">
<cnf>text/plain:0</cnf>
<con>ON</con>
</m2m:cin>
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-33344
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:agr xmlns:m2m="http://www.onem2m.org/xml/protocols">
<m2m:rsp>
<rsc>2001</rsc>
<rqi>mncse-33344</rqi>
<pc>
<m2m:cin rn="cin-479874939">
<ty>4</ty>
<ri>cin-479874939</ri>
<pi>cnt-181049109</pi>
<ct>20151025T045938</ct>
<lt>20151025T045938</lt>
<et>20151207T154802</et>
<st>0</st>
<cs>2</cs>
</m2m:cin>
</pc>
<to>/in-cse/Csmartphone_ae</to>
<fr>/mn-cse/cnt-582759912</fr>
</m2m:rsp>
<m2m:rsp>
<rsc>2001</rsc>
<rqi>mncse-33344</rqi>
<pc>
<m2m:cin rn="cin-659957825">
<ty>4</ty>
<ri>cin-659957825</ri>
<pi>cnt-790965889</pi>
<ct>20151025T045938</ct>
<lt>20151025T045938</lt>
<et>20151207T154802</et>
<st>0</st>
<cs>2</cs>
</m2m:cin>
</pc>
<to>/in-cse/Csmartphone_ae</to>
<fr>/mn-cse/cnt-582769893</fr>
</m2m:rsp>
</m2m:agr>
If the fanOutPoint request body is represented in JSON, the following is a HTTP request message example.
HTTP Request:
POST /~/mn-cse/home_gateway/gateway_ae/containers_grp/fopt HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: /in-cse/Csmartphone_ae
Content-Type: application/json;ty=4
X-M2M-RI: mncse-33344
{
"m2m:cin": {
"cnf": "text/plains:0",
"con": "ON"
}
}
HTTP Response:
200 OK
X-M2M-RSC: 2000
X-M2M-RI: mncse-33344
Content-Type: application/json
{
"m2m:agr": {
"m2m:rsp": [
{
"rsc": 2001,
"rqi": "mncse-33344",
"pc": {
"m2m:cin": {
"ty": 4,
"ri": "cin-479874939",
"pi": "cnt-181049109",
"ct": "20151025T045938",
"lt": "20151025T045938",
"et": "20151207T154802",
"st": 0,
"cs": 2
}
},
"to": "/in-cse/Csmartphone_ae",
"fr": "/mn-cse/cnt-582759912"
},
{
"rsc": 2001,
"rqi": "mncse-33344",
"pc": {
"m2m:cin": {
"ty": 4,
"ri": "cin-659957825",
"pi": "cnt-790965889",
"ct": "20151025T045938",
"lt": "20151025T045938",
"et": "20151207T154802",
"st": 0,
"cs": 2
}
},
"to": "/in-cse/Csmartphone_ae",
"fr": "/mn-cse/cnt-582769893"
}
]
}
}
8.7.12 Notifications
8.7.12.1 Introduction
Each time a content instance is created under a container of an ADN-AE, then a notification containing the whole created content instance is posted to the targeted subscriber i.e. ADN-AE1 or ADN-AE2, that can actuate the light with the new state received in the notification.
8.7.12.2 Post a notification to ADN-AE1
If the notification request body is represented in XML, the following is a HTTP request message example.
HTTP Request:
POST / HTTP/1.1
Host: 192.168.0.10:9090
X-M2M-Origin: /mn-cse
X-M2M-RI: notif-12345
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="cin-394798749">
<nev>
<rep>
<m2m:cin>
<ty>4</ty>
<ri>cin-394798749</ri>
<pi>cnt-790965889</pi>
<ct>20150925T050534</ct>
<lt>20150925T050534</lt>
<et>20151107T154802</et>
<st>0</st>
<cnf>text/plain:0</cnf>
<cs>3</cs>
<con>ON</con>
</m2m:cin>
</rep>
<net>3</net>
</nev>
<sur>/mn-cse/sub-856593979</sur>
</m2m:sgn>
HTTP Response:
If the notification request body is represented in JSON, the following is a HTTP request message example.
HTTP Request:
POST / HTTP/1.1
Host: 192.168.0.10:9090
X-M2M-Origin: /mn-cse
X-M2M-RI: notif-12345
Content-Type: application/json
{
"m2m:sgn": {
"nev": {
"rep": {
"m2m:cin": {
"ty": 4,
"ri": "cin-394798749",
"pi": "cnt-790965889",
"ct": "20150925T050534",
"lt": "20150925T050534",
"et": "20151107T154802",
"st": 0,
"cnf": "text/plain:0",
"cs": 3,
"con": "ON"
}
},
"net": 3
},
"sur": "/mn-cse/sub-856593979"
}
}
HTTP Response:
8.7.12.3 Post a notification to ADN-AE2
If the notification request body is represented in XML, the following is a HTTP request message example.
HTTP Request:
POST / HTTP/1.1
Host: 192.168.0.20:9090
X-M2M-Origin: /mn-cse
X-M2M-RI: notif-12346
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="cin-256599578">
<nev>
<rep>
<m2m:cin>
<ty>4</ty>
<ri>cin-256599578</ri>
<pi>cnt-790965889</pi>
<ct>20150925T050623</ct>
<lt>20150925T050623</lt>
<et>20151107T154802</et>
<st>0</st>
<cnf>text/plain:0</cnf>
<cs>3</cs>
<con>ON</con>
</m2m:cin>
</rep>
<net>3</net>
</nev>
<sur>/mn-cse/sub-856463728</sur>
</m2m:sgn>
HTTP Response:
If the notification request body is represented in JSON, the following is a HTTP request message example.
HTTP Request:
POST / HTTP/1.1
Host: 192.168.0.20:9090
X-M2M-Origin: /mn-cse
X-M2M-RI: notif-12346
Content-Type: application/json
{
"m2m:sgn": {
"nev": {
"rep": {
"m2m:cin": {
"ty": 4,
"ri": "cin-256599578",
"pi": "cnt-790965889",
"ct": "20150925T050623",
"lt": "20150925T050623",
"et": "20151107T154802",
"st": 0,
"cnf": "text/plain:0",
"cs": 3,
"con": "ON"
}
},
"net": 3
},
"sur": "/mn-cse/sub-856463728"
}
}
HTTP Response: