bjoern.butzin created page: home authored by Björn Butzin's avatar Björn Butzin
...@@ -186,15 +186,16 @@ Client ...@@ -186,15 +186,16 @@ Client
Temperature < 21 -> off Temperature < 21 -> off
1. Use the eventing mechanism CoAP-Observe (Server.java, TODO 10): 1. Use the eventing mechanism CoAP-Observe (Server.java, TODO 10):
Mark the TemperatureResource as observable * Mark the TemperatureResource as observable
`resource.setObservable(true);` `resource.setObservable(true);`
2. Let server notify clients every 5 s about changed TemperatureResource (Server.java, TODO 11): 2. Let server notify clients every 5 s about changed TemperatureResource (Server.java, TODO 11):
* indicate a change for resource every 5 seconds * indicate a change for resource every 5 seconds
`while (true) {` `while (true) {`
try {Thread.sleep(5000);}` ` try {Thread.sleep(5000);}`
catch (InterruptedException e) {/*do nothing*/}` ` catch (InterruptedException e) {/*do nothing*/}`
resource.changed();` ` resource.changed();`
}` `}`
* Use the „Tasks“ view of Eclipse to find the right places * Use the „Tasks“ view of Eclipse to find the right places
* Solve only TODO 10-15 as described by the following instructions - ignore other TODOs or FIXMEs * Solve only TODO 10-15 as described by the following instructions - ignore other TODOs or FIXMEs
... ...
......