notify format

This commit is contained in:
alan
2019-06-03 18:41:39 +08:00
parent 98aeea5f76
commit 6832bdfff6
2 changed files with 6 additions and 21 deletions
@@ -1062,21 +1062,7 @@ static void collect_data(uint8_t *buf) {
memcpy(not_buf + not_buf_offset, buf, 2);
not_buf_offset += 2;
}
static void collect_ADC_data(uint8_t *buf){
if (not_buf_offset >= BLE_DAT_BUFF_SIZE) {
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
}
// if(not_buf_offset == NOT_BUF_OFFSET_INIT){
// not_time_stamp = Timestamp_get32();
//
//
//
// }
memcpy(not_buf + not_buf_offset, buf, 2);
not_buf_offset += 2;
}
/*======================
==== main function ====
@@ -804,14 +804,7 @@ static void reset(){;
*
*
*/
static void SendNotify(){
for(int i=0 ; i<20 ; i++){
not_buf[i] = i;
}
for(int i=0 ; i<4 ; i++){
not_buf[i] = NotifyCurrent[i];
not_buf[i+4] = NotifyVolt[i];
@@ -827,6 +820,12 @@ static void SendNotify(){
not_buf[15] = (not_time_stamp >> 24) & 0xff;
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
for(int i=0 ; i<4 ; i++){
NotifyCurrent[i] = 0;
NotifyVolt[i] = 0;
NotifyImpedance[i] = 0;
}
}
#endif /* IMPEDANCE_METER_H_ */