This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE_STACK_HANDLER_SCHED_EVT_SIZE - no ANT equivalent?

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.

Parents
  • 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.

Reply
  • 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.

Children
Related