BM application mode definitions.
Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.
#include "platform_files.h"
#include "bm_utils.h"
#include "bm_mode.h"
#include "bm_application_mode.h"
#include "event_mem.h"
#include "ble_api.h"
Functions | |
void | BM_APPLICATION_ADCReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t adcChannel) |
void | BM_APPLICATION_AdvertisementDataWritePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *advertisementData, uint8_t advertisementLength, BM_ADV_TYPE_STORE store) |
void | BM_APPLICATION_AdvertisementEnableSetPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t advertisementMode) |
void | BM_APPLICATION_AdvertisementParameterSetPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *advertisementParameter) |
void | BM_APPLICATION_AdvReportEventParser (void *data, uint32_t *dataLen) |
Parse a advertisement report event ble_adv_report_event_t. More... | |
void | BM_APPLICATION_ClientAllServicesDiscoverPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle) |
void | BM_APPLICATION_ClientBlobRequestReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint16_t characteristicHandle, uint16_t valueOffset) |
void | BM_APPLICATION_ClientCharacteristicHandleReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint16_t characteriticHandle) |
void | BM_APPLICATION_ClientCharacteristicHandleWritePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint16_t characteristicHandle, uint8_t writeType, uint8_t *characteriticValue, uint8_t characteriticValueLength) |
void | BM_APPLICATION_ClientCharacteristicsDiscoverPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t *serviceUUID, uint8_t serviceUUIDLength) |
void | BM_APPLICATION_ClientCharacteristicUUIDReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t *characteriticUUID, uint8_t characteriticUUIDLength) |
void | BM_APPLICATION_ClientHandleValueConfirmPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle) |
void | BM_APPLICATION_ClientWriteRequestExecutePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t writeType, uint8_t flag) |
void | BM_APPLICATION_ClientWriteRequestPreparePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint16_t characteristicHandle, uint8_t writeType, uint16_t valueOffset, uint8_t *characteriticValue, uint8_t characteriticValueLength) |
static void | BM_APPLICATION_CmdPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, BM_APPLICATION_CMD *applicationCmd, uint8_t *data) |
void | BM_APPLICATION_ConfigureModeClosePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, bool store) |
void | BM_APPLICATION_ConnCompleteEventParser (void *data, uint32_t *dataLen) |
Parse a connection complete event ble_conn_complete_event_t. More... | |
void | BM_APPLICATION_ConnectDeviceCancelPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt) |
void | BM_APPLICATION_ConnectDevicePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *peerAddress, uint8_t peerAddressType, uint8_t filterPolicy) |
void | BM_APPLICATION_ConnectionParameterUpdatePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint16_t connectionInterval, uint16_t connectionLatency, uint16_t supervisionTimeout) |
void | BM_APPLICATION_ConnParameterSetPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint16_t min_conn_interval, uint16_t max_conn_interval, uint16_t slave_latency, uint16_t so_timeout) |
void | BM_APPLICATION_ConnParamUpdateEventParser (void *data, uint32_t *dataLen) |
Parse a connection parameter update event ble_conn_param_update_event_t. More... | |
void | BM_APPLICATION_DebugPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t debugOpcode, uint8_t *debugParams, uint8_t debugLength) |
void | BM_APPLICATION_DeInit () |
void | BM_APPLICATION_DeviceNameReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt) |
void | BM_APPLICATION_DeviceNameWritePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *deviceName, uint8_t deviceNameLength) |
void | BM_APPLICATION_DIOControlPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *dioControl) |
void | BM_APPLICATION_DisconnectDevicePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle) |
void | BM_APPLICATION_EnableTransparentUartSetPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t serverControl, uint8_t clientMode) |
void | BM_Application_EventParser (BM_APPLICATION_EVENT_OPCODE event_id, void *data, uint32_t *dataLen) |
Parse received events ble_conn_complete_event_t. More... | |
BM_APPLICATION_CMDPKT * | BM_APPLICATION_Init () |
Initializes application mode configuration library. More... | |
void | BM_APPLICATION_LeEndTestResultEventParser (void *data, uint32_t *dataLen) |
Parse a LE end test result event ble_end_test_result_event_t. More... | |
void | BM_APPLICATION_LocalInformationReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt) |
Builds an application mode command packet which reads local information in configure mode. More... | |
void | BM_APPLICATION_PairDeviceDeletePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t deviceIndex) |
Builds an application mode command packet to delete paired device by index in configure mode. More... | |
void | BM_APPLICATION_PairDeviceListErasePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt) |
Builds an application mode command packet to erase paired device list (PDL) in configure mode. More... | |
void | BM_APPLICATION_PairDeviceListReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt) |
Builds an application mode command packet to read paired device list in configure mode. More... | |
void | BM_APPLICATION_PairModeReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt) |
Builds an application mode command packet to read pairing mode in configure mode. More... | |
void | BM_APPLICATION_PairModeWritePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, BM_PAIR_MODE pairMode) |
void | BM_APPLICATION_PairPassKeyClearPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle) |
void | BM_APPLICATION_PairPassKeyDigitEnterPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t passkeyDigit) |
void | BM_APPLICATION_PairPassKeyDigitErasePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle) |
void | BM_APPLICATION_PairPassKeyEntryCompletePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle) |
void | BM_APPLICATION_PairRequest (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle) |
void | BM_APPLICATION_PairYesNoConfirmPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, bool confirm) |
void | BM_APPLICATION_PatternSetPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t pattern) |
void | BM_APPLICATION_PWMControlPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *pwmControl) |
void | BM_APPLICATION_RemoteDeviceNameReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle) |
void | BM_APPLICATION_ResetPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt) |
static bool | BM_APPLICATION_Response (void) |
bool | BM_APPLICATION_ResponseCheck (uint8_t *data, uint8_t len) |
De-initializes Application mode configuration library. More... | |
void | BM_APPLICATION_RSSIReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle) |
void | BM_APPLICATION_ScanDataWritePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *scanData, uint8_t scanLength, bool store) |
void | BM_APPLICATION_ScanEnableSetPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t scanEnable, uint8_t filterPolicy) |
void | BM_APPLICATION_ScanParameterSetPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint16_t scanInterval, uint16_t scanWindow, uint8_t scanType) |
void | BM_APPLICATION_SendTransparentDataPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t *data, uint8_t datalen) |
void | BM_APPLICATION_ServerBlobResponseReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t responseOpcode, uint8_t *characteriticValue, uint8_t characteriticValueLength) |
void | BM_APPLICATION_ServerCharacteristicReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint16_t characteriticHandle) |
void | BM_APPLICATION_ServerCharacteristicSendPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint16_t characteriticHandle, uint8_t *characteriticValue, uint8_t characteriticValueLength) |
void | BM_APPLICATION_ServerCharacteristicUpdatePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint16_t characteriticHandle, uint8_t *characteriticValue, uint8_t characteriticValueLength) |
void | BM_APPLICATION_ServerCreateService (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *service, uint16_t length, uint8_t num_of_attrib) |
void | BM_APPLICATION_ServerErrorResponsePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t requestOpcode, uint16_t characteristicHandle, uint8_t errorCode) |
void | BM_APPLICATION_ServerPrimaryServiceReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *serviceUUID, uint8_t serviceUUIDLength) |
void | BM_APPLICATION_ServerPrimaryServicesReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt) |
void | BM_APPLICATION_ServerReadResponseSendPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t responseType, uint8_t *characteriticValue, uint8_t characteriticValueLength) |
void | BM_APPLICATION_ServerReadService (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *service_uuid_16) |
void | BM_APPLICATION_ServerWriteExecutePreparePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t writeType) |
void | BM_APPLICATION_ServerWriteResponsePreparePkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint16_t characteristicHandle, uint8_t writeType, uint16_t valueOffset, uint8_t *characteriticValue, uint8_t characteriticValueLength) |
void | BM_APPLICATION_ServerWriteResponseSendPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t connectionHandle, uint8_t requestOpcode, uint16_t attributeHandle, uint8_t errorCode) |
void | BM_APPLICATION_ShutdownPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt) |
void | BM_APPLICATION_StatusReadPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt) |
void | BM_APPLICATION_WriteCharValueEventParser (void *data, uint32_t *dataLen) |
Parse a Client write characteristic value event ble_write_char_value_event_t. More... | |
Variables | |
uint8_t | appByteTimeout = 0 |
BM_APPLICATION_CMDPKT | appCmdPkt = {0, appDataCmdPkt} |
static BM_APPLICATION_CMD * | appCmds |
static BM_APPLICATION_CMD_STATE | appCmdState = BM_CFG_CMD_SOF |
uint8_t | appDataCmdPkt [BM_PKT_LEN_MAX] |
static uint16_t | appDataIndex = 0 |
event_t | appEvent = {0} |
uint8_t | appRspData [BM_PKT_LEN_MAX] |
static const BM_APPLICATION_CMD | bm70ApplicationCmds [] |
void BM_APPLICATION_ADCReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | adcChannel | ||
) |
References BM_ADC_READ_INDEX, BM_APPLICATION_CmdPkt(), and BM_APPLICATION_MODE_CMD.
void BM_APPLICATION_AdvertisementDataWritePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t * | advertisementData, | ||
uint8_t | advertisementLength, | ||
BM_ADV_TYPE_STORE | store | ||
) |
References BM_ADV_DATA_WRITE_INDEX, BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, and _bm_application_cmd::length.
Referenced by ble_adv_data_set().
void BM_APPLICATION_AdvertisementEnableSetPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | advertisementMode | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_SET_ADV_ENABLE_INDEX.
Referenced by ble_adv_start(), and ble_adv_stop().
void BM_APPLICATION_AdvertisementParameterSetPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t * | advertisementParameter | ||
) |
References BM_ADV_PARAM_SET_INDEX, BM_APPLICATION_CmdPkt(), and BM_APPLICATION_MODE_CMD.
Referenced by ble_adv_param_set().
void BM_APPLICATION_AdvReportEventParser | ( | void * | data, |
uint32_t * | dataLen | ||
) |
Parse a advertisement report event ble_adv_report_event_t.
data | event data. |
dataLen | length of the data. |
References PACKED::addr, PACKED::adv_event_type, ADV_REPORT_ADDRESS_LEN, ADV_REPORT_ADDRESS_TYPE_LEN, ADV_REPORT_ADDRESS_TYPE_START, ADV_REPORT_DATA_LENGTH_START, ADV_REPORT_DATA_START, ADV_REPORT_EVENT_TYPE_START, PACKED::data, PACKED::data_len, and PACKED::rssi.
Referenced by BM_Application_EventParser().
void BM_APPLICATION_ClientAllServicesDiscoverPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_CLIENT_DISCOVER_ALL_SERVICES_INDEX.
Referenced by ble_primary_service_discover_all().
void BM_APPLICATION_ClientBlobRequestReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint16_t | characteristicHandle, | ||
uint16_t | valueOffset | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, and BM_CLIENT_BLOB_REQUEST_READ_INDEX.
Referenced by ble_characteristic_attribute_read_request().
void BM_APPLICATION_ClientCharacteristicHandleReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint16_t | characteriticHandle | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, and BM_CLIENT_CHARACTERISTIC_READ_INDEX.
Referenced by ble_characteristic_read().
void BM_APPLICATION_ClientCharacteristicHandleWritePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint16_t | characteristicHandle, | ||
uint8_t | writeType, | ||
uint8_t * | characteriticValue, | ||
uint8_t | characteriticValueLength | ||
) |
void BM_APPLICATION_ClientCharacteristicsDiscoverPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t * | serviceUUID, | ||
uint8_t | serviceUUIDLength | ||
) |
void BM_APPLICATION_ClientCharacteristicUUIDReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t * | characteriticUUID, | ||
uint8_t | characteriticUUIDLength | ||
) |
void BM_APPLICATION_ClientHandleValueConfirmPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle | ||
) |
void BM_APPLICATION_ClientWriteRequestExecutePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t | writeType, | ||
uint8_t | flag | ||
) |
void BM_APPLICATION_ClientWriteRequestPreparePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint16_t | characteristicHandle, | ||
uint8_t | writeType, | ||
uint16_t | valueOffset, | ||
uint8_t * | characteriticValue, | ||
uint8_t | characteriticValueLength | ||
) |
|
static |
References calc_chksum_8bit(), _bm_application_cmd::length, NULL, and _bm_application_cmd::opcode.
Referenced by BM_APPLICATION_ADCReadPkt(), BM_APPLICATION_AdvertisementDataWritePkt(), BM_APPLICATION_AdvertisementEnableSetPkt(), BM_APPLICATION_AdvertisementParameterSetPkt(), BM_APPLICATION_ClientAllServicesDiscoverPkt(), BM_APPLICATION_ClientBlobRequestReadPkt(), BM_APPLICATION_ClientCharacteristicHandleReadPkt(), BM_APPLICATION_ClientCharacteristicHandleWritePkt(), BM_APPLICATION_ClientCharacteristicsDiscoverPkt(), BM_APPLICATION_ClientCharacteristicUUIDReadPkt(), BM_APPLICATION_ClientHandleValueConfirmPkt(), BM_APPLICATION_ClientWriteRequestExecutePkt(), BM_APPLICATION_ClientWriteRequestPreparePkt(), BM_APPLICATION_ConfigureModeClosePkt(), BM_APPLICATION_ConnectDeviceCancelPkt(), BM_APPLICATION_ConnectDevicePkt(), BM_APPLICATION_ConnectionParameterUpdatePkt(), BM_APPLICATION_ConnParameterSetPkt(), BM_APPLICATION_DebugPkt(), BM_APPLICATION_DeviceNameReadPkt(), BM_APPLICATION_DeviceNameWritePkt(), BM_APPLICATION_DIOControlPkt(), BM_APPLICATION_DisconnectDevicePkt(), BM_APPLICATION_EnableTransparentUartSetPkt(), BM_APPLICATION_LocalInformationReadPkt(), BM_APPLICATION_PairDeviceDeletePkt(), BM_APPLICATION_PairDeviceListErasePkt(), BM_APPLICATION_PairDeviceListReadPkt(), BM_APPLICATION_PairModeReadPkt(), BM_APPLICATION_PairModeWritePkt(), BM_APPLICATION_PairPassKeyClearPkt(), BM_APPLICATION_PairPassKeyDigitEnterPkt(), BM_APPLICATION_PairPassKeyDigitErasePkt(), BM_APPLICATION_PairPassKeyEntryCompletePkt(), BM_APPLICATION_PairRequest(), BM_APPLICATION_PairYesNoConfirmPkt(), BM_APPLICATION_PatternSetPkt(), BM_APPLICATION_PWMControlPkt(), BM_APPLICATION_RemoteDeviceNameReadPkt(), BM_APPLICATION_ResetPkt(), BM_APPLICATION_RSSIReadPkt(), BM_APPLICATION_ScanDataWritePkt(), BM_APPLICATION_ScanEnableSetPkt(), BM_APPLICATION_ScanParameterSetPkt(), BM_APPLICATION_SendTransparentDataPkt(), BM_APPLICATION_ServerBlobResponseReadPkt(), BM_APPLICATION_ServerCharacteristicReadPkt(), BM_APPLICATION_ServerCharacteristicSendPkt(), BM_APPLICATION_ServerCharacteristicUpdatePkt(), BM_APPLICATION_ServerCreateService(), BM_APPLICATION_ServerErrorResponsePkt(), BM_APPLICATION_ServerPrimaryServiceReadPkt(), BM_APPLICATION_ServerPrimaryServicesReadPkt(), BM_APPLICATION_ServerReadResponseSendPkt(), BM_APPLICATION_ServerReadService(), BM_APPLICATION_ServerWriteExecutePreparePkt(), BM_APPLICATION_ServerWriteResponsePreparePkt(), BM_APPLICATION_ServerWriteResponseSendPkt(), BM_APPLICATION_ShutdownPkt(), and BM_APPLICATION_StatusReadPkt().
void BM_APPLICATION_ConfigureModeClosePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
bool | store | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_CONFIG_MODE_CLOSE_INDEX.
void BM_APPLICATION_ConnCompleteEventParser | ( | void * | data, |
uint32_t * | dataLen | ||
) |
Parse a connection complete event ble_conn_complete_event_t.
data | event data. |
dataLen | length of the data. |
References PACKED::conn_interval, PACKED::conn_latency, PACKED::conn_param, PACKED::link_sv_to, and memcpy_inplace_reorder().
Referenced by BM_Application_EventParser().
void BM_APPLICATION_ConnectDeviceCancelPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt | ) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_CONNECT_CANCEL_INDEX, and NULL.
Referenced by ble_cancel_connection().
void BM_APPLICATION_ConnectDevicePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t * | peerAddress, | ||
uint8_t | peerAddressType, | ||
uint8_t | filterPolicy | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, and BM_CONNECT_INDEX.
Referenced by ble_create_connection().
void BM_APPLICATION_ConnectionParameterUpdatePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint16_t | connectionInterval, | ||
uint16_t | connectionLatency, | ||
uint16_t | supervisionTimeout | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, BM_CONNECTION_PARAM_UPDATE_INDEX, and memcpy_reorder().
Referenced by ble_update_connection_parameters().
void BM_APPLICATION_ConnParameterSetPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint16_t | min_conn_interval, | ||
uint16_t | max_conn_interval, | ||
uint16_t | slave_latency, | ||
uint16_t | so_timeout | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, and BM_CONN_PARAM_SET_INDEX.
Referenced by ble_set_connection_params().
void BM_APPLICATION_ConnParamUpdateEventParser | ( | void * | data, |
uint32_t * | dataLen | ||
) |
Parse a connection parameter update event ble_conn_param_update_event_t.
data | event data. |
dataLen | length of the data. |
References PACKED::conn_interval, PACKED::conn_latency, PACKED::conn_param, PACKED::link_sv_to, and memcpy_inplace_reorder().
Referenced by BM_Application_EventParser().
void BM_APPLICATION_DebugPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | debugOpcode, | ||
uint8_t * | debugParams, | ||
uint8_t | debugLength | ||
) |
void BM_APPLICATION_DeInit | ( | void | ) |
void BM_APPLICATION_DeviceNameReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt | ) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_NAME_READ_INDEX, and NULL.
void BM_APPLICATION_DeviceNameWritePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t * | deviceName, | ||
uint8_t | deviceNameLength | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, BM_NAME_WRITE_INDEX, and _bm_application_cmd::length.
Referenced by ble_set_device_name().
void BM_APPLICATION_DIOControlPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t * | dioControl | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_DIO_CONTROL_INDEX.
void BM_APPLICATION_DisconnectDevicePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_DISCONNECT_INDEX.
Referenced by ble_disconnect_device().
void BM_APPLICATION_EnableTransparentUartSetPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t | serverControl, | ||
uint8_t | clientMode | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, and BM_TRANSPARENT_ENABLE_INDEX.
Referenced by ble_transparent_uart_enable().
void BM_Application_EventParser | ( | BM_APPLICATION_EVENT_OPCODE | event_id, |
void * | data, | ||
uint32_t * | dataLen | ||
) |
Parse received events ble_conn_complete_event_t.
event_id | event opcode. |
data | event data. |
dataLen | length of the data. |
References BM_ADVERTISING_REPORT, BM_APPLICATION_AdvReportEventParser(), BM_APPLICATION_ConnCompleteEventParser(), BM_APPLICATION_ConnParamUpdateEventParser(), BM_APPLICATION_LeEndTestResultEventParser(), BM_APPLICATION_WriteCharValueEventParser(), BM_CLIENT_DISCOVER_CHARACTERISTICS_RESULT, BM_COMMAND_COMPLETE, BM_CONFIGURE_MODE_STATUS, BM_CONNECTION_PARAMTER_UPDATE, BM_DISCONNECT_COMPLETE, BM_LE_CONNECT_COMPLETE, BM_LE_END_TEST_RESULT, BM_SERVER_CHARACTERICTIC_VALUE_WRITE, and BM_STATUS_REPORT.
Referenced by ble_event_get().
BM_APPLICATION_CMDPKT* BM_APPLICATION_Init | ( | void | ) |
Initializes application mode configuration library.
bmxxDevice | Bluetooth device type used. Refer BMxx_BLUETOOTH_DEVICE. |
References appCmdPkt, appDataCmdPkt, BM_ERROR, event_msg_t::data, event_msg_t::data_len, event_t::event_id, event_t::event_msg, and NULL.
Referenced by ble_init().
void BM_APPLICATION_LeEndTestResultEventParser | ( | void * | data, |
uint32_t * | dataLen | ||
) |
Parse a LE end test result event ble_end_test_result_event_t.
data | event data. |
dataLen | length of the data. |
References memcpy_inplace_reorder(), and ble_end_test_result_event_t::num_of_packets.
Referenced by BM_Application_EventParser().
void BM_APPLICATION_LocalInformationReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt | ) |
Builds an application mode command packet which reads local information in configure mode.
applicationCmdPkt | Handle to the application mode configuration library created by init function. |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_LOCAL_INFORMATION_READ_INDEX, and NULL.
void BM_APPLICATION_PairDeviceDeletePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | deviceIndex | ||
) |
Builds an application mode command packet to delete paired device by index in configure mode.
applicationCmdPkt | Handle to the application mode configuration library created by init function. |
deviceIndex | Index for the device for which the pairing information is to be deleted. |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_DEVICE_ERASE_INDEX.
Referenced by ble_pair_device_delete().
void BM_APPLICATION_PairDeviceListErasePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt | ) |
Builds an application mode command packet to erase paired device list (PDL) in configure mode.
applicationCmdPkt | Handle to the application mode configuration library created by init function. |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_PDL_ERASE_INDEX, and NULL.
Referenced by ble_pair_device_erase_all().
void BM_APPLICATION_PairDeviceListReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt | ) |
Builds an application mode command packet to read paired device list in configure mode.
applicationCmdPkt | Handle to the application mode configuration library created by init function. |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_PDL_READ_INDEX, and NULL.
void BM_APPLICATION_PairModeReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt | ) |
Builds an application mode command packet to read pairing mode in configure mode.
applicationCmdPkt | Handle to the application mode configuration library created by init function. |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_PAIR_MODE_READ_INDEX, and NULL.
Referenced by ble_pair_mode_get().
void BM_APPLICATION_PairModeWritePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
BM_PAIR_MODE | pairMode | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_PAIR_MODE_WRITE_INDEX.
Referenced by ble_pair_mode_set().
void BM_APPLICATION_PairPassKeyClearPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_PASSKEY_CLEAR, and BM_PASSKEY_ENTRY_INDEX.
Referenced by ble_pair_passkey_clear().
void BM_APPLICATION_PairPassKeyDigitEnterPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t | passkeyDigit | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_PASSKEY_DIGIT_ENTER, and BM_PASSKEY_ENTRY_INDEX.
Referenced by ble_pair_passkey_enter().
void BM_APPLICATION_PairPassKeyDigitErasePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_PASSKEY_DIGIT_ERASE, and BM_PASSKEY_ENTRY_INDEX.
Referenced by ble_pair_passkey_erase_digits().
void BM_APPLICATION_PairPassKeyEntryCompletePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_PASSKEY_ENTRY_COMPLETE, and BM_PASSKEY_ENTRY_INDEX.
Referenced by ble_pair_passkey_reply().
void BM_APPLICATION_PairRequest | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_PAIRING_REQUEST.
Referenced by ble_pair_request().
void BM_APPLICATION_PairYesNoConfirmPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
bool | confirm | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_PASSKEY_YESNO_CONFIRM_INDEX.
Referenced by ble_pair_passkey_confirm().
void BM_APPLICATION_PatternSetPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | pattern | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_PATTERN_SET_INDEX.
Referenced by ble_init().
void BM_APPLICATION_PWMControlPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t * | pwmControl | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_PWM_CONTROL_INDEX.
void BM_APPLICATION_RemoteDeviceNameReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_REMOTE_NAME_READ_INDEX.
void BM_APPLICATION_ResetPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt | ) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_RESET_INDEX, and NULL.
Referenced by ble_init().
|
static |
References appRspData, BM_CFG_CMD_DATA, BM_CFG_CMD_LENH, BM_CFG_CMD_LENL, BM_ERROR, calc_chksum_8bit(), event_msg_t::data, event_msg_t::data_len, event_t::event_id, event_t::event_msg, and NULL.
Referenced by BM_APPLICATION_ResponseCheck().
bool BM_APPLICATION_ResponseCheck | ( | uint8_t * | data, |
uint8_t | len | ||
) |
De-initializes Application mode configuration library.
data | Handle to the response data received. |
length | Length of the response data received. |
References appCmdState, appDataIndex, appRspData, BM_APPLICATION_Response(), BM_CFG_CMD_CHKSUM, BM_CFG_CMD_DATA, BM_CFG_CMD_LENH, BM_CFG_CMD_LENL, BM_CFG_CMD_OPCODE, BM_CFG_CMD_SOF, BM_CFG_CMD_SOF_VAL, BM_ERROR, event_msg_t::data, data, event_msg_t::data_len, event_t::event_id, event_t::event_msg, NULL, and result.
Referenced by ble_response_check().
void BM_APPLICATION_RSSIReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_RSSI_READ.
Referenced by ble_rssi_read().
void BM_APPLICATION_ScanDataWritePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t * | scanData, | ||
uint8_t | scanLength, | ||
bool | store | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, BM_SCAN_DATA_WRITE_INDEX, and _bm_application_cmd::length.
Referenced by ble_scan_resp_data_set().
void BM_APPLICATION_ScanEnableSetPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | scanEnable, | ||
uint8_t | filterPolicy | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, and BM_SCAN_ENABLE_SET_INDEX.
Referenced by ble_scan_start().
void BM_APPLICATION_ScanParameterSetPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint16_t | scanInterval, | ||
uint16_t | scanWindow, | ||
uint8_t | scanType | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, BM_SCAN_PARAM_SET_INDEX, and memcpy_reorder().
Referenced by ble_scan_param_set().
void BM_APPLICATION_SendTransparentDataPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t * | data, | ||
uint8_t | datalen | ||
) |
void BM_APPLICATION_ServerBlobResponseReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t | responseOpcode, | ||
uint8_t * | characteriticValue, | ||
uint8_t | characteriticValueLength | ||
) |
void BM_APPLICATION_ServerCharacteristicReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint16_t | characteriticHandle | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, and BM_SERVER_CHARACTERISTIC_READ_INDEX.
Referenced by ble_characteristic_value_read().
void BM_APPLICATION_ServerCharacteristicSendPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint16_t | characteriticHandle, | ||
uint8_t * | characteriticValue, | ||
uint8_t | characteriticValueLength | ||
) |
void BM_APPLICATION_ServerCharacteristicUpdatePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint16_t | characteriticHandle, | ||
uint8_t * | characteriticValue, | ||
uint8_t | characteriticValueLength | ||
) |
void BM_APPLICATION_ServerCreateService | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t * | service, | ||
uint16_t | length, | ||
uint8_t | num_of_attrib | ||
) |
void BM_APPLICATION_ServerErrorResponsePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t | requestOpcode, | ||
uint16_t | characteristicHandle, | ||
uint8_t | errorCode | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, and BM_SERVER_ERROR_RESPONSE_INDEX.
Referenced by ble_error_response_send().
void BM_APPLICATION_ServerPrimaryServiceReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t * | serviceUUID, | ||
uint8_t | serviceUUIDLength | ||
) |
void BM_APPLICATION_ServerPrimaryServicesReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt | ) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_SERVER_ALL_SERVICES_READ_INDEX, and NULL.
Referenced by ble_primary_service_read_all().
void BM_APPLICATION_ServerReadResponseSendPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t | responseType, | ||
uint8_t * | characteriticValue, | ||
uint8_t | characteriticValueLength | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, BM_SERVER_READ_RESPONSE_SEND_INDEX, and _bm_application_cmd::length.
Referenced by ble_read_response_send().
void BM_APPLICATION_ServerReadService | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t * | service_uuid_16 | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, BM_SERVER_SERVICE_READ_INDEX, and _bm_application_cmd::length.
Referenced by ble_gatt_service_read().
void BM_APPLICATION_ServerWriteExecutePreparePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t | writeType | ||
) |
void BM_APPLICATION_ServerWriteResponsePreparePkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint16_t | characteristicHandle, | ||
uint8_t | writeType, | ||
uint16_t | valueOffset, | ||
uint8_t * | characteriticValue, | ||
uint8_t | characteriticValueLength | ||
) |
void BM_APPLICATION_ServerWriteResponseSendPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt, |
uint8_t | connectionHandle, | ||
uint8_t | requestOpcode, | ||
uint16_t | attributeHandle, | ||
uint8_t | errorCode | ||
) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_APPLICATION_MODE_CMD_LEN, and BM_SERVER_WRITE_RESPONSE_SEND_INDEX.
Referenced by ble_write_response_send().
void BM_APPLICATION_ShutdownPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt | ) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_SHUTDOWN_INDEX, and NULL.
Referenced by ble_shutdown().
void BM_APPLICATION_StatusReadPkt | ( | BM_APPLICATION_CMDPKT * | applicationCmdPkt | ) |
References BM_APPLICATION_CmdPkt(), BM_APPLICATION_MODE_CMD, BM_STATUS_READ_INDEX, and NULL.
void BM_APPLICATION_WriteCharValueEventParser | ( | void * | data, |
uint32_t * | dataLen | ||
) |
Parse a Client write characteristic value event ble_write_char_value_event_t.
data | event data. |
dataLen | length of the data. |
References PACKED::char_value_handle, and memcpy_inplace_reorder().
Referenced by BM_Application_EventParser().
uint8_t appByteTimeout = 0 |
BM_APPLICATION_CMDPKT appCmdPkt = {0, appDataCmdPkt} |
Referenced by BM_APPLICATION_Init().
|
static |
|
static |
Referenced by BM_APPLICATION_ResponseCheck().
uint8_t appDataCmdPkt[BM_PKT_LEN_MAX] |
Referenced by BM_APPLICATION_Init().
|
static |
Referenced by BM_APPLICATION_ResponseCheck().
event_t appEvent = {0} |
Referenced by get_received_cmd_frame().
uint8_t appRspData[BM_PKT_LEN_MAX] |
Referenced by BM_APPLICATION_Response(), and BM_APPLICATION_ResponseCheck().
|
static |