Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Shell access over an MQTT connection. More...

Files

file  shell_mqtt.h
 Header file for the MQTT shell backend.

Macros

#define SHELL_MQTT_DEFINE(_name)
 Define an MQTT shell transport instance.

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.

Detailed Description

Shell access over an MQTT connection.

Macro Definition Documentation

◆ SHELL_MQTT_DEFINE

#define SHELL_MQTT_DEFINE ( _name)

#include <zephyr/shell/shell_mqtt.h>

Value:
static struct shell_mqtt _name##_shell_mqtt; \
struct shell_transport _name = { .api = &shell_mqtt_transport_api, \
.ctx = (struct shell_mqtt *)&_name##_shell_mqtt }
Shell transport instance.
Definition shell.h:948

Define an MQTT shell transport instance.

Parameters
_nameName of the transport instance.

Function Documentation

◆ shell_backend_mqtt_get_ptr()

const struct shell * shell_backend_mqtt_get_ptr ( void )

#include <zephyr/shell/shell_mqtt.h>

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 )

#include <zephyr/shell/shell_mqtt.h>

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