fortunately the weight measurement characteristic includes a timestamp.
unfortunately it's not clear how to implement this using the bluefruit .notify method.
Code: Select all
if(wmc.notifyEnabled()){
while(!bufferEmpty()){
notification = fifoRead();
Serial.printf("buffer length: %u \n", bufferLength());
if ( wmc.notify(notification, sizeof(notification)) ){
Serial.println("Weight Measurement updated");
}else{
Serial.println("ERROR: Notify not set in the CCCD or not connected!");
}
};
Code: Select all
uint8_t package[6] = {0b00000010,highByte(weight),lowByte(weight),0,0,0};
fifoWrite(package); //write values to the buffer
Currently I'm building the package out of a group of bytes but it's not clear how the timestamp would fit into there since it contains multiple fields.
https://github.com/philngo/ble-mathemat ... e_time.xml