/Zephyr-latest/subsys/net/lib/lwm2m/ |
D | lwm2m_engine.c | 135 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 …]
|
D | lwm2m_engine.h | 114 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 …]
|
D | lwm2m_rd_client.h | 49 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);
|
D | lwm2m_message_handling.h | 45 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);
|
D | lwm2m_message_handling.c | 446 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 …]
|
D | lwm2m_rd_client.c | 1538 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 …]
|
D | lwm2m_observation.c | 1029 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/ |
D | main.c | 46 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/ |
D | main.c | 22 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/ |
D | mqtt.rst | 44 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/ |
D | main.c | 45 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/ |
D | main.c | 29 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, ¶m); 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/ |
D | lwm2m.h | 185 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/ |
D | lwm2m-client.c | 52 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/ |
D | main.c | 28 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/ |
D | stubs.c | 89 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()
|
D | stubs.h | 57 int lwm2m_socket_start_fake_fail(struct lwm2m_ctx *client_ctx); 67 void lwm2m_engine_context_init_fake1(struct lwm2m_ctx *client_ctx);
|