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_common.h File Reference

Common application definitions and includes for BLE Mesh Node. More...

#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <meshx_err.h>
#include <meshx_config_internal.h>
#include <interface/logging/meshx_log.h>
#include "interface/meshx_platform.h"

Go to the source code of this file.

Data Structures

struct  meshx_app_store
 Structure to store mesh application data. More...
struct  dev_struct
 Structure representing the device composition and elements. More...
struct  meshx_model_interface
struct  element_comp_table
 Structure to store element composition functions. More...

Macros

#define CONFIG_SECTION_ENABLE_ELEMENT_TABLE   0
 Enable Element Table registration using Linker script.
#define MAX_ELE_CNT   CONFIG_MAX_ELEMENT_COUNT
#define MESHX_NVS_STORE   "meshx_store"
#define REG_MESHX_ELEMENT_FN(_name, _type, _fn)
 Register an element composition function.

Typedefs

typedef struct meshx_app_store meshx_app_store_t
 Structure to store mesh application data.
typedef struct dev_struct dev_struct_t
 Structure representing the device composition and elements.
typedef struct meshx_model_interface meshx_model_interface_t
typedef meshx_err_t(* element_comp_fn_t) (dev_struct_t *pdev, uint16_t element_cnt)
 MeshX Compostion init Function Pointer.
typedef struct element_comp_table element_comp_table_t

Enumerations

enum  meshx_ctrl_evt_t {
  MESHX_CTRL_EVT_NODE_RESET = 0x01 ,
  MESHX_CTRL_EVT_PROV_COMP ,
  MESHX_CTRL_EVT_PROV_FAILED ,
  MESHX_CTRL_EVT_PROV_START ,
  MESHX_CTRL_EVT_IDENTIFY_START ,
  MESHX_CTRL_EVT_IDENTIFY_STOP
}
 Enumeration for the BLE Mesh application control event. More...

Detailed Description

Common application definitions and includes for BLE Mesh Node.

Copyright © 2024 - 2025 MeshX

This header file contains common definitions, includes, and data structures used across the BLE Mesh Node application.

Author
Pranjal Chanda

Macro Definition Documentation

◆ CONFIG_SECTION_ENABLE_ELEMENT_TABLE

#define CONFIG_SECTION_ENABLE_ELEMENT_TABLE   0

Enable Element Table registration using Linker script.

Note
This feature is disabled by default.

◆ MAX_ELE_CNT

#define MAX_ELE_CNT   CONFIG_MAX_ELEMENT_COUNT

◆ MESHX_NVS_STORE

#define MESHX_NVS_STORE   "meshx_store"

◆ REG_MESHX_ELEMENT_FN

#define REG_MESHX_ELEMENT_FN ( _name,
_type,
_fn )

Register an element composition function.

Note
Currently feature is disabled using CONFIG_SECTION_ENABLE_ELEMENT_TABLE

This macro registers an element composition function to the element table.

Parameters
_nameName of the element composition function.
_typeType of the element.
_fnElement composition function.

Typedef Documentation

◆ dev_struct_t

typedef struct dev_struct dev_struct_t

Structure representing the device composition and elements.

◆ element_comp_fn_t

typedef meshx_err_t(* element_comp_fn_t) (dev_struct_t *pdev, uint16_t element_cnt)

MeshX Compostion init Function Pointer.

Parameters
[in]pdevPointer to the device structure.
[in]element_cntNumber of elements.
Returns
meshx_err_t

◆ element_comp_table_t

◆ meshx_app_store_t

Structure to store mesh application data.

◆ meshx_model_interface_t

Enumeration Type Documentation

◆ meshx_ctrl_evt_t

Enumeration for the BLE Mesh application control event.

Enumerator
MESHX_CTRL_EVT_NODE_RESET 0x01 
MESHX_CTRL_EVT_PROV_COMP  
MESHX_CTRL_EVT_PROV_FAILED  
MESHX_CTRL_EVT_PROV_START  
MESHX_CTRL_EVT_IDENTIFY_START  
MESHX_CTRL_EVT_IDENTIFY_STOP  
31 {
32 MESHX_CTRL_EVT_NODE_RESET = 0x01, /* Node Reset */
33 MESHX_CTRL_EVT_PROV_COMP, /* Provisioning Completed */
34 MESHX_CTRL_EVT_PROV_FAILED, /* Provisioning Failed */
35 MESHX_CTRL_EVT_PROV_START, /* Provisioning Started */
36 MESHX_CTRL_EVT_IDENTIFY_START, /* Identification Started */
37 MESHX_CTRL_EVT_IDENTIFY_STOP, /* Identification Stopped */
meshx_ctrl_evt_t
Enumeration for the BLE Mesh application control event.
Definition meshx_common.h:31
@ MESHX_CTRL_EVT_PROV_START
Definition meshx_common.h:35
@ MESHX_CTRL_EVT_PROV_COMP
Definition meshx_common.h:33
@ MESHX_CTRL_EVT_NODE_RESET
Definition meshx_common.h:32
@ MESHX_CTRL_EVT_IDENTIFY_STOP
Definition meshx_common.h:37
@ MESHX_CTRL_EVT_PROV_FAILED
Definition meshx_common.h:34
@ MESHX_CTRL_EVT_IDENTIFY_START
Definition meshx_common.h:36