1
0
forked from me/IronOS

rough status handler done

This commit is contained in:
Ben V. Brown
2022-11-20 18:04:45 +11:00
parent e88c064390
commit 36b60e250d
3 changed files with 9 additions and 9 deletions

View File

@@ -25,9 +25,9 @@
#include "power.hpp"
/*************************************************************************
NAME
ble_char_read_callback
ble_char_read_status_callback
*/
int ble_char_read_callback(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, u16_t len, u16_t offset) {
int ble_char_read_status_callback(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, u16_t len, u16_t offset) {
if (attr == NULL || attr->uuid == NULL) {
return 0;
}

View File

@@ -7,7 +7,7 @@
extern "C" {
#endif
int ble_char_read_callback(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, u16_t len, u16_t offset);
int ble_char_read_status_callback(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, u16_t len, u16_t offset);
int ble_tp_recv_wr(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, u16_t len, u16_t offset, u8_t flags);
#ifdef __cplusplus

View File

@@ -145,12 +145,12 @@ static void ble_tp_ind_ccc_changed(const struct bt_gatt_attr *attr, u16_t value)
static struct bt_gatt_attr attrs[] = {
BT_GATT_PRIMARY_SERVICE(BT_UUID_SVC_LIVE_DATA),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_LIVE_TEMP, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_SETPOINT_TEMP, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_DC_INPUT, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_HANDLE_TEMP, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_POWER_LEVEL, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_POWER_SRC, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_LIVE_TEMP, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_status_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_SETPOINT_TEMP, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_status_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_DC_INPUT, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_status_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_HANDLE_TEMP, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_status_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_POWER_LEVEL, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_status_callback, NULL, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_POWER_SRC, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_status_callback, NULL, NULL),
BT_GATT_PRIMARY_SERVICE(BT_UUID_SVC_SETTINGS_DATA),
};