smeshlink/ArduinoLib-SMeshlink — pull request #2 by longshine (2013-01-11 09:26:02+00:00)
Title: CoAP lib of contiki erbium engine for arduino

Using the instance named CoAPServer to manage CoAP resources.
Define a custom resource like:
class HelloResource : public CoAPResource
{
protected:
virtual void doGet(CoAPRequest& request, CoAPResponse& response)
{
const char *url;
coapRequest.getPath(&url);
response.setContentType(REST.type.TEXT_PLAIN);
response.printf("hello world from %s", url);
}
} resHello;

CoAPServer.init();
CoAPServer.addResource(&resHello);