Admin message
Gitlab Update from 18.6.1 to 18.6.2 runs on 2025-12-17
Changes
Page history
formatting of eclipse import tutorial
authored
May 30, 2017
by
Björn Butzin
Hide whitespace changes
Inline
Side-by-side
home.markdown
View page @
38b9eb01
...
...
@@ -82,8 +82,8 @@ You can find the required files in our repository at [https://gitlab.amd.e-techn
5.
Run the ResourceServer
#### 1. Create a new resource class TemperatureResource (TemperatureResource.java):
*
We could have used the predefined BasicCoapResource
*
BasicCoapResource is a resource that just keeps a static
`byte[]`
which is:
*
We could have used the predefined
`
BasicCoapResource
`
*
`
BasicCoapResource
`
is a resource that just keeps a static
`byte[]`
which is:
*
returned on GET requests
*
replaced by the payload on PUT requests
*
appended with the payload on POST requests
...
...
@@ -91,11 +91,11 @@ You can find the required files in our repository at [https://gitlab.amd.e-techn
*
We do not want a static
`byte[]`
*
Instead we want a random number to be returned on a GET
*
PUT, POST and DELETE are not used
*
->So we implemented TemperatureResource which extends BasicCoapResource with:
*
->So we implemented
`
TemperatureResource
`
which extends
`
BasicCoapResource
`
with:
*
A constructor to initialize the resource and disallow POST, PUT and DELETE requests
*
Two get() Methods:
*
Get a list of accepted media types [& query parameters] which returns a
`byte[]`
together with its media type
```
j
ava
```
J
ava
CoapData get(List<CoapMediaType> mediaTypesAccepted)
CoapData get(List<String> query, List<CoapMediaType> mediaTypesAccepted)
```
...
...
...
...