Home
last modified time | relevance | path

Searched refs:client (Results 1 – 25 of 347) sorted by relevance

12345678910>>...14

/Zephyr-latest/subsys/net/lib/mqtt/
Dmqtt.c21 static void client_reset(struct mqtt_client *client) in client_reset() argument
23 MQTT_STATE_INIT(client); in client_reset()
25 client->internal.last_activity = 0U; in client_reset()
26 client->internal.rx_buf_datalen = 0U; in client_reset()
27 client->internal.remaining_payload = 0U; in client_reset()
31 static void tx_buf_init(struct mqtt_client *client, struct buf_ctx *buf) in tx_buf_init() argument
33 memset(client->tx_buf, 0, client->tx_buf_size); in tx_buf_init()
34 buf->cur = client->tx_buf; in tx_buf_init()
35 buf->end = client->tx_buf + client->tx_buf_size; in tx_buf_init()
38 void event_notify(struct mqtt_client *client, const struct mqtt_evt *evt) in event_notify() argument
[all …]
Dmqtt_transport.h22 typedef int (*transport_connect_handler_t)(struct mqtt_client *client);
25 typedef int (*transport_write_handler_t)(struct mqtt_client *client,
29 typedef int (*transport_write_msg_handler_t)(struct mqtt_client *client,
33 typedef int (*transport_read_handler_t)(struct mqtt_client *client, uint8_t *data,
37 typedef int (*transport_disconnect_handler_t)(struct mqtt_client *client);
73 int mqtt_transport_connect(struct mqtt_client *client);
83 int mqtt_transport_write(struct mqtt_client *client, const uint8_t *data,
94 int mqtt_transport_write_msg(struct mqtt_client *client,
107 int mqtt_transport_read(struct mqtt_client *client, uint8_t *data, uint32_t buflen,
116 int mqtt_transport_disconnect(struct mqtt_client *client);
[all …]
Dmqtt_transport_websocket.c24 int mqtt_client_websocket_connect(struct mqtt_client *client) in mqtt_client_websocket_connect() argument
33 if (client->transport.type == MQTT_TRANSPORT_NON_SECURE_WEBSOCKET) { in mqtt_client_websocket_connect()
34 ret = mqtt_client_tcp_connect(client); in mqtt_client_websocket_connect()
39 transport_sock = client->transport.tcp.sock; in mqtt_client_websocket_connect()
42 else if (client->transport.type == MQTT_TRANSPORT_SECURE_WEBSOCKET) { in mqtt_client_websocket_connect()
43 ret = mqtt_client_tls_connect(client); in mqtt_client_websocket_connect()
48 transport_sock = client->transport.tls.sock; in mqtt_client_websocket_connect()
55 if (client->transport.websocket.config.url == NULL) { in mqtt_client_websocket_connect()
56 client->transport.websocket.config.url = "/mqtt"; in mqtt_client_websocket_connect()
59 if (client->transport.websocket.config.host == NULL) { in mqtt_client_websocket_connect()
[all …]
Dmqtt_rx.c19 static int mqtt_handle_packet(struct mqtt_client *client, in mqtt_handle_packet() argument
33 NET_DBG("[CID %p]: Received MQTT_PKT_TYPE_CONNACK!", client); in mqtt_handle_packet()
36 err_code = connect_ack_decode(client, buf, &evt.param.connack); in mqtt_handle_packet()
38 NET_DBG("[CID %p]: return_code: %d", client, in mqtt_handle_packet()
44 MQTT_SET_STATE(client, MQTT_STATE_CONNECTED); in mqtt_handle_packet()
57 NET_DBG("[CID %p]: Received MQTT_PKT_TYPE_PUBLISH", client); in mqtt_handle_packet()
64 client->internal.remaining_payload = in mqtt_handle_packet()
75 NET_DBG("[CID %p]: Received MQTT_PKT_TYPE_PUBACK!", client); in mqtt_handle_packet()
83 NET_DBG("[CID %p]: Received MQTT_PKT_TYPE_PUBREC!", client); in mqtt_handle_packet()
91 NET_DBG("[CID %p]: Received MQTT_PKT_TYPE_PUBREL!", client); in mqtt_handle_packet()
[all …]
Dmqtt_transport.c61 int mqtt_transport_connect(struct mqtt_client *client) in mqtt_transport_connect() argument
63 return transport_fn[client->transport.type].connect(client); in mqtt_transport_connect()
66 int mqtt_transport_write(struct mqtt_client *client, const uint8_t *data, in mqtt_transport_write() argument
69 return transport_fn[client->transport.type].write(client, data, in mqtt_transport_write()
73 int mqtt_transport_write_msg(struct mqtt_client *client, in mqtt_transport_write_msg() argument
76 return transport_fn[client->transport.type].write_msg(client, message); in mqtt_transport_write_msg()
79 int mqtt_transport_read(struct mqtt_client *client, uint8_t *data, uint32_t buflen, in mqtt_transport_read() argument
82 return transport_fn[client->transport.type].read(client, data, buflen, in mqtt_transport_read()
86 int mqtt_transport_disconnect(struct mqtt_client *client) in mqtt_transport_disconnect() argument
88 return transport_fn[client->transport.type].disconnect(client); in mqtt_transport_disconnect()
Dmqtt_transport_socket_tls.c21 int mqtt_client_tls_connect(struct mqtt_client *client) in mqtt_client_tls_connect() argument
23 const struct sockaddr *broker = client->broker; in mqtt_client_tls_connect()
24 struct mqtt_sec_config *tls_config = &client->transport.tls.config; in mqtt_client_tls_connect()
27 client->transport.tls.sock = zsock_socket(broker->sa_family, in mqtt_client_tls_connect()
29 if (client->transport.tls.sock < 0) { in mqtt_client_tls_connect()
33 NET_DBG("Created socket %d", client->transport.tls.sock); in mqtt_client_tls_connect()
36 if (client->transport.proxy.addrlen != 0) { in mqtt_client_tls_connect()
37 ret = setsockopt(client->transport.tls.sock, in mqtt_client_tls_connect()
39 &client->transport.proxy.addr, in mqtt_client_tls_connect()
40 client->transport.proxy.addrlen); in mqtt_client_tls_connect()
[all …]
Dmqtt_transport_socket_tcp.c21 int mqtt_client_tcp_connect(struct mqtt_client *client) in mqtt_client_tcp_connect() argument
23 const struct sockaddr *broker = client->broker; in mqtt_client_tcp_connect()
26 client->transport.tcp.sock = zsock_socket(broker->sa_family, SOCK_STREAM, in mqtt_client_tcp_connect()
28 if (client->transport.tcp.sock < 0) { in mqtt_client_tcp_connect()
33 if (client->transport.proxy.addrlen != 0) { in mqtt_client_tcp_connect()
34 ret = setsockopt(client->transport.tcp.sock, in mqtt_client_tcp_connect()
36 &client->transport.proxy.addr, in mqtt_client_tcp_connect()
37 client->transport.proxy.addrlen); in mqtt_client_tcp_connect()
44 NET_DBG("Created socket %d", client->transport.tcp.sock); in mqtt_client_tcp_connect()
52 ret = zsock_connect(client->transport.tcp.sock, client->broker, in mqtt_client_tcp_connect()
[all …]
/Zephyr-latest/subsys/net/lib/http/
Dhttp_server_http2.c42 static void print_http_frames(struct http_client_ctx *client) in print_http_frames() argument
56 struct http2_frame *frame = &client->current_frame; in print_http_frames()
68 struct http_client_ctx *client, uint32_t stream_id) in find_http_stream_context() argument
70 ARRAY_FOR_EACH(client->streams, i) { in find_http_stream_context()
71 if (client->streams[i].stream_id == stream_id) { in find_http_stream_context()
72 return &client->streams[i]; in find_http_stream_context()
80 struct http_client_ctx *client, uint32_t stream_id) in allocate_http_stream_context() argument
82 ARRAY_FOR_EACH(client->streams, i) { in allocate_http_stream_context()
83 if (client->streams[i].stream_state == HTTP2_STREAM_IDLE) { in allocate_http_stream_context()
84 client->streams[i].stream_id = stream_id; in allocate_http_stream_context()
[all …]
Dhttp_server_http1.c41 static int send_http1_error_common(struct http_client_ctx *client, in send_http1_error_common() argument
46 ret = http_server_sendall(client, response, len); in send_http1_error_common()
52 client->http1_headers_sent = true; in send_http1_error_common()
57 static int send_http1_404(struct http_client_ctx *client) in send_http1_404() argument
59 return send_http1_error_common(client, not_found_response, in send_http1_404()
63 static int send_http1_405(struct http_client_ctx *client) in send_http1_405() argument
65 return send_http1_error_common(client, not_allowed_response, in send_http1_405()
69 static int send_http1_409(struct http_client_ctx *client) in send_http1_409() argument
71 return send_http1_error_common(client, conflict_response, in send_http1_409()
75 static void send_http1_500(struct http_client_ctx *client, int error_code) in send_http1_500() argument
[all …]
Dhttp_server_core.c66 static void close_client_connection(struct http_client_ctx *client);
296 struct http_client_ctx *client = in close_all_sockets() local
299 close_client_connection(client); in close_all_sockets()
310 static void client_release_resources(struct http_client_ctx *client) in client_release_resources() argument
327 if (dynamic_detail->holder != client) { in client_release_resources()
343 dynamic_detail->cb(client, HTTP_SERVER_DATA_ABORTED, &request_ctx, in client_release_resources()
349 void http_server_release_client(struct http_client_ctx *client) in http_server_release_client() argument
354 __ASSERT_NO_MSG(IS_ARRAY_ELEMENT(server_ctx.clients, client)); in http_server_release_client()
356 k_work_cancel_delayable_sync(&client->inactivity_timer, &sync); in http_server_release_client()
357 client_release_resources(client); in http_server_release_client()
[all …]
Dhttp_server_ws.c34 int handle_http1_to_websocket_upgrade(struct http_client_ctx *client) in handle_http1_to_websocket_upgrade() argument
48 key_len = MIN(sizeof(key_accept) - 1, sizeof(client->ws_sec_key)); in handle_http1_to_websocket_upgrade()
49 strncpy(key_accept, client->ws_sec_key, key_len); in handle_http1_to_websocket_upgrade()
60 NET_DBG("[%p] Too short buffer olen %zd", client, olen); in handle_http1_to_websocket_upgrade()
66 ret = http_server_sendall(client, switching_protocols, in handle_http1_to_websocket_upgrade()
73 client->http1_headers_sent = true; in handle_http1_to_websocket_upgrade()
75 ret = http_server_sendall(client, tmp, strlen(tmp)); in handle_http1_to_websocket_upgrade()
87 ret = http_server_sendall(client, tmp, strlen(tmp)); in handle_http1_to_websocket_upgrade()
96 if (client->parser_state == HTTP1_MESSAGE_COMPLETE_STATE) { in handle_http1_to_websocket_upgrade()
103 ws_detail = (struct http_resource_detail_websocket *)client->current_detail; in handle_http1_to_websocket_upgrade()
[all …]
/Zephyr-latest/subsys/net/lib/lwm2m/
Dlwm2m_rd_client.c137 } client; variable
149 if (client.rd_message.ctx) { in rd_get_message()
151 lwm2m_reset_message(&client.rd_message, true); in rd_get_message()
154 client.rd_message.ctx = client.ctx; in rd_get_message()
155 return &client.rd_message; in rd_get_message()
167 if (!client.ctx || !client.rd_message.ctx) { in lwm2m_get_ongoing_rd_msg()
170 return &client.rd_message; in lwm2m_get_ongoing_rd_msg()
175 client.last_tx = k_uptime_get(); in engine_update_tx_time()
180 client.next_event = timestamp; in next_event_at()
186 k_mutex_lock(&client.mutex, K_FOREVER); in set_sm_state_delayed()
[all …]
/Zephyr-latest/subsys/net/lib/mqtt_sn/
Dmqtt_sn.c87 static void mqtt_sn_set_state(struct mqtt_sn_client *client, enum mqtt_sn_client_state state) in mqtt_sn_set_state() argument
89 int prev_state = client->state; in mqtt_sn_set_state()
91 client->state = state; in mqtt_sn_set_state()
92 LOG_DBG("Client %p state (%d) -> (%d)", client, prev_state, state); in mqtt_sn_set_state()
108 static int encode_and_send(struct mqtt_sn_client *client, struct mqtt_sn_param *p, in encode_and_send() argument
113 err = mqtt_sn_encode_msg(&client->tx, p); in encode_and_send()
118 LOG_HEXDUMP_DBG(client->tx.data, client->tx.len, "Send message"); in encode_and_send()
120 if (!client->transport->sendto) { in encode_and_send()
126 if (!client->tx.len) { in encode_and_send()
133 err = client->transport->sendto(client, client->tx.data, client->tx.len, NULL, in encode_and_send()
[all …]
/Zephyr-latest/subsys/net/lib/http/headers/
Dserver_internal.h20 int handle_http_frame_rst_stream(struct http_client_ctx *client);
21 int handle_http_frame_goaway(struct http_client_ctx *client);
22 int handle_http_frame_settings(struct http_client_ctx *client);
23 int handle_http_frame_priority(struct http_client_ctx *client);
24 int handle_http_frame_continuation(struct http_client_ctx *client);
25 int handle_http_frame_window_update(struct http_client_ctx *client);
26 int handle_http_frame_header(struct http_client_ctx *client);
27 int handle_http_frame_headers(struct http_client_ctx *client);
28 int handle_http_frame_data(struct http_client_ctx *client);
29 int handle_http_frame_padding(struct http_client_ctx *client);
[all …]
/Zephyr-latest/tests/modules/thrift/ThriftTest/src/
Dclient.cpp26 context.client->testVoid(); in ZTEST()
32 context.client->testString(s, "Test"); in ZTEST()
38 zassert_equal(false, context.client->testBool(false), ""); in ZTEST()
39 zassert_equal(true, context.client->testBool(true), ""); in ZTEST()
44 zassert_equal(0, context.client->testByte(0), ""); in ZTEST()
45 zassert_equal(-1, context.client->testByte(-1), ""); in ZTEST()
46 zassert_equal(42, context.client->testByte(42), ""); in ZTEST()
47 zassert_equal(-42, context.client->testByte(-42), ""); in ZTEST()
48 zassert_equal(127, context.client->testByte(127), ""); in ZTEST()
49 zassert_equal(-128, context.client->testByte(-128), ""); in ZTEST()
[all …]
/Zephyr-latest/subsys/net/lib/coap/
Dcoap_client.c29 static void cancel_requests_with(struct coap_client *client, int error);
30 static int recv_response(struct coap_client *client, struct coap_packet *response, bool *truncated);
31 static int handle_response(struct coap_client *client, const struct coap_packet *response,
33 static struct coap_client_internal_request *get_request_with_mid(struct coap_client *client,
87 static int coap_client_schedule_poll(struct coap_client *client, int sock, in coap_client_schedule_poll() argument
91 client->fd = sock; in coap_client_schedule_poll()
119 static bool has_ongoing_request(struct coap_client *client) in has_ongoing_request() argument
122 if (client->requests[i].request_ongoing == true) { in has_ongoing_request()
130 static bool has_ongoing_exchange(struct coap_client *client) in has_ongoing_exchange() argument
133 if (client->requests[i].request_ongoing == true || in has_ongoing_exchange()
[all …]
/Zephyr-latest/subsys/bluetooth/audio/
Dcsip_set_coordinator.c112 struct bt_csip_set_coordinator_inst *client = in active_members_reset() local
115 atomic_clear_bit(client->flags, SET_COORDINATOR_FLAG_BUSY); in active_members_reset()
125 struct bt_csip_set_coordinator_inst *client; in lookup_instance_by_handle() local
131 client = &client_insts[conn_index]; in lookup_instance_by_handle()
133 for (int i = 0; i < ARRAY_SIZE(client->svc_insts); i++) { in lookup_instance_by_handle()
134 if (client->svc_insts[i].start_handle <= handle && in lookup_instance_by_handle()
135 client->svc_insts[i].end_handle >= handle) { in lookup_instance_by_handle()
136 return &client->svc_insts[i]; in lookup_instance_by_handle()
147 struct bt_csip_set_coordinator_inst *client; in bt_csip_set_coordinator_lookup_instance_by_index() local
155 client = &client_insts[conn_index]; in bt_csip_set_coordinator_lookup_instance_by_index()
[all …]
Dccp_call_control_client.c80 struct bt_ccp_call_control_client *client = get_client_by_conn(conn); in disconnected_cb() local
83 if (client->conn == conn) { in disconnected_cb()
84 bt_conn_unref(client->conn); in disconnected_cb()
85 client->conn = NULL; in disconnected_cb()
94 static void populate_bearers(struct bt_ccp_call_control_client *client, in populate_bearers() argument
100 if (client->bearers[i].discovered) { in populate_bearers()
101 bearers->gtbs_bearer = &client->bearers[i++]; in populate_bearers()
106 for (; i < ARRAY_SIZE(client->bearers); i++) { in populate_bearers()
107 if (!client->bearers[i].discovered) { in populate_bearers()
111 bearers->tbs_bearers[bearers->tbs_count++] = &client->bearers[i]; in populate_bearers()
[all …]
Dhas.c72 static int read_preset_response(struct has_client *client);
73 static int preset_list_changed(struct has_client *client);
74 static int preset_list_changed_generic_update_tail(struct has_client *client);
75 static int preset_list_changed_record_deleted_last(struct has_client *client);
260 static void client_free(struct has_client *client) in client_free() argument
266 (void)k_work_cancel_delayable(&client->notify_work); in client_free()
269 err = bt_conn_get_info(client->conn, &info); in client_free()
272 if (client->context != NULL && !bt_le_bond_exists(info.id, info.le.dst)) { in client_free()
274 context_free(client->context); in client_free()
275 client->context = NULL; in client_free()
[all …]
Dcap_common.c86 struct bt_cap_common_client *client; in bt_cap_common_get_member_conn() local
92 client = bt_cap_common_get_client_by_csis(member->csip); in bt_cap_common_get_member_conn()
93 if (client == NULL) { in bt_cap_common_get_member_conn()
97 return client->conn; in bt_cap_common_get_member_conn()
222 struct bt_cap_common_client *client = bt_cap_common_get_client_by_acl(conn); in bt_cap_common_disconnected() local
224 if (client->conn != NULL) { in bt_cap_common_disconnected()
225 bt_conn_unref(client->conn); in bt_cap_common_disconnected()
227 (void)memset(client, 0, sizeof(*client)); in bt_cap_common_disconnected()
255 struct bt_cap_common_client *client = &bt_cap_common_clients[i]; in bt_cap_common_get_client_by_csis() local
257 if (client->csis_inst == csis_inst) { in bt_cap_common_get_client_by_csis()
[all …]
/Zephyr-latest/samples/net/secure_mqtt_sensor_actuator/src/
Dmqtt_client.c72 static void prepare_fds(struct mqtt_client *client) in prepare_fds() argument
74 if (client->transport.type == MQTT_TRANSPORT_NON_SECURE) { in prepare_fds()
75 fds[0].fd = client->transport.tcp.sock; in prepare_fds()
78 else if (client->transport.type == MQTT_TRANSPORT_SECURE) { in prepare_fds()
79 fds[0].fd = client->transport.tls.sock; in prepare_fds()
123 static void on_mqtt_publish(struct mqtt_client *const client, const struct mqtt_evt *evt) in on_mqtt_publish() argument
128 rc = mqtt_read_publish_payload(client, payload, in on_mqtt_publish()
149 static void mqtt_event_handler(struct mqtt_client *const client, const struct mqtt_evt *evt) in mqtt_event_handler() argument
189 mqtt_publish_qos2_release(client, &rel_param); in mqtt_event_handler()
204 mqtt_publish_qos2_complete(client, &rec_param); in mqtt_event_handler()
[all …]
/Zephyr-latest/subsys/net/lib/tftp/
Dtftp_client.c53 static int send_data(int sock, struct tftpc *client, uint32_t block_no, const uint8_t *data_buffer, in send_data() argument
72 sys_put_be16(DATA_OPCODE, client->tftp_buf); in send_data()
73 sys_put_be16(block_no, client->tftp_buf + 2); in send_data()
74 memcpy(client->tftp_buf + TFTP_HEADER_SIZE, data_buffer, data_size); in send_data()
76 ret = zsock_send(sock, client->tftp_buf, data_size + TFTP_HEADER_SIZE, 0); in send_data()
96 ret = zsock_recv(sock, client->tftp_buf, TFTPC_MAX_BUF_SIZE, 0); in send_data()
106 uint16_t opcode = sys_get_be16(client->tftp_buf); in send_data()
107 uint16_t blockno = sys_get_be16(client->tftp_buf + 2); in send_data()
119 if (client->callback) { in send_data()
124 evt.param.error.msg = client->tftp_buf + TFTP_HEADER_SIZE; in send_data()
[all …]
/Zephyr-latest/samples/net/mqtt_publisher/src/
Dmain.c109 static void prepare_fds(struct mqtt_client *client) in prepare_fds() argument
111 if (client->transport.type == MQTT_TRANSPORT_NON_SECURE) { in prepare_fds()
112 fds[0].fd = client->transport.tcp.sock; in prepare_fds()
115 else if (client->transport.type == MQTT_TRANSPORT_SECURE) { in prepare_fds()
116 fds[0].fd = client->transport.tls.sock; in prepare_fds()
143 void mqtt_evt_handler(struct mqtt_client *const client, in mqtt_evt_handler() argument
190 err = mqtt_publish_qos2_release(client, &rel_param); in mqtt_evt_handler()
243 static int publish(struct mqtt_client *client, enum mqtt_qos qos) in publish() argument
258 return mqtt_publish(client, &param); in publish()
298 static void client_init(struct mqtt_client *client) in client_init() argument
[all …]
/Zephyr-latest/subsys/bluetooth/services/ias/
Dias_client.c125 struct bt_ias_client *client = client_by_conn(conn); in bt_ias_prim_disc_cb() local
135 client->discover.uuid = alert_lvl_uuid; in bt_ias_prim_disc_cb()
136 client->discover.start_handle = attr->handle + 1; in bt_ias_prim_disc_cb()
137 client->discover.end_handle = data->end_handle; in bt_ias_prim_disc_cb()
138 client->discover.type = BT_GATT_DISCOVER_CHARACTERISTIC; in bt_ias_prim_disc_cb()
139 client->discover.func = bt_ias_alert_lvl_disc_cb; in bt_ias_prim_disc_cb()
141 err = bt_gatt_discover(conn, &client->discover); in bt_ias_prim_disc_cb()
152 struct bt_ias_client *client = client_by_conn(conn); in bt_ias_discover() local
158 if (atomic_test_bit(client->flags, IAS_DISCOVER_IN_PROGRESS)) { in bt_ias_discover()
162 client_cleanup(client); in bt_ias_discover()
[all …]
/Zephyr-latest/include/zephyr/net/
Dmqtt_sn.h161 typedef void (*mqtt_sn_evt_cb_t)(struct mqtt_sn_client *client, const struct mqtt_sn_evt *evt);
196 int (*sendto)(struct mqtt_sn_client *client, void *buf, size_t sz, const void *dest_addr,
205 ssize_t (*recvfrom)(struct mqtt_sn_client *client, void *rx_buf, size_t rx_len,
218 int (*poll)(struct mqtt_sn_client *client);
336 int mqtt_sn_client_init(struct mqtt_sn_client *client, const struct mqtt_sn_data *client_id,
347 void mqtt_sn_client_deinit(struct mqtt_sn_client *client);
360 int mqtt_sn_add_gw(struct mqtt_sn_client *client, uint8_t gw_id, struct mqtt_sn_data gw_addr);
370 int mqtt_sn_search(struct mqtt_sn_client *client, uint8_t radius);
381 int mqtt_sn_connect(struct mqtt_sn_client *client, bool will, bool clean_session);
390 int mqtt_sn_disconnect(struct mqtt_sn_client *client);
[all …]

12345678910>>...14