bjoern.butzin created page: home authored by Björn Butzin's avatar Björn Butzin
......@@ -63,6 +63,7 @@ Client Side
4. Add the TemperatureResource to the ResourceServer
5. Run the ResourceServer
* ToDo on client side:
1. Establish a connection to the Server using the ChannelManager
2. Create a CoapRequest & add some Options
......@@ -70,7 +71,6 @@ Client Side
4. Wait for CoapResponse
5. Print the CoapResponse on the console
## 3. Import of prepared project into Eclipse
1. File > Import
2. General > Existing Projects ...
......@@ -202,14 +202,14 @@ request.setObserveOption(0);
* add a BasicCoapResource to the ResourceServer (Server.java, TODO 14)
resourceServer.createResource( newBasicCoapResource(“/ACControl”,”off”,CoapMediaType.text_plain));
* send PUT request (Client.java, TODO 15)
`CoapRequest request = clientChannel.
createRequest(true, CoapRequestCode.PUT);
`CoapRequest request = clientChannel.createRequest(true, CoapRequestCode.PUT);
request.setUriPath(“/ACControl”);
request.setContentType(CoapMediaType.text_plain);
/*Depending on the received payload high, medium, low, off*/
request.setPayload(“medium”.getBytes());
clientChannel.sendMessage(request);`
* 28 <= Temperature -> high
* 25 <= Temperature < 28 -> medium
* 21 <= Temperature < 25 -> low
* Temperature < 21 -> off
\ No newline at end of file
28 <= Temperature -> high
25 <= Temperature < 28 -> medium
21 <= Temperature < 25 -> low
Temperature < 21 -> off
\ No newline at end of file