Edson Alcala
/
StepTracking
Simple step tracking
Fork of ST by
Diff: ButtonService.h
- Revision:
- 7:eff79b4c37ab
- Parent:
- 5:2fbd60a970d6
- Child:
- 8:1bac78ab3acc
diff -r a400e1e47156 -r eff79b4c37ab ButtonService.h --- a/ButtonService.h Thu Oct 19 21:59:43 2017 +0000 +++ b/ButtonService.h Thu Oct 19 22:02:24 2017 +0000 @@ -86,27 +86,25 @@ gzValue = reinterpret_cast<uint8_t*>(&gz); //sensorValues = - int * result = new int[24]; + int * result = new int[16]; copy(rollValue, rollValue + 4, result); copy(pitchValue, pitchValue + 4, result + 4); - copy(yawValue, yawValue + 4, result + 8); + //copy(yawValue, yawValue + 4, result + 8); - copy(gxValue, gxValue + 4, result + 12); - copy(gyValue, gyValue + 4, result + 16); - copy(gzValue, gzValue + 4, result + 20); + //copy(gxValue, gxValue + 4, result + 12); + //copy(gyValue, gyValue + 4, result + 16); + //copy(gzValue, gzValue + 4, result + 20); - for(int i = 0; i < result.length; i++){ - - } + //union all arrays - ble.gattServer().write(buttonState.getValueHandle(), (uint8_t *)rollValue, sizeof(rollValue)); + ble.gattServer().write(buttonState.getValueHandle(), (uint8_t *)result, sizeof(result)); //ble.updateCharacteristicValue(buttonState.getValueHandle(), (uint8_t *)v ,sizeof(v)); } private: BLE &ble; - ReadOnlyArrayGattCharacteristic<uint8_t, sizeof(uint8_t[8])> buttonState; + ReadOnlyArrayGattCharacteristic<uint8_t, sizeof(uint8_t[16])> buttonState; }; #endif /* #ifndef __BLE_BUTTON_SERVICE_H__ */