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_ro_cfg.h
Go to the documentation of this file.
1/**
2 * Copyright © 2024 - 2025 MeshX
3 *
4 * @file meshx_ro_cfg.h
5 * @brief Persistent Serialized Configuration Loader (Read-Only)
6 */
7
8#ifndef __MESHX_RO_CFG_H__
9#define __MESHX_RO_CFG_H__
10
11#include <stdint.h>
12#include <stdbool.h>
13#include <stddef.h>
14#include "meshx_err.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20/**
21 * @brief Initialize and load the MeshX configuration from the meshx_cfg partition.
22 *
23 * This function locates the `meshx_cfg` partition using FAL, validates the
24 * CRC-16-CCITT checksums of the header and payload, decodes the Protobuf
25 * payload using nanopb, and applies the configuration (e.g., global IDs,
26 * element composition, and GPIO bindings).
27 *
28 * If the loaded UUID is all zeros (or missing), the system should fall back
29 * to the legacy UUID generation method (e.g., based on device MAC).
30 *
31 * @param[out] cid Pointer to store the loaded Company ID.
32 * @param[out] pid Pointer to store the loaded Product ID.
33 * @param[out] product_name Buffer to store the loaded product name.
34 * @param[in] name_max_len Maximum length of the product_name buffer.
35 * @param[out] uuid Buffer to store the loaded 16-byte UUID.
36 * @return meshx_err_t MESHX_SUCCESS on success, or an error code on failure.
37 */
38meshx_err_t meshx_ro_cfg_init(uint16_t *cid, uint16_t *pid, char *product_name, size_t name_max_len, uint8_t *uuid);
39
40#ifdef __cplusplus
41}
42#endif
43
44#endif // __MESHX_RO_CFG_H__
MeshX Error Codes.
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:43
meshx_err_t meshx_ro_cfg_init(uint16_t *cid, uint16_t *pid, char *product_name, size_t name_max_len, uint8_t *uuid)
Initialize and load the MeshX configuration from the meshx_cfg partition.
Definition meshx_ro_cfg.c:90