Hello all,
I am switching from a BLE project to an ANT one, and cannot find an ANT equivalent for BLE_STACK_HANDLER_SCHED_EVT_SIZE, why is this? Presumably ANT still uses the scheduler (if desired)?
Regards, Richard.
Hello all,
I am switching from a BLE project to an ANT one, and cannot find an ANT equivalent for BLE_STACK_HANDLER_SCHED_EVT_SIZE, why is this? Presumably ANT still uses the scheduler (if desired)?
Regards, Richard.
I've also noticed that "SoftDevice Event Handler" section is absent from "SDK Common Libraries" for S210, even though in the S120 version, it clearly has application for ANT?
I'm not sure why the SoftDevice Handler Library and the SoftDevice Event Handler section is missing. I'm trying to find out. Seems like they are not used by any of the S210 examples. However, the S310 example \examples\multiprotocol\experimental_ble_ant_app_hrm from SDK 7.2.0 may be helpful to you. It is using the components\softdevice\common\softdevice_handler\ant_stack_handler_types.h
I've also noticed that the ANT examples don't seem to use the scheduler either?
I'll take a look at that "experimental" example, thanks.
The pure ANT examples don't use the SoftDevice Handler Library. I believe that is why it is not included in the documentation. I'm not sure when/if the pure ANT examples will be updated to use it, so I hope the S310 example is sufficient.
I can't see why you can't use the scheduler with ANT, we just don't have any examples using it.
However, you can find ANT_STACK_EVT_STRUCT_SIZE in components\softdevice\common\softdevice_handler\ant_stack_handler_types.h. This should be the ANT equivalent of BLE_STACK_HANDLER_SCHED_EVT_SIZE.
Edit 12.06.2015: What I said above about ANT_STACK_EVT_STRUCT_SIZE was incorrect. Sorry.
There is no ANT equivalent of BLE_STACK_HANDLER_SCHED_EVT_SIZE.
ANT_STACK_EVT_MSG_BUF_SIZE is equivalent of BLE_STACK_EVT_MSG_BUF_SIZE.
BLE_STACK_EVT_MSG_BUF_SIZE is used when sd_ble_evt_get() gets BLE events from the BLE stack.
ANT_STACK_EVT_MSG_BUF_SIZE is used when sd_ant_event_get() gets ANT events from the ANT stack.
BLE_STACK_HANDLER_SCHED_EVT_SIZE == 0 is actually correct. And if there existed a ANT_STACK_HANDLER_SCHED_EVT_SIZE it would also be 0.
The reason is that the events are not sent to the scheduler(so the size doesn't matter), only a handler is sent to the scheduler. The handler that you specify in softdevice_handler_init(). When the Application's BLE stacks event interrupt is called (SWI2_IRQHandler) the scheduler is notified. Then the scheduler can call intern_softdevice_events_execute(); where the events are fetched from the stack and handled.
Using the scheduler with ANT should be very similar to the way it is implemented in ble_app_hids_keyboard with BLE. You should be able to use the SoftDevice Handler Library with only ANT if you use the S310 example as a starting point. I know there is a problem when you remove BLE_STACK_SUPPORT_REQD from the preprocessor symbol. You will get this error: array is too large (1073741824 elements)". Please see this question.
Hope this clears things up, if not, please don't hesitate to ask. Again, sorry for the confusion.