flush notify buffer before start
This commit is contained in:
+23
@@ -109,4 +109,27 @@ static void SendNotify() {
|
||||
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
|
||||
}
|
||||
|
||||
static void FlushNotify(){
|
||||
not_buf[0] = INSTRUCTION.chip_id;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
not_buf[i + 1] = 0;
|
||||
not_buf[i + 5] = 0;
|
||||
not_buf[i + 9] = 0;
|
||||
}
|
||||
|
||||
// 1 Timestamp = 32 usec; 31 Timestamp ~= 1 msec
|
||||
not_time_stamp = 0; // msec
|
||||
|
||||
not_buf[13] = not_time_stamp & 0xff;
|
||||
not_buf[14] = (not_time_stamp >> 8) & 0xff;
|
||||
not_buf[15] = (not_time_stamp >> 16) & 0xff;
|
||||
not_buf[16] = (not_time_stamp >> 24) & 0xff;
|
||||
|
||||
// cyclic voltametry cycle number
|
||||
not_buf[17] = 0xFF;
|
||||
|
||||
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -1027,7 +1027,7 @@ static void update_ZM_instruction(uint8 *ins) {
|
||||
|
||||
case VIS_STI: {
|
||||
for(int i=0 ; i<12 ; i++){
|
||||
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
|
||||
FlushNotify();
|
||||
}
|
||||
PeriodicEvent = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user