MeshX 0.4
This repository provides an implementation for Bluetooth Low Energy (BLE) Mesh network nodes. The project allows you to create BLE mesh nodes that can communicate with each other, enabling the development of smart home solutions or other IoT-based applications.
Loading...
Searching...
No Matches
meshx_shell.h
Go to the documentation of this file.
1/**
2 * Copyright © 2024 - 2025 MeshX
3 *
4 * @file meshx_shell.h
5 * @brief Platform-agnostic shell interface for MeshX.
6 */
7
8#ifndef __MESHX_SHELL_H__
9#define __MESHX_SHELL_H__
10
11#include "meshx_err.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/**
18 * @brief Shell command function pointer type.
19 */
20typedef int (*meshx_shell_func_t)(int argc, char **argv);
21
22/**
23 * @brief Shell command structure.
24 */
25typedef struct {
26 const char *command; /**< Command name */
27 const char *help; /**< Help text */
28 const char *hint; /**< Hint text (optional) */
29 meshx_shell_func_t func; /**< Command function */
31
32#define MESHX_SHELL_MAX_COMMANDS 32
33
34/**
35 * @brief Initializes the MeshX shell core and the underlying platform console.
36 *
37 * @return meshx_err_t MESHX_SUCCESS on success, error code otherwise.
38 */
40
41/**
42 * @brief Registers a command with the MeshX shell.
43 *
44 * @param[in] cmd Pointer to the command structure.
45 * @return meshx_err_t MESHX_SUCCESS on success, error code otherwise.
46 */
48
49/**
50 * @brief Starts the MeshX shell task.
51 *
52 * @return meshx_err_t MESHX_SUCCESS on success, error code otherwise.
53 */
55
56/**
57 * @brief Prints a message to the shell console.
58 *
59 * @param[in] fmt Format string.
60 * @param[in] ... Arguments.
61 */
62void meshx_shell_printf(const char *fmt, ...);
63
64#ifdef __cplusplus
65}
66#endif
67
68#endif /* __MESHX_SHELL_H__ */
MeshX Error Codes.
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:43
meshx_err_t meshx_shell_start(void)
Starts the MeshX shell task.
Definition meshx_shell.c:130
meshx_err_t meshx_shell_register_command(const meshx_shell_cmd_t *cmd)
Registers a command with the MeshX shell.
Definition meshx_shell.c:119
void meshx_shell_printf(const char *fmt,...)
Prints a message to the shell console.
Definition meshx_shell.c:30
meshx_err_t meshx_shell_init(void)
Initializes the MeshX shell core and the underlying platform console.
Definition meshx_shell.c:102
int(* meshx_shell_func_t)(int argc, char **argv)
Shell command function pointer type.
Definition meshx_shell.h:20
Shell command structure.
Definition meshx_shell.h:25
meshx_shell_func_t func
Definition meshx_shell.h:29
const char * help
Definition meshx_shell.h:27
const char * hint
Definition meshx_shell.h:28
const char * command
Definition meshx_shell.h:26