This commit is contained in:
JOLIMAITRE Matthieu 2024-03-10 21:35:34 +01:00
parent 22eb5c7ad3
commit a9e60a9ba0
12 changed files with 129 additions and 0 deletions

10
iot/tp1/src/part_2/step_a.sh Executable file
View 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
View 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
View 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
View 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
View 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
View 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
View 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