-
Notifications
You must be signed in to change notification settings - Fork 3
RaftBLEManagerSysMod
Handles BLE (Bluetooth Low Energy) connectivity and data for the system.
When constructed normally (in RaftCoreApp for instance) the BLEManager is configured using the contents of the SysTypes key BLEMan. The settings available to configure BLE are described in BLE Manager Settings
BLEManager(const char *pModuleName, RaftJsonIF& sysConfig)- pModuleName: Name of the module.
- sysConfig: Configuration settings for the system.
void setup();This function configures and sets up the BLE functionality according to the settings provided in the BLE Manager Settings.
BLE can operate in peripheral and/or central modes which are enabled by separate flags in the BLE Manager Settings.
Standard services (except for DeviceInfo) use the SysMod Named-Value access mechanism to get up-to-date data - the SysMod and named-value are specified in the BLE Manager Settings. The following services are supported:
-
Battery: Enables the Battery Service. -
DeviceInfo: Enables the Device Information Service. -
HeartRate: Enables the Heart Rate Service.
void loop();The main loop function checks if BLE is enabled and services the BLE GAP (Generic Access Profile).
Description:
Restarts the BLE service.
- Method: GET
-
Response:
{ "rslt": "ok" }if successful.
String getStatusJSON() const;Returns a JSON string with the status of the BLE Manager.
String getDebugJSON() const;Returns a more detailed JSON string with debug information about the BLE Manager.
double getNamedValue(const char* valueName, bool& isValid);This function allows access to certain named values:
-
Rorr: Retrieves the current RSSI (signal strength) value. -
Corc: Returns whether the BLE connection is active.
String getAdvertisingName();Returns the advertising name for the BLE device. If not configured, it uses the system's friendly name or system name.
This documentation covers the main aspects of the BLEManager module, including its configuration, API endpoints, and key functions.