MeshX 0.3
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.
|
Header file for the production console unit test functionality. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "meshx_config_internal.h"
#include "argtable3/argtable3.h"
#include "module_id.h"
#include "meshx_err.h"
Go to the source code of this file.
Data Structures | |
struct | callback_node |
Structure to hold the unit test callback function. More... | |
Macros | |
#define | UT_GET_ARG(_x, _type, _argv) |
Macro to extract an argument from the argument list. | |
Typedefs | |
typedef meshx_err_t(* | module_callback_t) (int cmd_id, int argc, char **argv) |
Callback function for unit test modules. | |
typedef struct callback_node | unit_test_callback_t |
Structure to hold the unit test callback function. | |
Functions | |
meshx_err_t | register_ut_command () |
Registers the unit test (ut) command with the ESP console. | |
meshx_err_t | init_unit_test_console (void) |
Initialize the production console. | |
meshx_err_t | register_unit_test (module_id_t module_id, module_callback_t callback) |
Register a unit test for a specific module. | |
Header file for the production console unit test functionality.
Copyright © 2024 - 2025 MeshX
This file contains the declarations and definitions for initializing the production console and registering unit test callbacks for different modules.
Definition in file unit_test.h.
#define UT_GET_ARG | ( | _x, | |
_type, | |||
_argv ) |
Macro to extract an argument from the argument list.
Definition at line 27 of file unit_test.h.
typedef meshx_err_t(* module_callback_t) (int cmd_id, int argc, char **argv) |
Callback function for unit test modules.
This function is used to define the callback function signature for unit test modules. The callback function is invoked when a unit test command is received by the production console.
cmd_id | The command ID to be processed. |
argc | The number of arguments provided. |
argv | The array of arguments. |
Definition at line 44 of file unit_test.h.
typedef struct callback_node unit_test_callback_t |
Structure to hold the unit test callback function.
meshx_err_t init_unit_test_console | ( | void | ) |
Initialize the production console.
This function initializes the production console for the application.
Definition at line 100 of file unit_test.c.
meshx_err_t register_unit_test | ( | module_id_t | module_id, |
module_callback_t | callback ) |
Register a unit test for a specific module.
This function registers a unit test callback for the given module ID.
[in] | module_id | The ID of the module for which the unit test is being registered. |
[in] | callback | The callback function to be called for the unit test. |
Definition at line 149 of file unit_test.c.
meshx_err_t register_ut_command | ( | ) |
Registers the unit test (ut) command with the ESP console.
This function creates a new console command "ut" which is used for running unit tests. The command is registered with the ESP console using the esp_console_cmd_register function.
Definition at line 81 of file unit_test.c.