oneM2M Logo transparent 196x130

Standards for M2M and the Internet of Things

Light State Modification

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 while the modification of all light states can be implemented by creating a new content instance resource for each member of group (containers_grp). The implementation of the latter case is to target the fanOutPoint resource of containers_grp with a content instance create request so that the content of all members of the containers_grp can be updated together.

Create a content instance under container of ADN-AE1

HTTP Request with XML payload
    POST /~/mn-cse/home_gateway/light_ae1/light?rcn=0 HTTP/1.1
    Host: http://mn.provider.com:8080
    X-M2M-Origin: /in-cse/Csmartphone_ae
    X-M2M-RI: mncse-11123
    Content-Type: application/vnd.onem2m-res+xml; ty=4
        
    <m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols">
      <cnf>text/plain:0</cnf>
      <con>ON</con>
    </m2m:cin>
HTTP Response
    HTTP/1.1 201 Created
    X-M2M-RSC: 2001
    X-M2M-RI: mncse-11123
    Content-Location: /mn-cse/cin-789356234
HTTP Request with JSON payload
    POST /~/mn-cse/home_gateway/light_ae1/light?rcn=0 HTTP/1.1
    Host: http://mn.provider.com:8080
    X-M2M-Origin: /in-cse/Csmartphone_ae
    X-M2M-RI: mncse-11123
    Content-Type: application/vnd.onem2m-res+json; ty=4
        
    { "m2m:cin": {
        "cnf": "text/plain:0",
        "con": "ON"
      }
    }
HTTP Response
    HTTP/1.1 201 Created
    X-M2M-RSC: 2001
    X-M2M-RI: mncse-11123
    Content-Location: /mn-cse/cin-789356234

 

Create a content instance under container of ADN-AE2

HTTP Request with XML payload
    POST /~/mn-cse/home_gateway/light_ae2/light?rcn=0 HTTP/1.1
    Host: http://mn.provider.com:8080
    X-M2M-Origin: /in-cse/Csmartphone_ae
    X-M2M-RI: mncse-12222
    Content-Type: application/vnd.onem2m-res+xml; ty=4
        
    <m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols">
      <cnf>text/plain:0</cnf>
      <con>ON</con>
    </m2m:cin>
HTTP Response
    HTTP/1.1 201 Created
    X-M2M-RSC: 2001
    X-M2M-RI: mncse-12222
    Content-Location: /mn-cse-cin-237896783
HTTP Request with JSON payload
    POST /~/mn-cse/home_gateway/light_ae2/light?rcn=0 HTTP/1.1
    Host: http://mn.provider.com:8080
    X-M2M-Origin: /in-cse/Csmartphone_ae
    X-M2M-RI: mncse-12222
    Content-Type: application/vnd.onem2m-res+json; ty=4
        
    { "m2m:cin": {
        "cnf": "text/plain:0",
        "con": "ON"
      }
    }
HTTP Response
    HTTP/1.1 201 Created
    X-M2M-RSC: 2001
    X-M2M-RI: mncse-12222
    Content-Location: /mn-cse-cin-237896783

 

Update the state of all lights using group fanout

HTTP Request with XML payload
    POST /~/mn-cse/home_gateway/gateway_ae/containers_grp/fopt HTTP/1.1
    Host: http://mn.provider.com:8080
    X-M2M-Origin: /in-cse/Csmartphone_ae
    X-M2M-RI: mncse-33344
    Content-Type: application/vnd.onem2m-res+xml
        
    <m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols">
      <cnf>text/plain:0</cnf>
      <con>ON</con>
    </m2m:cin>
HTTP Response with XML payload
    HTTP/1.1 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>2000</rsc>
        <rqi>mncse-33344</rqi>
        <pc>
          <m2m:cin rn="cin_20161011T161823_0">
            <ty>4</ty>
            <ri>cin_20161011T161823_0</ri>
            <pi>cnt_20161011T150836_0</pi>
            <ct>20161011T161823</ct>
            <lt>20161011T161823</lt>
            <et>20161012T161823</et>
            <st>0</st>
            <cs>3</cs>
          </m2m:cin>
        </pc>        
        <to>/mn-cse/cnt-582759912</to>
        <fr>/in-cse/Csmartphone_ae</fr>
      </m2m:rsp>
      <m2m:rsp>
        <rsc>2000</rsc>
        <rqi>mncse-33344</rqi>
        <pc>
          <m2m:cin rn="cin_20161011T161953_0">
            <ty>4</ty>
            <ri>cin_20161011T161953_0</ri>
            <pi>cnt_20161011T151021_0</pi>
            <ct>20161011T161953</ct>
            <lt>20161011T161953</lt>
            <et>20161012T161953</et>
            <st>0</st>
            <cs>3</cs>
          </m2m:cin>
        </pc>        
        <to>/mn-cse/cnt-582769893</to>
        <fr>/in-cse/Csmartphone_ae</fr>
        <fr>/mn-cse/cnt-582769893</fr>
      </m2m:rsp>
    </m2m:agr>
HTTP Request with JSON payload
    POST /~/mn-cse/home_gateway/gateway_ae/containers_grp/fopt HTTP/1.1
    Host: http://mn.provider.com:8080
    X-M2M-Origin: /in-cse/Csmartphone_ae
    X-M2M-RI: mncse-33344
    Content-Type: application/vnd.onem2m-res+json
        
    { "m2m:cin": {
        "cnf": "text/plain:0",
        "con": "ON"
      }
    }
HTTP Response with JSON payload
    HTTP/1.1 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": {
              "rn" : "cin_20161011T161823_0",
              "ty" : 4,
              "ri" : "cin_20161011T161823_0",
              "pi" : "cnt_20161011T150836_0",
              "ct" : "20161011T161823",
              "lt" : "20161011T161823",
              "et" : "20161012T161823",
              "st" : 0,
              "cs" : 3
            }
          "to": "/mn-cse/cnt-582759912",
          "fr": "/in-cse/Csmartphone_ae"
        },
        {
          "rsc": "2001",
          "rqi": "mncse-33344",
          "pc": {
            "m2m:cin": {
              "rn" : "cin_20161011T161953_0",
              "ty" : 4,
              "ri" : "cin_20161011T161953_0",
              "pi" : "cnt_20161011T151021_0",
              "ct" : "20161011T161953",
              "lt" : "20161011T161953",
              "et" : "20161012T161953",
              "st" : 0,
              "cs" : 3
            }
          "to": "/mn-cse/cnt-582769893",
          "fr": "/in-cse/Csmartphone_ae"
        } ]
      }
    }
Subscribe to oneM2M News Please enter your name and email address, then click on submit.
Alternatively, you can send an email from your preferred email application with a blank subject to
[email protected] with subscribe oneM2M_News in the message body.

Subscribe to oneM2M News

Your Name(*)
Please let us know your name.

Your Email(*)
Please let us know your email address.