@Override
 public void handleGET(CoapExchange exchange) {
   if (content != null) {
     exchange.respond(content);
   } else {
     String subtree = LinkFormat.serializeTree(this);
     exchange.respond(ResponseCode.CONTENT, subtree, MediaTypeRegistry.APPLICATION_LINK_FORMAT);
   }
 }
示例#2
0
 @Override
 public void handleGET(CoapExchange exchange) {
   exchange.respond(CONTENT, LinkFormat.serializeTree(this), APPLICATION_LINK_FORMAT);
 }