net: lwm2m: remove net_context parameter from lwm2m_udp_receive()
This is part of lwm2m_ctx and is not needed. Signed-off-by: Michael Scott <michael.scott@linaro.org>
This commit is contained in:
parent
148b264255
commit
aa3e52c261
3 changed files with 6 additions and 7 deletions
|
@ -2236,8 +2236,7 @@ int lwm2m_udp_sendto(struct net_pkt *pkt, const struct sockaddr *dst_addr)
|
||||||
NULL, K_NO_WAIT, NULL, NULL);
|
NULL, K_NO_WAIT, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lwm2m_udp_receive(struct lwm2m_ctx *client_ctx,
|
void lwm2m_udp_receive(struct lwm2m_ctx *client_ctx, struct net_pkt *pkt,
|
||||||
struct net_context *net_ctx, struct net_pkt *pkt,
|
|
||||||
bool handle_separate_response,
|
bool handle_separate_response,
|
||||||
int (*udp_request_handler)(struct zoap_packet *,
|
int (*udp_request_handler)(struct zoap_packet *,
|
||||||
struct zoap_packet *,
|
struct zoap_packet *,
|
||||||
|
@ -2313,7 +2312,8 @@ void lwm2m_udp_receive(struct lwm2m_ctx *client_ctx,
|
||||||
if (udp_request_handler &&
|
if (udp_request_handler &&
|
||||||
zoap_header_get_type(&response) == ZOAP_TYPE_CON) {
|
zoap_header_get_type(&response) == ZOAP_TYPE_CON) {
|
||||||
/* Create a response packet if we reach this point */
|
/* Create a response packet if we reach this point */
|
||||||
r = lwm2m_init_message(net_ctx, &response2, &pkt2,
|
r = lwm2m_init_message(client_ctx->net_ctx,
|
||||||
|
&response2, &pkt2,
|
||||||
ZOAP_TYPE_ACK,
|
ZOAP_TYPE_ACK,
|
||||||
zoap_header_get_code(&response),
|
zoap_header_get_code(&response),
|
||||||
zoap_header_get_id(&response),
|
zoap_header_get_id(&response),
|
||||||
|
@ -2375,7 +2375,7 @@ static void udp_receive(struct net_context *net_ctx, struct net_pkt *pkt,
|
||||||
struct lwm2m_ctx,
|
struct lwm2m_ctx,
|
||||||
net_ctx);
|
net_ctx);
|
||||||
|
|
||||||
lwm2m_udp_receive(client_ctx, net_ctx, pkt, false, handle_request);
|
lwm2m_udp_receive(client_ctx, pkt, false, handle_request);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void retransmit_request(struct k_work *work)
|
static void retransmit_request(struct k_work *work)
|
||||||
|
|
|
@ -66,8 +66,7 @@ int lwm2m_write_handler(struct lwm2m_engine_obj_inst *obj_inst,
|
||||||
struct lwm2m_engine_context *context);
|
struct lwm2m_engine_context *context);
|
||||||
|
|
||||||
int lwm2m_udp_sendto(struct net_pkt *pkt, const struct sockaddr *dst_addr);
|
int lwm2m_udp_sendto(struct net_pkt *pkt, const struct sockaddr *dst_addr);
|
||||||
void lwm2m_udp_receive(struct lwm2m_ctx *client_ctx,
|
void lwm2m_udp_receive(struct lwm2m_ctx *client_ctx, struct net_pkt *pkt,
|
||||||
struct net_context *ctx, struct net_pkt *pkt,
|
|
||||||
bool handle_separate_response,
|
bool handle_separate_response,
|
||||||
int (*udp_request_handler)(struct zoap_packet *request,
|
int (*udp_request_handler)(struct zoap_packet *request,
|
||||||
struct zoap_packet *response,
|
struct zoap_packet *response,
|
||||||
|
|
|
@ -40,7 +40,7 @@ static void
|
||||||
firmware_udp_receive(struct net_context *ctx, struct net_pkt *pkt, int status,
|
firmware_udp_receive(struct net_context *ctx, struct net_pkt *pkt, int status,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
lwm2m_udp_receive(&firmware_ctx, ctx, pkt, true, NULL);
|
lwm2m_udp_receive(&firmware_ctx, pkt, true, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void retransmit_request(struct k_work *work)
|
static void retransmit_request(struct k_work *work)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue