Hi TI experts,
I did use timer to periodically launch a notification but I found out that the timer is not accurate thought, I set to 250ms and sometimes the interval was over 300ms, sometimes it was less than 200ms.
my code:
// How often (in ms) to read the velocomputer
#define VELOCOMPUTER_READ_PERIOD 250
// Setup timer for accelerometer task
osal_start_timerEx( velocomputerapp_TaskID, VELOCOMPUTER_READ_EVT, VELOCOMPUTER_READ_PERIOD );
} else {
// Stop the acceleromter
osal_stop_timerEx( velocomputerapp_TaskID, VELOCOMPUTER_READ_EVT);
// Restart timer
if (VELOCOMPUTER_READ_PERIOD)
osal_start_timerEx( velocomputerapp_TaskID, VELOCOMPUTER_READ_EVT, VELOCOMPUTER_READ_PERIOD );
// Read velocomputer data
veloComputerRead(); <<<<<<<< notification will be issued inside here
this is what i got from BTool,
[1] : <Tx> - 03:36:00.516
-Type : 0x01 (Command)
-Opcode : 0xFD12 (ATT_WriteReq)
-Data Length : 0x07 byte(s)
ConnHandle : 0x0000
Signature : 0x00 (No)
Command : 0x00 (No)
AttrHandle : 0x0034
AttrValue : 01
Dump(Tx):
01 12 FD 07 00 00 00 00 34 00 01
-----------------------------------------------------------------------------------------------
[2] : <Rx> - 03:36:00.579
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFD12 (ATT_WriteReq)
DataLength : 0x00
Dump(Rx):
04 FF 06 7F 06 00 12 FD 00
-----------------------------------------------------------------------------------------------
[3] : <Rx> - 03:36:00.854
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 bytes(s)
Event : 0x0513 (ATT_WriteRsp)
Status : 0x00 (Success)
ConnHandle : 0x0000
EventLen : 0x00
Dump(Rx):
04 FF 06 13 05 00 00 00 00
-----------------------------------------------------------------------------------------------
[4] : <Rx> - 03:36:00.953
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x0A bytes(s)
Event : 0x051B (ATT_HandleValueNotification)
Status : 0x00 (Success)
ConnHandle : 0x0000
EventLen : 0x04
AttrHandle : 0x003A
Value : 4A 04
Dump(Rx):
04 FF 0A 1B 05 00 00 00 04 3A 00 4A 04
-----------------------------------------------------------------------------------------------
[5] : <Rx> - 03:36:01.254 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x0A bytes(s)
Event : 0x051B (ATT_HandleValueNotification)
Status : 0x00 (Success)
ConnHandle : 0x0000
EventLen : 0x04
AttrHandle : 0x003A
Value : 50 E4
Dump(Rx):
04 FF 0A 1B 05 00 00 00 04 3A 00 50 E4
-----------------------------------------------------------------------------------------------
[6] : <Rx> - 03:36:01.452 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< only 198ms!
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x0A bytes(s)
Event : 0x051B (ATT_HandleValueNotification)
Status : 0x00 (Success)
ConnHandle : 0x0000
EventLen : 0x04
AttrHandle : 0x003A
Value : 56 24
Dump(Rx):
04 FF 0A 1B 05 00 00 00 04 3A 00 56 24
-----------------------------------------------------------------------------------------------
[7] : <Rx> - 03:36:01.759 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x0A bytes(s)
Event : 0x051B (ATT_HandleValueNotification)
Status : 0x00 (Success)
ConnHandle : 0x0000
EventLen : 0x04
AttrHandle : 0x003A
Value : 5C 04
Dump(Rx):
04 FF 0A 1B 05 00 00 00 04 3A 00 5C 04
-----------------------------------------------------------------------------------------------
[8] : <Rx> - 03:36:01.958 <<<<<<<<<<<<<<< only 199ms here!
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x0A bytes(s)
Event : 0x051B (ATT_HandleValueNotification)
Status : 0x00 (Success)
ConnHandle : 0x0000
EventLen : 0x04
AttrHandle : 0x003A
Value : 62 44
Dump(Rx):
04 FF 0A 1B 05 00 00 00 04 3A 00 62 44