LoRa-BLE-Sensor
Loading...
Searching...
No Matches
ble_device_service.h
Go to the documentation of this file.
1
13#ifndef BLE_DEVICE_SERVICE_H
14#define BLE_DEVICE_SERVICE_H
15
16#include "sensor_pmic.h"
17
18/*
19- Service DEVICE
20- device_name (r/w)
21- hardware_version (r)
22- firmware_version (r)
23- device_type (r)
24- Commands (w)
25 - clear and resetup nvs (w)
26 - restart device (w)
27- number of sensors (r)
28- number of power configurations (r)
29- Battery Status (r)
30 - Battery State (r)
31 - Battery Level (r)
32 - Battery Voltage (r)
33 - Battery Current (r)
34 - Battery Temperature (r)
35 - Battery Percentage (r)
36*/
37
38/* Define the UUIDs for the LORAWAN service */
39#define BT_UUID_DEVICE_VAL BT_UUID_128_ENCODE(0xf983f80d, 0x277a, 0x423a, 0xa122, 0xa37302ff7c90)
40#define BT_UUID_DEVICE_NAME_VAL BT_UUID_128_ENCODE(0xf983f80d, 0x277a, 0x423a, 0xa122, 0xa37302ff7c91)
41#define BT_UUID_DEVICE_HARDWARE_VERSION_VAL BT_UUID_128_ENCODE(0xf983f80d, 0x277a, 0x423a, 0xa122, 0xa37302ff7c92)
42#define BT_UUID_DEVICE_FIRMWARE_VERSION_VAL BT_UUID_128_ENCODE(0xf983f80d, 0x277a, 0x423a, 0xa122, 0xa37302ff7c93)
43#define BT_UUID_DEVICE_BATTERY_PERCENT_VAL BT_UUID_128_ENCODE(0xf983f80d, 0x277a, 0x423a, 0xa122, 0xa37302ff7c94)
44#define BT_UUID_DEVICE_BATTERY_VOLTAGE_VAL BT_UUID_128_ENCODE(0xf983f80d, 0x277a, 0x423a, 0xa122, 0xa37302ff7c95)
45#define BT_UUID_DEVICE_BATTERY_CURRENT_VAL BT_UUID_128_ENCODE(0xf983f80d, 0x277a, 0x423a, 0xa122, 0xa37302ff7c96)
46#define BT_UUID_DEVICE_BATTERY_TEMPERATURE_VAL BT_UUID_128_ENCODE(0xf983f80d, 0x277a, 0x423a, 0xa122, 0xa37302ff7c97)
47
48
49#define BT_UUID_DEVICE BT_UUID_DECLARE_128(BT_UUID_DEVICE_VAL)
50#define BT_UUID_DEVICE_NAME BT_UUID_DECLARE_128(BT_UUID_DEVICE_NAME_VAL)
51#define BT_UUID_DEVICE_HARDWARE_VERSION BT_UUID_DECLARE_128(BT_UUID_DEVICE_HARDWARE_VERSION_VAL)
52#define BT_UUID_DEVICE_FIRMWARE_VERSION BT_UUID_DECLARE_128(BT_UUID_DEVICE_FIRMWARE_VERSION_VAL)
53#define BT_UUID_DEVICE_BATTERY_PERCENT BT_UUID_DECLARE_128(BT_UUID_DEVICE_BATTERY_PERCENT_VAL)
54#define BT_UUID_DEVICE_BATTERY_VOLTAGE BT_UUID_DECLARE_128(BT_UUID_DEVICE_BATTERY_VOLTAGE_VAL)
55#define BT_UUID_DEVICE_BATTERY_CURRENT BT_UUID_DECLARE_128(BT_UUID_DEVICE_BATTERY_CURRENT_VAL)
56#define BT_UUID_DEVICE_BATTERY_TEMPERATURE BT_UUID_DECLARE_128(BT_UUID_DEVICE_BATTERY_TEMPERATURE_VAL)
57
58
66
67#endif
int ble_device_service_init(pmic_sensor_status_t *status)
Connect PMIC sensor status to Device BLE Service.
Definition ble_device_service.c:64
This is a library to keep track of the PMIC and its configuration.
Structure for the PMIC sensor status.
Definition sensor_pmic.h:23