Home
last modified time | relevance | path

Searched full:client (Results 1 – 25 of 842) sorted by relevance

12345678910>>...34

/Zephyr-latest/subsys/net/lib/mqtt/
Dmqtt.c9 * @brief MQTT Client API Implementation.
21 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()
[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);
69 * @param[in] client Identifies the client on which the procedure is requested.
73 int mqtt_transport_connect(struct mqtt_client *client);
77 * @param[in] client Identifies the client on which the procedure is requested.
83 int mqtt_transport_write(struct mqtt_client *client, const uint8_t *data,
88 * @param[in] client Identifies the client on which the procedure is requested.
[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_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_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_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/mqtt_sn/
Dmqtt_sn.c9 * @brief MQTT-SN Client API Implementation.
80 static void mqtt_sn_set_state(struct mqtt_sn_client *client, enum mqtt_sn_client_state state) in mqtt_sn_set_state() argument
82 int prev_state = client->state; in mqtt_sn_set_state()
84 client->state = state; in mqtt_sn_set_state()
85 LOG_DBG("Client %p state (%d) -> (%d)", client, prev_state, state); in mqtt_sn_set_state()
101 static int encode_and_send(struct mqtt_sn_client *client, struct mqtt_sn_param *p, in encode_and_send() argument
106 err = mqtt_sn_encode_msg(&client->tx, p); in encode_and_send()
111 LOG_HEXDUMP_DBG(client->tx.data, client->tx.len, "Send message"); in encode_and_send()
113 if (!client->transport->sendto) { in encode_and_send()
119 if (!client->tx.len) { in encode_and_send()
[all …]
/Zephyr-latest/subsys/net/lib/http/
Dhttp_server_http2.c41 static void print_http_frames(struct http_client_ctx *client) in print_http_frames() argument
55 struct http2_frame *frame = &client->current_frame; in print_http_frames()
67 struct http_client_ctx *client, uint32_t stream_id) in find_http_stream_context() argument
69 ARRAY_FOR_EACH(client->streams, i) { in find_http_stream_context()
70 if (client->streams[i].stream_id == stream_id) { in find_http_stream_context()
71 return &client->streams[i]; in find_http_stream_context()
79 struct http_client_ctx *client, uint32_t stream_id) in allocate_http_stream_context() argument
81 ARRAY_FOR_EACH(client->streams, i) { in allocate_http_stream_context()
82 if (client->streams[i].stream_state == HTTP2_STREAM_IDLE) { in allocate_http_stream_context()
83 client->streams[i].stream_id = stream_id; in allocate_http_stream_context()
[all …]
Dhttp_server_http1.c42 struct http_client_ctx *client) in handle_http1_static_resource() argument
80 ret = http_server_sendall(client, http_response, in handle_http1_static_resource()
86 ret = http_server_sendall(client, data, len); in handle_http1_static_resource()
110 ret = http_server_sendall(client, http_response, \
119 static int http1_send_headers(struct http_client_ctx *client, enum http_status status, in http1_send_headers() argument
141 ret = http_server_sendall(client, http_response, in http1_send_headers()
163 ret = http_server_sendall(client, http_response, in http1_send_headers()
170 ret = http_server_sendall(client, hdr->value, strlen(hdr->value)); in http1_send_headers()
176 ret = http_server_sendall(client, crlf, 2); in http1_send_headers()
194 ret = http_server_sendall(client, http_response, in http1_send_headers()
[all …]
Dhttp_server_core.c65 static void close_client_connection(struct http_client_ctx *client);
274 LOG_DBG("New client from %s:%d", in accept_new_client()
294 struct http_client_ctx *client = in close_all_sockets() local
297 close_client_connection(client); in close_all_sockets()
304 static void client_release_resources(struct http_client_ctx *client) in client_release_resources() argument
321 if (dynamic_detail->holder != client) { in client_release_resources()
325 /* If the client still holds the resource at this point, in client_release_resources()
337 dynamic_detail->cb(client, HTTP_SERVER_DATA_ABORTED, &request_ctx, in client_release_resources()
343 void http_server_release_client(struct http_client_ctx *client) in http_server_release_client() argument
348 __ASSERT_NO_MSG(IS_ARRAY_ELEMENT(server_ctx.clients, client)); in http_server_release_client()
[all …]
/Zephyr-latest/subsys/net/lib/lwm2m/
Dlwm2m_rd_client.c87 /* The states for the RD client state machine */
137 } 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()
[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/include/zephyr/sip_svc/
Dsip_svc.h22 * The client must open a channel before sending any request and
26 * The service will return the SMC/HVC return value to the client
29 * The client state machine
32 * - OPEN : The client will switch from IDLE to OPEN once it
36 * - ABORT : The client has closed the channel, however, there are
38 * will only move the client back to IDLE state once all
39 * transactions completed. The client is not allowed to
56 * @param c_token Client's token
62 * @brief Register a client on ARM SiP service
64 * On success, the client will be at IDLE state in the service and
[all …]
/Zephyr-latest/subsys/bluetooth/mesh/shell/
DKconfig70 bool "Support for Health Client shell commands"
74 This option enables support of Health Client shell commands.
77 bool "Support for Bridge Configuration Client shell commands"
81 This option enables support of Bridge Configuration Client shell commands.
84 bool "Support for Configuration Client shell commands"
88 This option enables support of Configuration Client shell commands.
98 bool "Support for Firmware Update Client shell commands"
102 Firmware Update Client shell support.
126 bool "Support for BLOB Transfer Client shell commands"
130 BLOB Transfer Client shell support.
[all …]
/Zephyr-latest/include/zephyr/mgmt/mcumgr/grp/os_mgmt/
Dos_mgmt_client.h14 * @brief MCUmgr OS management client API
25 * @brief OS mgmt client object
28 /** SMP client object */
35 * @brief Initialize OS management client.
37 * @param client OS mgmt client object
38 * @param smp_client SMP client object
41 void os_mgmt_client_init(struct os_mgmt_client *client, struct smp_client_object *smp_client);
46 * @param client OS mgmt client object
53 int os_mgmt_client_echo(struct os_mgmt_client *client, const char *echo_string, size_t max_len);
58 * @param client OS mgmt client object
[all …]
/Zephyr-latest/subsys/bluetooth/audio/
Dcsip_set_coordinator.c1 /* Bluetooth Coordinated Set Identification Client
113 struct bt_csip_set_coordinator_inst *client = in active_members_reset() local
116 atomic_clear_bit(client->flags, SET_COORDINATOR_FLAG_BUSY); in active_members_reset()
126 struct bt_csip_set_coordinator_inst *client; in lookup_instance_by_handle() local
132 client = &client_insts[conn_index]; in lookup_instance_by_handle()
134 for (int i = 0; i < ARRAY_SIZE(client->svc_insts); i++) { in lookup_instance_by_handle()
135 if (client->svc_insts[i].start_handle <= handle && in lookup_instance_by_handle()
136 client->svc_insts[i].end_handle >= handle) { in lookup_instance_by_handle()
137 return &client->svc_insts[i]; in lookup_instance_by_handle()
148 struct bt_csip_set_coordinator_inst *client; in bt_csip_set_coordinator_lookup_instance_by_index() local
[all …]
Dhas.c73 static int read_preset_response(struct has_client *client);
74 static int preset_list_changed(struct has_client *client);
75 static int preset_list_changed_generic_update_tail(struct has_client *client);
76 static int preset_list_changed_record_deleted_last(struct has_client *client);
194 /* Stored client context */
205 /* Connected client instance */
261 static void client_free(struct has_client *client) in client_free() argument
267 (void)k_work_cancel_delayable(&client->notify_work); in client_free()
270 err = bt_conn_get_info(client->conn, &info); in client_free()
273 if (client->context != NULL && !bt_addr_le_is_bonded(info.id, info.le.dst)) { in client_free()
[all …]
/Zephyr-latest/include/zephyr/mgmt/mcumgr/grp/img_mgmt/
Dimg_mgmt_client.h15 * @brief MCUmgr Image management client API
80 * @brief IMG mgmt client upload structure
82 * Structure is used internally by the client
100 * @brief IMG mgmt client object.
103 /** SMP client object */
105 /** Image Upload state data for client internal use */
107 /** Client image list buffer size */
116 * @brief Inilialize image group client.
118 * Function initializes image group client for given SMP client using supplied image data.
120 * @param client IMG mgmt client object
[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/samples/drivers/mbox_data/
Dsample.yaml21 - "Client received \\(on channel 2\\) value: 1"
22 - "Client send \\(on channel 3\\) value: 2"
23 - "Client received \\(on channel 2\\) value: 3"
24 - "Client send \\(on channel 3\\) value: 4"
25 - "Client received \\(on channel 2\\) value: 41"
26 - "Client send \\(on channel 3\\) value: 42"
27 - "Client received \\(on channel 2\\) value: 97"
28 - "Client send \\(on channel 3\\) value: 98"
29 - "Client received \\(on channel 2\\) value: 99"
/Zephyr-latest/include/zephyr/net/
Dmqtt_sn.h9 * @brief MQTT-SN Client Implementation
12 * MQTT-SN Client's Application interface is defined in this header.
15 * @defgroup mqtt_sn_socket MQTT-SN Client library
63 * which the corresponding topic name is known in advance by both the client
157 * @param[in] client Identifies the client for which the event is notified.
161 typedef void (*mqtt_sn_evt_cb_t)(struct mqtt_sn_client *client, const struct mqtt_sn_evt *evt);
172 * @brief Will be called once on client init to initialize the transport.
179 * @brief Will be called on client deinit
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,
[all …]
/Zephyr-latest/samples/net/secure_mqtt_sensor_actuator/src/
Dmqtt_client.c19 /* Buffers for MQTT client */
42 /* MQTT client ID buffer */
72 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()
92 /** Initialise the MQTT client ID as the board name with random hex postfix */
104 LOG_INF("Client ID: %s", client_id); in on_mqtt_connect()
123 static void on_mqtt_publish(struct mqtt_client *const client, const struct mqtt_evt *evt) in on_mqtt_publish() argument
[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
63 LOG_DBG("Client send data: block no %u, size %u", block_no, data_size + TFTP_HEADER_SIZE); in send_data()
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()
[all …]

12345678910>>...34