![]() |
BSB Developer Docs
|
Available ble commands definition and common methods. More...
Go to the source code of this file.
Data Structures | |
| struct | BleCommandItem |
| Struct for one command handlers. More... | |
Typedefs | |
| typedef bool(* | BleCommandHandler) (BleIntercomFrameGeneric *frame, void *context) |
| Command handler callback function type. | |
Enumerations | |
| enum | BleSystemCommand { BleCommandUnknown , BleCommandInit , BleCommandDeinit , BleCommandEnable , BleCommandDisable , BleCommandGetStatus , BleCommandSetStatus , BleCommandForgetPairing , BleCommandCount } |
| Enumeration of possible ble commands. More... | |
Functions | |
| bool | ble_command_request_process (BleIntercomFrameGeneric *frame, void *context) |
| Send frame as a request to another side. | |
| bool | ble_command_response_process (BleIntercomFrameGeneric *frame, void *context) |
| Send frame as a response to another side. | |
| bool | ble_command_deinit_process (BleIntercomFrameGeneric *frame, void *context) |
| Deinit all ble services in case of an error. | |
Variables | |
| const BleCommandItem | ble_commands [] |
| Array with command handlers. | |
Available ble commands definition and common methods.
| typedef bool(* BleCommandHandler) (BleIntercomFrameGeneric *frame, void *context) |
Command handler callback function type.
| [in] | frame | Pointer to frame |
| [in] | context | Execution context |
| enum BleSystemCommand |
Enumeration of possible ble commands.
Some commands are used internally, others by public api. In general almost all commands are processed as request/response pair. If one side sends command as a request then other side performs command and sends back a response with a result.
| Enumerator | |
|---|---|
| BleCommandInit | Internal command used to init ble at device startup, sends automatically when all requirements are met. |
| BleCommandDeinit | Internal command used to deinit ble if some serious failures occurred. |
| BleCommandEnable | Enable ble. After this command device becomes visible for all scanning devices or for paired one only. Used in ble_start |
| BleCommandDisable | Disable ble. Used by ble_stop |
| BleCommandGetStatus | Get ble status. Used by ble_get_state |
| BleCommandSetStatus | Internal command, used to update status from SiWG917 to U5. |
| BleCommandForgetPairing | Forget currently paired remote device. Used by ble_forget |
| BleCommandCount | Commands count. |
| bool ble_command_deinit_process | ( | BleIntercomFrameGeneric * | frame, |
| void * | context ) |
Deinit all ble services in case of an error.
This function contains common logic for BleCommandDeinit shared by both sides and is called when some serious error happened and there is a need to shut down all internal ble services.
| [in] | frame | pointer to frame to be sent |
| [in] | context | for frame processing |
| bool ble_command_request_process | ( | BleIntercomFrameGeneric * | frame, |
| void * | context ) |
Send frame as a request to another side.
| [in] | frame | pointer to frame to be sent |
| [in] | context | for frame processing |
| bool ble_command_response_process | ( | BleIntercomFrameGeneric * | frame, |
| void * | context ) |
Send frame as a response to another side.
| [in] | frame | pointer to frame to be sent |
| [in] | context | for frame processing |
|
extern |
Array with command handlers.
Each side has its own command handlers implementation which are placed in ble_system_command_u5.c for U5 and and ble_system_command_917.c for 917. This array is used for command engine initialization