iot tp1
This commit is contained in:
parent
22eb5c7ad3
commit
a9e60a9ba0
12 changed files with 129 additions and 0 deletions
10
iot/tp1/src/part_2/step_a.sh
Executable file
10
iot/tp1/src/part_2/step_a.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
curl -X POST \
|
||||
-H 'X-M2M-Origin:Cmysensor' \
|
||||
-H 'X-M2M-RI:123' \
|
||||
-H 'X-M2M-RVI:3' \
|
||||
-H'Content-Type:application/json;ty=2' \
|
||||
-H 'Accept:application/json' \
|
||||
-d '{"m2m:ae": {"rn":"MySensor", "api": "NMysensor", "rr": true, "srv": ["3"]}}' \
|
||||
http://127.0.0.1:8080/cse-in
|
10
iot/tp1/src/part_2/step_b.sh
Executable file
10
iot/tp1/src/part_2/step_b.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
curl -X POST \
|
||||
-H 'X-M2M-Origin:Cmysensor' \
|
||||
-H 'X-M2M-RI:123' \
|
||||
-H 'X-M2M-RVI:3' \
|
||||
-H 'Content-Type:application/json;ty=3' \
|
||||
-H 'Accept:application/json' \
|
||||
-d '{"m2m:cnt": {"rn":"Container"}}' \
|
||||
http://127.0.0.1:8080/cse-in/MySensor
|
10
iot/tp1/src/part_2/step_c.sh
Executable file
10
iot/tp1/src/part_2/step_c.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
curl -X POST \
|
||||
-H 'X-M2M-Origin:Cmysensor' \
|
||||
-H 'X-M2M-RI:123' \
|
||||
-H 'X-M2M-RVI:3' \
|
||||
-H 'Content-Type:application/json;ty=4' \
|
||||
-H 'Accept:application/json' \
|
||||
-d '{"m2m:cin": {"cnf": "text/plain:0","con": "{\"unit\": \"celsius\", \"value\": \"22\"}"}}' \
|
||||
http://localhost:8080/cse-in/MySensor/Container
|
9
iot/tp1/src/part_2/step_d.sh
Executable file
9
iot/tp1/src/part_2/step_d.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
curl -X GET \
|
||||
-H 'X-M2M-Origin:Cmysensor' \
|
||||
-H 'X-M2M-RI:123' \
|
||||
-H 'X-M2M-RVI:3' \
|
||||
-H 'Content-Type:application/json' \
|
||||
-H 'Accept:application/json' \
|
||||
http://localhost:8080/cse-in/MySensor/Container/la
|
3
iot/tp1/src/part_2/step_e.sh
Executable file
3
iot/tp1/src/part_2/step_e.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
curl -X PUT -H 'X-M2M-Origin:Cmysensor' -H 'X-M2M-RI:123' -H 'X-M2M-RVI:3' -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"m2m:cnt": {"mni": 10}}' http://localhost:8080/cse-in/MySensor/Container
|
4
iot/tp1/src/part_2/step_f.sh
Executable file
4
iot/tp1/src/part_2/step_f.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
curl -X DELETE -H 'X-M2M-Origin:Cmysensor' -H 'X-M2M-RI:123' -H 'X-M2M-RVI:3' -H 'Content-Type:application/json' -H 'Accept:application/json' http://localhost:8080/cse-in/MySensor/Container
|
28
iot/tp1/src/part_3/step_a.sh
Executable file
28
iot/tp1/src/part_3/step_a.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
alias log="echo '
|
||||
[step_a.sh]'"
|
||||
|
||||
|
||||
RN_NAME="CINwithLabel"
|
||||
|
||||
|
||||
log creates container
|
||||
curl -X POST \
|
||||
-H 'X-M2M-Origin:Cmysensor' \
|
||||
-H 'X-M2M-RI:123' \
|
||||
-H 'X-M2M-RVI:3' \
|
||||
-H'Content-Type:application/json;ty=2' \
|
||||
-H 'Accept:application/json' \
|
||||
-d '{"m2m:ae": {"rn":"'$RN_NAME'", "api": "NMysensor", "rr": true, "srv": ["3"]}}' \
|
||||
http://127.0.0.1:8080/cse-in
|
||||
|
||||
log emit notification
|
||||
curl -X POST \
|
||||
-H 'X-M2M-Origin:Cmysensor' \
|
||||
-H 'X-M2M-RI:123' \
|
||||
-H 'X-M2M-RVI:3' \
|
||||
-H 'Content-Type:application/json;ty=4' \
|
||||
-H 'Accept:application/json' \
|
||||
-d '{"m2m:cin": {"rn":"CINwithLabel", "lbl": ["tag:temperature"], "cnf": "text/plain:0", "con": "{\"unit\": \"celsius\",\"value\": \"22\"}"}}' \
|
||||
http://127.0.0.1:8080/cse-in/MySensor/Container
|
Loading…
Add table
Add a link
Reference in a new issue