/** * Create a CoAP observe request context with specific keys needed for internal Leshan working. */ public static Map<String, String> createCoapObserveRequestContext(String endpoint, String registrationId, ObserveRequest request) { Map<String, String> context = new HashMap<>(); context.put(CTX_ENDPOINT, endpoint); context.put(CTX_REGID, registrationId); context.put(CTX_LWM2M_PATH, request.getPath().toString()); for (Entry<String, String> ctx : request.getContext().entrySet()) { context.put(ctx.getKey(), ctx.getValue()); } return context; }