add InputNitify()

This commit is contained in:
YiChin
2020-04-30 15:24:06 +08:00
parent d25103373e
commit 631396c50e
2 changed files with 33 additions and 2 deletions
@@ -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
@@ -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