|
SmartSnippets DA1459x SDK
|
BLE Manager API. More...
Files | |
| file | ble_mgr.h |
| BLE Manager API. | |
Data Structures | |
| struct | ble_dev_params_tag |
| struct | ble_mgr_interface_t |
Typedefs | |
| typedef struct ble_dev_params_tag | ble_dev_params_t |
| typedef enum ble_stack_msg_types | ble_stack_msg_type_t |
Enumerations | |
| enum | ble_stack_msg_types |
Functions | |
| void | ble_mgr_init (void) |
| Initialize BLE Manager - create command and event queues. More... | |
| OS_BASE_TYPE | ble_mgr_command_queue_send (const void *item, OS_TICK_TIME wait_ticks) |
| Send a message to the BLE Manager's command queue. More... | |
| OS_BASE_TYPE | ble_mgr_event_queue_send (const void *item, OS_TICK_TIME wait_ticks) |
| Send a message to the BLE Manager's event queue. More... | |
| void | ble_mgr_event_queue_flush (void) |
| Flush BLE Manager's event queue. More... | |
| OS_BASE_TYPE | ble_mgr_event_queue_get (void *item, OS_TICK_TIME wait_ticks) |
| Get message from BLE Manager's event queue. More... | |
| OS_BASE_TYPE | ble_mgr_event_queue_peek (void *item, OS_TICK_TIME wait_ticks) |
| Peek message from BLE Manager's event queue. More... | |
| OS_BASE_TYPE | ble_mgr_command_queue_send_from_isr (const void *item) |
| Send a message to the BLE Manager's command queue from an ISR. More... | |
| const ble_mgr_interface_t * | ble_mgr_get_interface (void) |
| Get BLE Manager interface structure. More... | |
| void | ble_mgr_register_application (OS_TASK task) |
| Register application in BLE Manager. More... | |
| OS_BASE_TYPE | ble_mgr_response_queue_send (const void *item, OS_TICK_TIME wait_ticks) |
| Send message to BLE Manager's response queue. More... | |
| OS_BASE_TYPE | ble_mgr_response_queue_get (void *item, OS_TICK_TIME wait_ticks) |
| Get message from BLE Manager's response queue. More... | |
| void | ble_mgr_notify_app_task (uint32_t notif_value) |
| Send a task notification to the application task registered to the BLE Manager. More... | |
| ble_dev_params_t * | ble_mgr_dev_params_acquire (void) |
| Get a pointer to the BLE device parameters structure. More... | |
| void | ble_mgr_dev_params_release (void) |
| Release the BLE device parameters. More... | |
| void | ble_mgr_acquire (void) |
| Acquire the BLE manager interface. More... | |
| void | ble_mgr_release (void) |
| Release the BLE manager interface. More... | |
| void | ble_mgr_waitqueue_acquire (void) |
| Acquire the BLE manager waitqueue. More... | |
| void | ble_mgr_waitqueue_release (void) |
| Release the BLE manager waitqueue. More... | |
| bool | ble_mgr_is_own_task (void) |
| Checks if current task is BLE Manager task. More... | |
| void | ble_mgr_dev_params_set_default (void) |
| Set default dev_params. More... | |
| void | ble_mgr_notify_commit_storage (void) |
| Notifies BLE manager to commit storage changes, if any. More... | |
| void | ble_mgr_notify_adapter_blocked (bool status) |
| Notifies BLE manager that BLE adapter is blocked or unblocked on its event queue. More... | |
| void | ble_mgr_notify_event_consumed (void) |
| Notifies BLE manager that posted event was consumed. More... | |
| bool | ble_mgr_adapter_is_blocked (void) |
| Returns current adapter status (blocked or not) More... | |
| ble_status_t | ble_mgr_get_status (void) |
| Get the status of BLE. More... | |
| void | ble_mgr_set_status (ble_status_t status) |
| Set BLE status. More... | |
BLE Manager API.
| typedef struct ble_dev_params_tag ble_dev_params_t |
BLE device parameters
| typedef enum ble_stack_msg_types ble_stack_msg_type_t |
Types of stack API messages
| enum ble_stack_msg_types |
Types of stack API messages
| void ble_mgr_acquire | ( | void | ) |
Acquire the BLE manager interface.
Acquires a mutex that guards the BLE manager interface (command and response queues) so that only one task can use the BLE API at a given moment.
| bool ble_mgr_adapter_is_blocked | ( | void | ) |
Returns current adapter status (blocked or not)
| OS_BASE_TYPE ble_mgr_command_queue_send | ( | const void * | item, |
| OS_TICK_TIME | wait_ticks | ||
| ) |
Send a message to the BLE Manager's command queue.
Sends a message to the BLE Manager's command queue and notifies BLE Manager task
| [in] | item | Pointer to the item to be sent to the queue. |
| [in] | wait_ticks | Max time in ticks to wait for space in queue. |
| OS_BASE_TYPE ble_mgr_command_queue_send_from_isr | ( | const void * | item | ) |
Send a message to the BLE Manager's command queue from an ISR.
Sends a message to the BLE Manager's command queue
| [in] | item | Pointer to the item to be sent to the queue. |
| ble_dev_params_t* ble_mgr_dev_params_acquire | ( | void | ) |
Get a pointer to the BLE device parameters structure.
| void ble_mgr_dev_params_release | ( | void | ) |
Release the BLE device parameters.
Releases the structure that holds the BLE device parameters, previously acquired using ble_mgr_dev_params_acquire().
| void ble_mgr_dev_params_set_default | ( | void | ) |
Set default dev_params.
Function set default dev_params
| void ble_mgr_event_queue_flush | ( | void | ) |
Flush BLE Manager's event queue.
Remove all events currently on BLE Manager's event queue and free corresponding event buffers.
| OS_BASE_TYPE ble_mgr_event_queue_get | ( | void * | item, |
| OS_TICK_TIME | wait_ticks | ||
| ) |
Get message from BLE Manager's event queue.
| [out] | item | Event buffer to receive data |
| [in] | wait_ticks | time to wait |
| OS_BASE_TYPE ble_mgr_event_queue_peek | ( | void * | item, |
| OS_TICK_TIME | wait_ticks | ||
| ) |
Peek message from BLE Manager's event queue.
Message is not removed from queue, it will be returned by subsequent call to ble_mgr_event_queue_get().
| [out] | item | Event buffer to receive data |
| [in] | wait_ticks | time to wait |
| OS_BASE_TYPE ble_mgr_event_queue_send | ( | const void * | item, |
| OS_TICK_TIME | wait_ticks | ||
| ) |
Send a message to the BLE Manager's event queue.
Sends a message to the BLE Manager's event queue and notifies application task, if any registered.
| [in] | item | Pointer to the item to be sent to the queue. |
| [in] | wait_ticks | Max time in ticks to wait for space in queue. |
| const ble_mgr_interface_t* ble_mgr_get_interface | ( | void | ) |
Get BLE Manager interface structure.
| ble_status_t ble_mgr_get_status | ( | void | ) |
Get the status of BLE.
This function returns the status of BLE.
| void ble_mgr_init | ( | void | ) |
Initialize BLE Manager - create command and event queues.
Function declarations
| bool ble_mgr_is_own_task | ( | void | ) |
Checks if current task is BLE Manager task.
| void ble_mgr_notify_adapter_blocked | ( | bool | status | ) |
Notifies BLE manager that BLE adapter is blocked or unblocked on its event queue.
BLE adapter uses this function to indicate it has blocked on a full event queue (if status is true) or that it has just been unblocked (if status is false).
| [in] | status | true to indicate the adapter has just blocked, false to indicate the adapter just unblocked. |
| void ble_mgr_notify_app_task | ( | uint32_t | notif_value | ) |
Send a task notification to the application task registered to the BLE Manager.
| [in] | notif_value | The notification value (as a 32-bit bitfield) |
| void ble_mgr_notify_commit_storage | ( | void | ) |
Notifies BLE manager to commit storage changes, if any.
| void ble_mgr_notify_event_consumed | ( | void | ) |
Notifies BLE manager that posted event was consumed.
| void ble_mgr_register_application | ( | OS_TASK | task | ) |
Register application in BLE Manager.
This can be called only once as there can be only single application registered right now.
| [in] | task | task handle of application to register |
| void ble_mgr_release | ( | void | ) |
Release the BLE manager interface.
Releases the mutex acquired using ble_mgr_acquire().
| OS_BASE_TYPE ble_mgr_response_queue_get | ( | void * | item, |
| OS_TICK_TIME | wait_ticks | ||
| ) |
Get message from BLE Manager's response queue.
| [out] | item | Message buffer to receive data |
| [in] | wait_ticks | time to wait |
| OS_BASE_TYPE ble_mgr_response_queue_send | ( | const void * | item, |
| OS_TICK_TIME | wait_ticks | ||
| ) |
Send message to BLE Manager's response queue.
| [in] | item | Message to send to queue |
| [in] | wait_ticks | time to wait |
| void ble_mgr_set_status | ( | ble_status_t | status | ) |
Set BLE status.
Set BLE in a specific status.
| [in] | status | The status to be set |
| void ble_mgr_waitqueue_acquire | ( | void | ) |
Acquire the BLE manager waitqueue.
Acquires the mutex that guards the BLE manager waitqueue so that only one task can modify it at a given moment.
| void ble_mgr_waitqueue_release | ( | void | ) |
Release the BLE manager waitqueue.
Releases the mutex acquired using ble_mgr_waitqueue_acquire().
1.8.16