net: coap: Use correct network buffer in registration

Need to use the network buffer when sending CoAP serial message
because the message was constructed to net_buf.

Change-Id: I9422ff3f5f93945f1f9f91f2ed8572e3715338ce
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This commit is contained in:
Ravi kumar Veeramally 2016-03-14 13:27:14 +02:00 committed by Gerrit Code Review
commit 6d740fd4ca

View file

@ -334,7 +334,7 @@ coap_obs_request_registration(coap_context_t *coap_ctx,
if(obs) { if(obs) {
t->callback = handle_obs_registration_response; t->callback = handle_obs_registration_response;
t->callback_data = obs; t->callback_data = obs;
t->packet_len = coap_serialize_message(request, t->packet); t->packet_len = coap_serialize_message(request, uip_appdata(coap_ctx->buf));
uip_len(coap_ctx->buf) = t->packet_len; uip_len(coap_ctx->buf) = t->packet_len;
net_buf_add(coap_ctx->buf, uip_len(coap_ctx->buf)); net_buf_add(coap_ctx->buf, uip_len(coap_ctx->buf));
coap_send_transaction(t); coap_send_transaction(t);