use of org.eclipse.leshan.client.californium.impl.CoapRequestBuilder in project leshan by eclipse.
the class LockStepLwM2mClient method sendLwM2mRequest.
public void sendLwM2mRequest(UplinkRequest<? extends LwM2mResponse> lwm2mReq) {
// create CoAP request
CoapRequestBuilder coapRequestBuilder = new CoapRequestBuilder(destination);
lwm2mReq.accept(coapRequestBuilder);
Request coapReq = coapRequestBuilder.getRequest();
byte[] token = new byte[8];
r.nextBytes(token);
coapReq.setToken(token);
// serialize request
UdpDataSerializer serializer = new UdpDataSerializer();
RawData raw = serializer.serializeRequest(coapReq);
// send it
super.send(raw);
}
Aggregations