coapMessage = new CoapResponse(messageType, messageCode);
coapMessage.setMessageType(messageType);
}
coapMessage.setMessageID(messageID);
coapMessage.setToken(new Token(token));
//Decode and set the options
if(buffer.readableBytes() > 0){
try {
setOptions(coapMessage, buffer);
}
catch (OptionCodecException e) {
e.setMessageID(messageID);
e.setToken(new Token(token));
e.setRemoteEndpoint(remoteEndpoint);
e.setMessageType(messageType);
throw e;
}