notify format
This commit is contained in:
-14
@@ -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 ====
|
||||
|
||||
+6
-7
@@ -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_ */
|
||||
|
||||
Reference in New Issue
Block a user