Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shell_mqtt.h File Reference

Go to the source code of this file.

Data Structures

struct  shell_mqtt_tx_buf
 
struct  shell_mqtt
 MQTT-based shell transport. More...
 
struct  shell_mqtt::buffer
 

Macros

#define RX_RB_SIZE   CONFIG_SHELL_MQTT_RX_BUF_SIZE
 
#define TX_BUF_SIZE   CONFIG_SHELL_MQTT_TX_BUF_SIZE
 
#define SH_MQTT_BUFFER_SIZE   64
 
#define DEVICE_ID_BIN_MAX_SIZE   3
 
#define DEVICE_ID_HEX_MAX_SIZE   ((DEVICE_ID_BIN_MAX_SIZE * 2) + 1)
 
#define SH_MQTT_TOPIC_MAX_SIZE   DEVICE_ID_HEX_MAX_SIZE + 3
 
#define SHELL_MQTT_DEFINE(_name)
 

Functions

const struct shellshell_backend_mqtt_get_ptr (void)
 This function provides pointer to shell mqtt backend instance.
 
bool shell_mqtt_get_devid (char *id, int id_max_len)
 Function to define the device ID (devid) for which the shell mqtt backend uses as a client ID when it connects to the broker.
 

Variables

const struct shell_transport_api shell_mqtt_transport_api
 

Macro Definition Documentation

◆ DEVICE_ID_BIN_MAX_SIZE

#define DEVICE_ID_BIN_MAX_SIZE   3

◆ DEVICE_ID_HEX_MAX_SIZE

#define DEVICE_ID_HEX_MAX_SIZE   ((DEVICE_ID_BIN_MAX_SIZE * 2) + 1)

◆ RX_RB_SIZE

#define RX_RB_SIZE   CONFIG_SHELL_MQTT_RX_BUF_SIZE

◆ SH_MQTT_BUFFER_SIZE

#define SH_MQTT_BUFFER_SIZE   64

◆ SH_MQTT_TOPIC_MAX_SIZE

#define SH_MQTT_TOPIC_MAX_SIZE   DEVICE_ID_HEX_MAX_SIZE + 3

◆ SHELL_MQTT_DEFINE

#define SHELL_MQTT_DEFINE ( _name)
Value:
static struct shell_mqtt _name##_shell_mqtt; \
struct shell_transport _name = { .api = &shell_mqtt_transport_api, \
.ctx = (struct shell_mqtt *)&_name##_shell_mqtt }
const struct shell_transport_api shell_mqtt_transport_api
MQTT-based shell transport.
Definition shell_mqtt.h:41
Definition shell.h:724

◆ TX_BUF_SIZE

#define TX_BUF_SIZE   CONFIG_SHELL_MQTT_TX_BUF_SIZE

Function Documentation

◆ shell_backend_mqtt_get_ptr()

const struct shell * shell_backend_mqtt_get_ptr ( void )

This function provides pointer to shell mqtt backend instance.

Function returns pointer to the shell mqtt instance. This instance can be next used with shell_execute_cmd function in order to test commands behavior.

Returns
Pointer to the shell instance.

◆ shell_mqtt_get_devid()

bool shell_mqtt_get_devid ( char * id,
int id_max_len )

Function to define the device ID (devid) for which the shell mqtt backend uses as a client ID when it connects to the broker.

It will publish its output to devid_tx and subscribe to devid_rx for input .

Note
This is a weak-linked function, and can be overridden if desired.
Parameters
idPointer to the devid buffer
id_max_lenMaximum size of the devid buffer defined by DEVICE_ID_HEX_MAX_SIZE
Returns
true if length of devid > 0

Variable Documentation

◆ shell_mqtt_transport_api

const struct shell_transport_api shell_mqtt_transport_api
extern