Microchip® Advanced Software Framework

bm_application_mode.c File Reference

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_CMDPKTBM_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_CMDappCmds
 
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 
)
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 
)
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 
)
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 
)
void BM_APPLICATION_ConnCompleteEventParser ( void *  data,
uint32_t *  dataLen 
)

Parse a connection complete event ble_conn_complete_event_t.

Parameters
dataevent data.
dataLenlength of the data.
Precondition
None.
Returns
None.

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)
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.

Parameters
dataevent data.
dataLenlength of the data.
Precondition
None.
Returns
None.

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)
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 
)
BM_APPLICATION_CMDPKT* BM_APPLICATION_Init ( void  )

Initializes application mode configuration library.

Parameters
bmxxDeviceBluetooth device type used. Refer BMxx_BLUETOOTH_DEVICE.
Precondition
None.
Returns
Handle to the application mode command packet.

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.

Parameters
dataevent data.
dataLenlength of the data.
Precondition
None.
Returns
None.

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.

Parameters
applicationCmdPktHandle to the application mode configuration library created by init function.
Precondition
Application mode library initialization function must be used to initialize the eepromCmdPkt.
Returns
None.

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.

Parameters
applicationCmdPktHandle to the application mode configuration library created by init function.
deviceIndexIndex for the device for which the pairing information is to be deleted.
Precondition
Application mode library initialization function must be used to initialize the eepromCmdPkt.
Returns
None.

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.

Parameters
applicationCmdPktHandle to the application mode configuration library created by init function.
Precondition
Application mode library initialization function must be used to initialize the eepromCmdPkt.
Returns
None.

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.

Parameters
applicationCmdPktHandle to the application mode configuration library created by init function.
Precondition
Application mode library initialization function must be used to initialize the eepromCmdPkt.
Returns
None.

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.

Parameters
applicationCmdPktHandle to the application mode configuration library created by init function.
Precondition
Application mode library initialization function must be used to initialize the eepromCmdPkt.
Returns
None.

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 
)
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)
bool BM_APPLICATION_ResponseCheck ( uint8_t *  data,
uint8_t  len 
)

De-initializes Application mode configuration library.

Parameters
dataHandle to the response data received.
lengthLength of the response data received.
Precondition
Application mode library initialization function must be used to initialize the eepromCmdPkt.
Returns
Operation status.

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 
)
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.

Parameters
dataevent data.
dataLenlength of the data.
Precondition
None.
Returns
None.

References PACKED::char_value_handle, and memcpy_inplace_reorder().

Referenced by BM_Application_EventParser().

uint8_t appByteTimeout = 0
BM_APPLICATION_CMD* appCmds
static
uint8_t appDataCmdPkt[BM_PKT_LEN_MAX]

Referenced by BM_APPLICATION_Init().

uint16_t appDataIndex = 0
static
event_t appEvent = {0}

Referenced by get_received_cmd_frame().

const BM_APPLICATION_CMD bm70ApplicationCmds[]
static