ESP-IDF
Select one of the symbols to view example projects that use it.
Symbol previews are coming soon...
Outline
#define _MQTT_CLIENT_PRIV_H_
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdatomic.h>
#include "esp_err.h"
#include "platform.h"
#include "esp_event.h"
#include "mqtt_client.h"
#include "mqtt_msg.h"
#include "mqtt5_client_priv.h"
#include "esp_transport.h"
#include "esp_transport_tcp.h"
#include "esp_transport_ssl.h"
#include "esp_transport_ws.h"
#include "esp_log.h"
#include "mqtt_outbox.h"
#include "freertos/event_groups.h"
#include <errno.h>
#include <string.h>
#include "mqtt_supported_features.h"
#include "http_parser.h"
#define NEWLIB_NANO_COMPAT_FORMAT
#define NEWLIB_NANO_COMPAT_CAST
#define NEWLIB_NANO_COMPAT_FORMAT
#define NEWLIB_NANO_COMPAT_CAST
mqtt_state
in_buffer
in_buffer_length
message_length
in_buffer_read_len
connection
pending_msg_id
pending_msg_type
pending_publish_qos
mqtt_config_storage_t
event_loop_handle
task_stack
task_prio
uri
host
path
scheme
port
auto_reconnect
network_timeout_ms
refresh_connection_after_ms
reconnect_timeout_ms
alpn_protos
num_alpn_protos
clientkey_password
clientkey_password_len
use_global_ca_store
crt_bundle_attach
cacert_buf
cacert_bytes
clientcert_buf
clientcert_bytes
clientkey_buf
clientkey_bytes
psk_hint_key
skip_cert_common_name_check
common_name
use_secure_element
ds_data
message_retransmit_timeout
outbox_limit
transport
if_name
mqtt_client_state_t
MQTT_STATE_INIT
MQTT_STATE_DISCONNECTED
MQTT_STATE_CONNECTED
MQTT_STATE_WAIT_RECONNECT
esp_mqtt_client
transport_list
transport
config
mqtt_state
state
refresh_connection_tick
keepalive_tick
reconnect_tick
wait_timeout_ms
auto_reconnect
event
run
wait_for_ping_resp
outbox
status_bits
api_lock
task_handle
esp_mqtt_set_if_config(const char *const, char **);
esp_mqtt_destroy_config(esp_mqtt_client_handle_t);
Files
loading (4/5)...
SourceVu
ESP-IDF Framework and Examples
ESP-IDF
components/mqtt/esp-mqtt/lib/include/mqtt_client_priv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* ... */
#ifndef
_MQTT_CLIENT_PRIV_H_
#define
_MQTT_CLIENT_PRIV_H_
#include
<
stdint.h>
#include
<
stdio.h>
#include
<
stdlib.h>
#include
<
stdatomic.h>
#include
"
esp_err.h"
#include
"
platform.h"
#include
"
esp_event.h"
#include
"
mqtt_client.h"
#include
"
mqtt_msg.h"
9 includes
#ifdef
MQTT_PROTOCOL_5
#include
"
mqtt5_client_priv.h"
#endif
#include
"
esp_transport.h"
#include
"
esp_transport_tcp.h"
#include
"
esp_transport_ssl.h"
#include
"
esp_transport_ws.h"
#include
"
esp_log.h"
#include
"
mqtt_outbox.h"
#include
"
freertos
/
event_groups.h"
#include
<
errno.h>
#include
<
string.h>
#include
"
mqtt_supported_features.h"
/* using uri parser */
#include
"
http_parser.h"
11 includes
#ifdef
__cplusplus
extern
"C"
{
#endif
#if
CONFIG_NEWLIB_NANO_FORMAT
#define
NEWLIB_NANO_COMPAT_FORMAT
PRIu32
#define
NEWLIB_NANO_COMPAT_CAST
(
size_t_var
)
(
uint32_t
)
size_t_var
/* ... */
#else
#define
NEWLIB_NANO_COMPAT_FORMAT
"zu"
#define
NEWLIB_NANO_COMPAT_CAST
(
size_t_var
)
size_t_var
/* ... */
#endif
#ifdef
MQTT_DISABLE_API_LOCKS
# define
MQTT_API_LOCK
(
c
)
# define
MQTT_API_UNLOCK
(
c
)
/* ... */
#else
# define
MQTT_API_LOCK
(
c
)
xSemaphoreTakeRecursive
(
c
->
api_lock
,
portMAX_DELAY
)
# define
MQTT_API_UNLOCK
(
c
)
xSemaphoreGiveRecursive
(
c
->
api_lock
)
/* ... */
#endif
/* MQTT_USE_API_LOCKS */
typedef
struct
mqtt_state
{
uint8_t
*
in_buffer
;
int
in_buffer_length
;
size_t
message_length
;
size_t
in_buffer_read_len
;
mqtt_connection_t
connection
;
uint16_t
pending_msg_id
;
int
pending_msg_type
;
int
pending_publish_qos
;
}
{ ... }
mqtt_state_t
;
typedef
struct
{
esp_event_loop_handle_t
event_loop_handle
;
int
task_stack
;
int
task_prio
;
char
*
uri
;
char
*
host
;
char
*
path
;
char
*
scheme
;
int
port
;
bool
auto_reconnect
;
int
network_timeout_ms
;
int
refresh_connection_after_ms
;
int
reconnect_timeout_ms
;
char
*
*
alpn_protos
;
int
num_alpn_protos
;
char
*
clientkey_password
;
int
clientkey_password_len
;
bool
use_global_ca_store
;
esp_err_t
(
(
*
crt_bundle_attach
)
(
void
*
conf
)
)
;
const
char
*
cacert_buf
;
size_t
cacert_bytes
;
const
char
*
clientcert_buf
;
size_t
clientcert_bytes
;
const
char
*
clientkey_buf
;
size_t
clientkey_bytes
;
const
struct
psk_key_hint
*
psk_hint_key
;
bool
skip_cert_common_name_check
;
const
char
*
common_name
;
bool
use_secure_element
;
void
*
ds_data
;
int
message_retransmit_timeout
;
uint64_t
outbox_limit
;
esp_transport_handle_t
transport
;
struct
ifreq
*
if_name
;
}
{ ... }
mqtt_config_storage_t
;
typedef
enum
{
MQTT_STATE_INIT
=
0
,
MQTT_STATE_DISCONNECTED
,
MQTT_STATE_CONNECTED
,
MQTT_STATE_WAIT_RECONNECT
,
}
{ ... }
mqtt_client_state_t
;
struct
esp_mqtt_client
{
esp_transport_list_handle_t
transport_list
;
esp_transport_handle_t
transport
;
mqtt_config_storage_t
*
config
;
mqtt_state_t
mqtt_state
;
_Atomic
mqtt_client_state_t
state
;
uint64_t
refresh_connection_tick
;
int64_t
keepalive_tick
;
uint64_t
reconnect_tick
;
#ifdef
MQTT_PROTOCOL_5
mqtt5_config_storage_t
*
mqtt5_config
;
uint16_t
send_publish_packet_count
;
// This is for MQTT v5.0 flow control
/* ... */
#endif
int
wait_timeout_ms
;
int
auto_reconnect
;
esp_mqtt_event_t
event
;
bool
run
;
bool
wait_for_ping_resp
;
outbox_handle_t
outbox
;
EventGroupHandle_t
status_bits
;
SemaphoreHandle_t
api_lock
;
TaskHandle_t
task_handle
;
#if
MQTT_EVENT_QUEUE_SIZE
>
1
atomic_int
queued_events
;
#endif
}
{ ... }
;
bool
esp_mqtt_set_if_config
(
char
const
*
const
new_config
,
char
*
*
old_config
)
;
void
esp_mqtt_destroy_config
(
esp_mqtt_client_handle_t
client
)
;
#ifdef
__cplusplus
}
{...}
#endif
//__cplusplus
/* ... */
#endif
Details
Show:
from
Types:
Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.
esp_mqtt_set_if_config()
esp_mqtt_destroy_config()
esp_err_t
portMAX_DELAY
esp_mqtt_client::mqtt_state
esp_mqtt_client
esp_mqtt_client::config
mqtt_state::connection
esp_mqtt_client::event
esp_mqtt_client::api_lock
ifreq
MQTT_API_UNLOCK
mqtt_state::in_buffer_read_len
esp_event_loop_handle_t
NEWLIB_NANO_COMPAT_FORMAT
NEWLIB_NANO_COMPAT_CAST
mqtt_state::in_buffer
mqtt_config_storage_t::scheme
xSemaphoreGiveRecursive
esp_mqtt_destroy_config()::client
xSemaphoreTakeRecursive
mqtt_state::pending_msg_id
esp_mqtt_client::outbox
esp_mqtt_client::state
MQTT_API_LOCK
psk_key_hint
esp_mqtt_client::transport
esp_mqtt_client::status_bits
esp_mqtt_client::transport_list
mqtt_config_storage_t
mqtt_config_storage_t::path
mqtt_config_storage_t::alpn_protos
mqtt_state::in_buffer_length
mqtt_state::pending_msg_type
mqtt_config_storage_t::event_loop_handle
mqtt_config_storage_t::network_timeout_ms
mqtt_state::message_length
mqtt_config_storage_t::if_name
mqtt_state::pending_publish_qos
mqtt_config_storage_t::outbox_limit
mqtt_client_state_t::MQTT_STATE_CONNECTED
esp_mqtt_client::run
esp_mqtt_client::wait_for_ping_resp
MQTT_EVENT_QUEUE_SIZE
mqtt_config_storage_t::host
mqtt_config_storage_t::port
mqtt_config_storage_t::num_alpn_protos
mqtt_config_storage_t::clientkey_password
mqtt_client_state_t
mqtt_client_state_t::MQTT_STATE_INIT
esp_mqtt_client::wait_timeout_ms
mqtt_config_storage_t::uri
mqtt_config_storage_t::auto_reconnect
mqtt_config_storage_t::clientkey_password_len
esp_mqtt_client::keepalive_tick
mqtt_state
mqtt_config_storage_t::task_stack
mqtt_config_storage_t::task_prio
mqtt_config_storage_t::psk_hint_key
mqtt_config_storage_t::message_retransmit_timeout
mqtt_client_state_t::MQTT_STATE_DISCONNECTED
esp_mqtt_client::reconnect_tick
esp_mqtt_set_if_config()::old_config
mqtt_config_storage_t::refresh_connection_after_ms
mqtt_config_storage_t::reconnect_timeout_ms
mqtt_config_storage_t::use_global_ca_store
mqtt_config_storage_t::crt_bundle_attach
mqtt_config_storage_t::cacert_buf
mqtt_config_storage_t::clientcert_buf
mqtt_config_storage_t::common_name
mqtt_config_storage_t::transport
mqtt_client_state_t::MQTT_STATE_WAIT_RECONNECT
esp_mqtt_client::refresh_connection_tick
esp_mqtt_set_if_config()::new_config
mqtt_config_storage_t::cacert_bytes
mqtt_config_storage_t::clientcert_bytes
mqtt_config_storage_t::clientkey_buf
mqtt_config_storage_t::clientkey_bytes
mqtt_config_storage_t::skip_cert_common_name_check
mqtt_config_storage_t::use_secure_element
mqtt_config_storage_t::ds_data
esp_mqtt_client::task_handle
_MQTT_CLIENT_PRIV_H_
esp_mqtt_client::auto_reconnect
mqtt_connection_t
mqtt_state_t
esp_transport_handle_t
mqtt_config_storage_t
mqtt_client_state_t
esp_transport_list_handle_t
esp_mqtt_event_t
outbox_handle_t
EventGroupHandle_t
SemaphoreHandle_t
TaskHandle_t
esp_mqtt_client_handle_t