Struct SYN_MqttClient¶
MQTT client context structure.
#include <syn_mqtt.h>
Public Attributes¶
| Type | Name |
|---|---|
| const char * | client_id |
| void * | ctx |
| const char * | host |
| uint16_t | keep_alive_s |
| uint32_t | last_activity_ms |
| uint16_t | next_packet_id |
| void(* | on_message User callback for incoming publications. |
| const char * | password |
| uint16_t | pending_puback_id |
| uint32_t | pending_puback_ms |
| uint16_t | port |
| uint8_t | retransmit_buf |
| size_t | retransmit_len |
| uint8_t * | rx_buf |
| size_t | rx_buf_size |
| uint32_t | rx_deadline |
| uint8_t | rx_header |
| uint32_t | rx_mult |
| SYN_MqttRxPhase | rx_phase |
| size_t | rx_pos |
| uint32_t | rx_rem_len |
| SYN_Socket | sock |
| SYN_MqttState | state |
| uint8_t * | tx_buf |
| size_t | tx_buf_size |
| const char * | username |
Public Attributes Documentation¶
variable client_id¶
Client identifier string (must be unique)
variable ctx¶
Context pointer for on_message callback
variable host¶
Hostname or IP of the broker
variable keep_alive_s¶
Keep alive ping interval in seconds
variable last_activity_ms¶
Timestamp of last transmitted or received packet
variable next_packet_id¶
Sequence counter for packet identifiers
variable on_message¶
User callback for incoming publications.
void(* SYN_MqttClient::on_message) (const char *topic, const uint8_t *payload, size_t len, void *ctx);
Parameters:
topicTopic name string.payloadReceived data payload buffer.lenSize of payload in bytes.ctxUser-defined context pointer.
variable password¶
Optional login password, or NULL
variable pending_puback_id¶
Awaiting QoS 1 puback confirmation packet ID
variable pending_puback_ms¶
Timeout timer for pending puback confirmation
variable port¶
Broker Port (typically 1883)
variable retransmit_buf¶
Buffer for storing unacknowledged QoS 1 packet
variable retransmit_len¶
Length of packet in retransmit_buf
variable rx_buf¶
Receive packet formatting buffer
variable rx_buf_size¶
Capacity of rx_buf
variable rx_deadline¶
Tick deadline for incomplete packet RX
variable rx_header¶
Opcode byte of current packet
variable rx_mult¶
Multiplier for decoding varint remaining len
variable rx_phase¶
Current RX state machine phase
variable rx_pos¶
Bytes read into rx_buf or discarded so far
variable rx_rem_len¶
Total remaining length of current packet
variable sock¶
TCP socket connection to broker
variable state¶
Connection state machine status
variable tx_buf¶
Transmit packet formatting buffer
variable tx_buf_size¶
Capacity of tx_buf
variable username¶
Optional login username, or NULL
The documentation for this class was generated from the following file src/syntropic/net/syn_mqtt.h