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.
Loading...
Searching...
No Matches
esp_platform.c File Reference

Platform-specific initialization and BLE Mesh provisioning for ESP32. This file contains functions to initialize the platform, Bluetooth, and BLE Mesh stack for the MeshX framework. More...

#include "esp_err.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "interface/meshx_platform.h"
#include "interface/ble_mesh/server/meshx_ble_mesh_prov_srv.h"
Include dependency graph for esp_platform.c:

Go to the source code of this file.

Functions

meshx_err_t meshx_platform_init (void)
 Initializes the MeshX platform for the ESP32.
 
void meshx_platform_reset (void)
 Resets the MeshX platform. This function performs a system reset, restarting the platform.
 

Detailed Description

Platform-specific initialization and BLE Mesh provisioning for ESP32. This file contains functions to initialize the platform, Bluetooth, and BLE Mesh stack for the MeshX framework.

Copyright (c) 2024 - 2025 MeshX

Author
Pranjal Chanda

Definition in file esp_platform.c.

Function Documentation

◆ meshx_platform_init()

meshx_err_t meshx_platform_init ( void )

Initializes the MeshX platform for the ESP32.

Initializes the MeshX platform.

This function sets up the necessary components and configurations required for the MeshX platform to operate on the ESP32. It ensures that the platform is ready for use by other components of the MeshX system.

Returns
  • MESHX_OK on successful initialization.
  • Appropriate error code of type meshx_err_t on failure.

Definition at line 31 of file esp_platform.c.

32{
33 esp_err_t err = ESP_OK;
34 /* Initialize NVS flash */
35 err = nvs_flash_init();
36 if (err == ESP_ERR_NVS_NO_FREE_PAGES)
37 {
38 ESP_ERROR_CHECK(nvs_flash_erase());
39 err = nvs_flash_init();
40 }
41 if(err)
42 return MESHX_ERR_PLAT;
43
44 /* Set log level for BLE Mesh */
45 esp_log_level_set("BLE_MESH", ESP_LOG_ERROR);
46
47 return MESHX_SUCCESS;
48}
@ MESHX_SUCCESS
Definition meshx_err.h:40
@ MESHX_ERR_PLAT
Definition meshx_err.h:43
Here is the caller graph for this function:

◆ meshx_platform_reset()

void meshx_platform_reset ( void )

Resets the MeshX platform. This function performs a system reset, restarting the platform.

Definition at line 54 of file esp_platform.c.

55{
56 esp_restart();
57}
Here is the caller graph for this function: