net: lwm2m: introduce lwm2m context structure
The LwM2M library does not use net_app APIs internally. To help this effort let's establish a user facing structure "lwm2m_ctx" (similar to http_client_ctx and mqtt_ctx) and start it off by wrappering the net_context structure. Future patches will add user setup options to this structure and eventually remove the net_context structure in favor of a net_app_ctx. Signed-off-by: Michael Scott <michael.scott@linaro.org>
This commit is contained in:
parent
416711a989
commit
728ab4229a
5 changed files with 47 additions and 35 deletions
|
@ -2592,12 +2592,12 @@ static void lwm2m_engine_service(void)
|
|||
}
|
||||
}
|
||||
|
||||
int lwm2m_engine_start(struct net_context *net_ctx)
|
||||
int lwm2m_engine_start(struct lwm2m_ctx *client_ctx)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
/* set callback */
|
||||
ret = net_context_recv(net_ctx, udp_receive, 0, NULL);
|
||||
ret = net_context_recv(client_ctx->net_ctx, udp_receive, 0, NULL);
|
||||
if (ret) {
|
||||
SYS_LOG_ERR("Could not set receive for net context (err:%d)",
|
||||
ret);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue