I have been using BTool to turn on and off notifications for the accelerometer and I can see when it is adjusted. I began to use KeyFobDemo and HostTestApp and would like to make slight changes so that I no longer have to use BTool to change the values and instead would like to flash program the devices. My main goal is to track the values of the accelerometer.
I understand that I need to write a value of 0x01 to the proper handles and in order to turn on notifications:
static void accelEnable(void )
{
attWriteReq_t reqest;
request.len=2;
request.value[0] = ENABLED;
request.sig=0;
request.cmd=0;
request.handle = ENABLE_ACCEL_X;
GATT_WriteCharValue( CONNECTION_HANDLE, &request, simpleBLETaskId );
request.handle = ENABLE_ACCEL_Y;
GATT_WriteCharValue( CONNECTION_HANDLE, &request, simpleBLETaskId );
request.handle = ENABLE_ACCEL_Z;
GATT_WriteCharValue( CONNECTION_HANDLE, &request, simpleBLETaskId );
}
I believe the above function should do that.
However, I'm not sure where to apply this function. I assume I should flash this to the central device (USB Dongle). If this is the case, how would I then get the notifications from the accelerometer? I can't use GATT_ReadCharValue.
Any help would be much appreciated