... | ... | @@ -17,7 +17,7 @@ The following points will be covered by this tutorial: |
|
|
* Prepared JAVA project files for Hands-on
|
|
|
|
|
|
## 2. Installation of Copper Plugin for Mozilla Firefox
|
|
|

|
|
|

|
|
|
|
|
|
- https://addons.mozilla.org/de/firefox/addon/copper-270430/
|
|
|
- Click on „add to Firefox“ & Confirm Installation
|
... | ... | @@ -26,7 +26,7 @@ The following points will be covered by this tutorial: |
|
|
After the installation you can enter coap://host:port/resourcePath/?query=filter.
|
|
|
Copper will allow you to make any CoAP interaction interactively.
|
|
|
|
|
|

|
|
|

|
|
|
|
|
|
## 3. Introduction of jCoAP
|
|
|
- WS4D-jCoAP: Java implementation of CoAP
|
... | ... | @@ -34,13 +34,13 @@ Copper will allow you to make any CoAP interaction interactively. |
|
|
- https://gitlab.amd.e-technik.uni-rostock.de/ws4d/jcoap
|
|
|
|
|
|
### Task 1 – Sequence Diagram
|
|
|

|
|
|

|
|
|
|
|
|
Server Side
|
|
|

|
|
|

|
|
|
|
|
|
Client Side
|
|
|

|
|
|

|
|
|
|
|
|
**Server:** individual implementation of a server application, creates CoapResourceServer and resources
|
|
|
**TemperatureResource:** individual resource, inherits from BasicCoapResource
|
... | ... | @@ -54,7 +54,7 @@ Client Side |
|
|
**CoapClient (interface):** describes interfaces that must be supported by a client
|
|
|
|
|
|
* ToDo on server side:
|
|
|

|
|
|

|
|
|
1. Create a new resource class TemperatureResource
|
|
|
2. Instantiate a new ResourceServer
|
|
|
3. Instantiate a new TemperatureResource
|
... | ... | @@ -63,7 +63,7 @@ Client Side |
|
|
|
|
|
|
|
|
* ToDo on client side:
|
|
|

|
|
|

|
|
|
1. Establish a connection to the Server using the ChannelManager
|
|
|
2. Create a CoapRequest & add some Options
|
|
|
3. Send the CoapRequest
|
... | ... | @@ -75,16 +75,16 @@ Client Side |
|
|
You can find the required files in our repository at https://gitlab.amd.e-technik.uni-rostock.de/ws4d/jcoap/tree/master/ws4d-jcoap-handsOn
|
|
|
|
|
|
1. File > Import
|
|
|

|
|
|

|
|
|
2. General > Existing Projects ...
|
|
|
3. Click ‚Next‘
|
|
|

|
|
|

|
|
|
4. Browse <Select Project Folder>
|
|
|
5. Click ‚Finish’
|
|
|

|
|
|

|
|
|
|
|
|
* the resulting GUI should look like this:
|
|
|

|
|
|

|
|
|
|
|
|
* We have prepared some FIXME and TODO annotations:
|
|
|
* Just open the „Task“ view
|
... | ... | @@ -98,7 +98,7 @@ You can find the required files in our repository at https://gitlab.amd.e-techni |
|
|
## 5. Task 1: Implementation of client/server and enable simple message exchange
|
|
|
|
|
|
### Server
|
|
|

|
|
|

|
|
|
1. Create a new resource class TemperatureResource (already done in our example Server)
|
|
|
2. Instantiate a new ResourceServer
|
|
|
3. Instantiate a new TemperatureResource
|
... | ... | @@ -147,7 +147,7 @@ You can find the required files in our repository at https://gitlab.amd.e-techni |
|
|
* Tip: make a copy of „TemperatureResource.java“
|
|
|
|
|
|
### Client
|
|
|

|
|
|

|
|
|
1. Establish a connection to the Server using the ChannelManager
|
|
|
2. Create a CoapRequest & add some Options
|
|
|
3. Send the CoapRequest
|
... | ... | @@ -185,7 +185,7 @@ You can find the required files in our repository at https://gitlab.amd.e-techni |
|
|
* If you have written your own resources before: GET them
|
|
|
|
|
|
## 6. Task 2: Implementation of a AC control by using the CoAP-observe mechanism
|
|
|

|
|
|

|
|
|
1. Use the eventing mechanism CoAP-Observe
|
|
|
2. Let the server notify clients every 5 seconds about a changed TemperatureResource
|
|
|
3. Implement an Air Conditioner Resource with the path “/ACControl”, that can be set to “high”,
|
... | ... | |