From 631396c50e11bcbc2431e697deda191fa3a02bc7 Mon Sep 17 00:00:00 2001 From: YiChin Date: Thu, 30 Apr 2020 15:24:06 +0800 Subject: [PATCH] add InputNitify() --- .../cc26xx/app/headstage/EliteNotify.h | 31 +++++++++++++++++++ .../cc26xx/app/headstage/Elite_version.h | 4 +-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteNotify.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteNotify.h index bf759d20a..0997f6d75 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteNotify.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteNotify.h @@ -13,6 +13,11 @@ #define NOT_BUF_OFFSET_INIT 8 +/*notify's input type*/ +#define NOTIFY_CURRENT 0 +#define NOTIFY_VOLT 1 +#define NOTIFY_IMPEDANCE 2 + /** * the index where to start insert data into buffer. * start from 6. @@ -140,4 +145,30 @@ static void FlushNotify(){ SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf); } +static void InputNotify(int NotifyType, int32_t Data){ + + switch (NotifyType) { + case NOTIFY_CURRENT: + NotifyCurrent[0] = (uint8_t)((Data & 0xFF000000) >> 24); + NotifyCurrent[1] = (uint8_t)((Data & 0x00FF0000) >> 16); + NotifyCurrent[2] = (uint8_t)((Data & 0x0000FF00) >> 8); + NotifyCurrent[3] = (uint8_t)(Data & 0x000000FF); + break; + + case NOTIFY_IMPEDANCE: + NotifyImpedance[0] = (uint8_t)((Data & 0xFF000000) >> 24); + NotifyImpedance[1] = (uint8_t)((Data & 0x00FF0000) >> 16); + NotifyImpedance[2] = (uint8_t)((Data & 0x0000FF00) >> 8); + NotifyImpedance[3] = (uint8_t)(Data & 0x000000FF); + break; + + case NOTIFY_VOLT : + NotifyVolt[0] = (uint8_t)((Data & 0xFF000000) >> 24); + NotifyVolt[1] = (uint8_t)((Data & 0x00FF0000) >> 16); + NotifyVolt[2] = (uint8_t)((Data & 0x0000FF00) >> 8); + NotifyVolt[3] = (uint8_t)(Data & 0x000000FF); + break; + + } +} #endif diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h index cb44af717..2ecb5a922 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h @@ -5,8 +5,8 @@ #define VERSION_DATE_YEAR 20 #define VERSION_DATE_MONTH 4 #define VERSION_DATE_DAY 30 -#define VERSION_DATE_HOUR 17 -#define VERSION_DATE_MINUTE 17 +#define VERSION_DATE_HOUR 15 +#define VERSION_DATE_MINUTE 23 // this is NOT the version hash !! // it's the last version hash