2

I am developing an Android app that gets data from Movesense using the GATT profile from the sample app GATT Sensor Data App here. I followed the tutorial available here. Building the app and getting the DFU worked fine. I can get IMU, HR and temperature data with no issues.

Now I'd like add a tap detection feature to my app. I understand that I have to subscribe to 'System/States', but first I need to be able to receive the system state data. I understand that I need a modified DFU for that, but I don't understand what changes I should make in which files of the gatt_sensordata_app before rebuilding and generating the new DFU.

What changes should I make in order to broadcast /System/State data?

(I usually just deal with Android so apologies for the very basic question.)

I tried adding #include "system_states/resources.h" to GATTSensorDataClient.cpp but I don't know how to continue.

1 Answers1

1

The normal data straming in the gatt_sensordata_app uses the sbem-encoding code that the build process generates when building the firmware. However /System/States is not among the paths that the code can serialize. Therefore the only possibility is to implement the States-support to the firmware.

Easiest way is to do as follows:

  1. In your python app call data subscription with "/System/States/3" (3 == DOUBLE_TAP)
  2. Add a special case to the switch in onNotify which matches the localResourceId to the WB_RES::LOCAL::SYSTEM_STATES_STATEID::LID
  3. In that handler, return the data the way you want. Easiest is to copy paste the "default" handler but replace the code between getSbemLength() & writeToSbemBuffer(...) calls with your own serialization code

Full disclosure: I work for the Movesense team

PetriL
  • 1,211
  • 1
  • 7
  • 11