Home
last modified time | relevance | path

Searched refs:client_ctx (Results 1 – 17 of 17) sorted by relevance

/Zephyr-latest/subsys/net/lib/lwm2m/
Dlwm2m_engine.c135 int lwm2m_open_socket(struct lwm2m_ctx *client_ctx) in lwm2m_open_socket() argument
137 if (client_ctx->sock_fd < 0) { in lwm2m_open_socket()
140 if (IS_ENABLED(CONFIG_LWM2M_DTLS_SUPPORT) && client_ctx->use_dtls) { in lwm2m_open_socket()
141 client_ctx->sock_fd = zsock_socket(client_ctx->remote_addr.sa_family, in lwm2m_open_socket()
144 client_ctx->sock_fd = in lwm2m_open_socket()
145 zsock_socket(client_ctx->remote_addr.sa_family, SOCK_DGRAM, in lwm2m_open_socket()
149 if (client_ctx->sock_fd < 0) { in lwm2m_open_socket()
154 if (lwm2m_socket_update(client_ctx)) { in lwm2m_open_socket()
155 return lwm2m_socket_add(client_ctx); in lwm2m_open_socket()
162 int lwm2m_close_socket(struct lwm2m_ctx *client_ctx) in lwm2m_close_socket() argument
[all …]
Dlwm2m_engine.h114 void lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx);
121 void lwm2m_engine_context_init(struct lwm2m_ctx *client_ctx);
136 bool lwm2m_engine_bootstrap_override(struct lwm2m_ctx *client_ctx, struct lwm2m_obj_path *path);
290 int lwm2m_open_socket(struct lwm2m_ctx *client_ctx);
299 int lwm2m_close_socket(struct lwm2m_ctx *client_ctx);
308 int lwm2m_socket_suspend(struct lwm2m_ctx *client_ctx);
332 int lwm2m_socket_start(struct lwm2m_ctx *client_ctx);
340 int lwm2m_socket_close(struct lwm2m_ctx *client_ctx);
348 int lwm2m_engine_close_socket_connection(struct lwm2m_ctx *client_ctx);
356 int lwm2m_engine_connection_resume(struct lwm2m_ctx *client_ctx);
[all …]
Dlwm2m_rd_client.h49 int lwm2m_rd_client_timeout(struct lwm2m_ctx *client_ctx);
50 bool lwm2m_rd_client_is_registred(struct lwm2m_ctx *client_ctx);
51 bool lwm2m_rd_client_is_suspended(struct lwm2m_ctx *client_ctx);
55 int lwm2m_rd_client_connection_resume(struct lwm2m_ctx *client_ctx);
Dlwm2m_message_handling.h45 struct lwm2m_message *lwm2m_get_message(struct lwm2m_ctx *client_ctx);
52 void lwm2m_udp_receive(struct lwm2m_ctx *client_ctx, uint8_t *buf, uint16_t buf_len,
58 int lwm2m_send_empty_ack(struct lwm2m_ctx *client_ctx, uint16_t mid);
78 int lwm2m_parse_peerinfo(char *url, struct lwm2m_ctx *client_ctx, bool is_firmware_uri);
Dlwm2m_message_handling.c446 void lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx) in lwm2m_engine_context_close() argument
453 lwm2m_client_lock(client_ctx); in lwm2m_engine_context_close()
456 while (!sys_slist_is_empty(&client_ctx->observer)) { in lwm2m_engine_context_close()
457 obs_node = sys_slist_get_not_empty(&client_ctx->observer); in lwm2m_engine_context_close()
459 remove_observer_from_list(client_ctx, NULL, obs); in lwm2m_engine_context_close()
463 if (msg->ctx == client_ctx) { in lwm2m_engine_context_close()
468 coap_pendings_clear(client_ctx->pendings, ARRAY_SIZE(client_ctx->pendings)); in lwm2m_engine_context_close()
469 coap_replies_clear(client_ctx->replies, ARRAY_SIZE(client_ctx->replies)); in lwm2m_engine_context_close()
471 client_ctx->connection_suspended = false; in lwm2m_engine_context_close()
473 client_ctx->buffer_client_messages = true; in lwm2m_engine_context_close()
[all …]
Dlwm2m_rd_client.c1538 int lwm2m_rd_client_start(struct lwm2m_ctx *client_ctx, const char *ep_name, in lwm2m_rd_client_start() argument
1563 lwm2m_engine_context_init(client_ctx); in lwm2m_rd_client_start()
1565 client.ctx = client_ctx; in lwm2m_rd_client_start()
1586 int lwm2m_rd_client_stop(struct lwm2m_ctx *client_ctx, in lwm2m_rd_client_stop() argument
1591 if (client.ctx != client_ctx) { in lwm2m_rd_client_stop()
1737 int lwm2m_rd_client_connection_resume(struct lwm2m_ctx *client_ctx) in lwm2m_rd_client_connection_resume() argument
1739 if (client.ctx != client_ctx) { in lwm2m_rd_client_connection_resume()
1770 int lwm2m_rd_client_timeout(struct lwm2m_ctx *client_ctx) in lwm2m_rd_client_timeout() argument
1772 if (client.ctx != client_ctx) { in lwm2m_rd_client_timeout()
1787 bool lwm2m_rd_client_is_registred(struct lwm2m_ctx *client_ctx) in lwm2m_rd_client_is_registred() argument
[all …]
Dlwm2m_observation.c1029 int lwm2m_update_observer_min_period(struct lwm2m_ctx *client_ctx, in lwm2m_update_observer_min_period() argument
1054 ret = engine_observe_get_attributes(path, &attrs, client_ctx->srv_obj_inst); in lwm2m_update_observer_min_period()
1067 int lwm2m_update_observer_max_period(struct lwm2m_ctx *client_ctx, in lwm2m_update_observer_max_period() argument
1092 ret = engine_observe_get_attributes(path, &attrs, client_ctx->srv_obj_inst); in lwm2m_update_observer_max_period()
1109 return lwm2m_engine_observer_timestamp_update(&client_ctx->observer, path, in lwm2m_update_observer_max_period()
1110 client_ctx->srv_obj_inst); in lwm2m_update_observer_max_period()
/Zephyr-latest/samples/net/cloud/aws_iot_mqtt/src/
Dmain.c46 static struct mqtt_client client_ctx; variable
112 ret = mqtt_subscribe(&client_ctx, &sub_list); in subscribe_topic()
137 ret = mqtt_publish(&client_ctx, &msg); in publish_message()
163 ret = mqtt_read_publish_payload_blocking(&client_ctx, p, APP_BUFFER_SIZE); in handle_published_message()
181 mqtt_publish_qos1_ack(&client_ctx, &puback); in handle_published_message()
242 mqtt_client_init(&client_ctx); in aws_client_setup()
244 client_ctx.broker = &aws_broker; in aws_client_setup()
245 client_ctx.evt_cb = mqtt_event_cb; in aws_client_setup()
247 client_ctx.client_id.utf8 = (uint8_t *)mqtt_client_name; in aws_client_setup()
248 client_ctx.client_id.size = sizeof(mqtt_client_name) - 1; in aws_client_setup()
[all …]
/Zephyr-latest/samples/net/secure_mqtt_sensor_actuator/src/
Dmain.c22 static struct mqtt_client client_ctx; variable
70 rc = app_mqtt_publish(&client_ctx); in publish_work_handler()
117 rc = app_mqtt_init(&client_ctx); in main()
129 app_mqtt_connect(&client_ctx); in main()
136 app_mqtt_run(&client_ctx); in main()
/Zephyr-latest/doc/connectivity/networking/api/
Dmqtt.rst44 static struct mqtt_client client_ctx;
76 mqtt_client_init(&client_ctx);
79 client_ctx.broker = &broker;
80 client_ctx.evt_cb = mqtt_evt_handler;
81 client_ctx.client_id.utf8 = (uint8_t *)"zephyr_mqtt_client";
82 client_ctx.client_id.size = sizeof("zephyr_mqtt_client") - 1;
83 client_ctx.password = NULL;
84 client_ctx.user_name = NULL;
85 client_ctx.protocol_version = MQTT_VERSION_3_1_1;
86 client_ctx.transport.type = MQTT_TRANSPORT_NON_SECURE;
[all …]
/Zephyr-latest/samples/net/mqtt_publisher/src/
Dmain.c45 static APP_BMEM struct mqtt_client client_ctx; variable
439 rc = try_to_connect(&client_ctx); in publisher()
447 rc = mqtt_ping(&client_ctx); in publisher()
451 rc = process_mqtt_and_sleep(&client_ctx, APP_SLEEP_MSECS); in publisher()
454 rc = publish(&client_ctx, MQTT_QOS_0_AT_MOST_ONCE); in publisher()
458 rc = process_mqtt_and_sleep(&client_ctx, APP_SLEEP_MSECS); in publisher()
461 rc = publish(&client_ctx, MQTT_QOS_1_AT_LEAST_ONCE); in publisher()
465 rc = process_mqtt_and_sleep(&client_ctx, APP_SLEEP_MSECS); in publisher()
468 rc = publish(&client_ctx, MQTT_QOS_2_EXACTLY_ONCE); in publisher()
472 rc = process_mqtt_and_sleep(&client_ctx, APP_SLEEP_MSECS); in publisher()
[all …]
/Zephyr-latest/tests/net/lib/mqtt/v3_1_1/mqtt_client/src/
Dmain.c29 static struct mqtt_client client_ctx; variable
581 ret = mqtt_connect(&client_ctx); in test_connect()
584 prepare_client_fds(&client_ctx); in test_connect()
587 ret = mqtt_input(&client_ctx); in test_connect()
595 ret = mqtt_ping(&client_ctx); in test_pingreq()
600 ret = mqtt_input(&client_ctx); in test_pingreq()
624 ret = mqtt_publish(&client_ctx, &param); in test_publish()
629 ret = mqtt_input(&client_ctx); in test_publish()
636 ret = mqtt_input(&client_ctx); in test_publish()
658 ret = mqtt_subscribe(&client_ctx, &sub); in test_subscribe()
[all …]
/Zephyr-latest/include/zephyr/net/
Dlwm2m.h185 typedef int (*lwm2m_set_sockopt_cb_t)(struct lwm2m_ctx *client_ctx);
255 int (*load_credentials)(struct lwm2m_ctx *client_ctx);
807 int lwm2m_update_observer_min_period(struct lwm2m_ctx *client_ctx,
824 int lwm2m_update_observer_max_period(struct lwm2m_ctx *client_ctx,
1414 int lwm2m_engine_stop(struct lwm2m_ctx *client_ctx);
1427 int lwm2m_engine_start(struct lwm2m_ctx *client_ctx);
1440 void lwm2m_acknowledge(struct lwm2m_ctx *client_ctx);
1472 int lwm2m_rd_client_start(struct lwm2m_ctx *client_ctx, const char *ep_name,
1491 int lwm2m_rd_client_stop(struct lwm2m_ctx *client_ctx,
/Zephyr-latest/samples/net/lwm2m_client/src/
Dlwm2m-client.c52 static struct lwm2m_ctx client_ctx; variable
398 (void)memset(&client_ctx, 0x0, sizeof(client_ctx)); in main()
400 client_ctx.tls_tag = CONFIG_LWM2M_APP_TLS_TAG; in main()
402 client_ctx.set_socket_state = socket_state; in main()
405 lwm2m_rd_client_start(&client_ctx, endpoint, flags, rd_client_event, observe_cb); in main()
/Zephyr-latest/samples/net/cloud/mqtt_azure/src/
Dmain.c28 static struct mqtt_client client_ctx; variable
249 bytes_read = mqtt_read_publish_payload(&client_ctx, in mqtt_event_handler()
264 mqtt_publish_qos1_ack(&client_ctx, &puback); in mqtt_event_handler()
316 mqtt_input(&client_ctx); in poll_mqtt()
339 rc = publish(&client_ctx, MQTT_QOS_1_AT_LEAST_ONCE); in publish_timeout()
435 rc = try_to_connect(&client_ctx); in connect_to_cloud_and_publish()
484 mqtt_abort(&client_ctx); in abort_mqtt_connection()
/Zephyr-latest/tests/net/lib/lwm2m/lwm2m_rd_client/src/
Dstubs.c89 int lwm2m_socket_start_fake_fail(struct lwm2m_ctx *client_ctx) in lwm2m_socket_start_fake_fail() argument
101 void lwm2m_engine_context_init_fake1(struct lwm2m_ctx *client_ctx) in lwm2m_engine_context_init_fake1() argument
103 client_ctx_fake = client_ctx; in lwm2m_engine_context_init_fake1()
Dstubs.h57 int lwm2m_socket_start_fake_fail(struct lwm2m_ctx *client_ctx);
67 void lwm2m_engine_context_init_fake1(struct lwm2m_ctx *client_ctx);