Microchip® Advanced Software Framework

bm_application_mode.h File Reference

BM application mode declarations.

Defines application mode APIs.

Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.

Support for configure mode, pairing procedure and events.

#include "stdint.h"
#include "stdbool.h"
#include "stdlib.h"
#include "string.h"

Data Structures

struct  _all_desc_discovery_resp
 
struct  _bm_application_cmd
 
struct  _bm_application_cmdpkt
 
struct  _bm_application_event
 
struct  _primary_service_char_discovery_resp
 

Macros

#define ADV_REPORT_ADDRESS_LEN   6
 
#define ADV_REPORT_ADDRESS_START   (ADV_REPORT_ADDRESS_TYPE_START + ADV_REPORT_ADDRESS_TYPE_LEN)
 
#define ADV_REPORT_ADDRESS_TYPE_LEN   1
 
#define ADV_REPORT_ADDRESS_TYPE_START   (ADV_REPORT_EVENT_TYPE_START + ADV_REPORT_EVENT_TYPE_LEN)
 
#define ADV_REPORT_DATA_LENGTH_LEN   1
 
#define ADV_REPORT_DATA_LENGTH_START   (ADV_REPORT_ADDRESS_START + ADV_REPORT_ADDRESS_LEN)
 
#define ADV_REPORT_DATA_START   (ADV_REPORT_DATA_LENGTH_START + ADV_REPORT_DATA_LENGTH_LEN)
 
#define ADV_REPORT_EVENT_TYPE_LEN   1
 
#define ADV_REPORT_EVENT_TYPE_START   0
 
#define ADV_REPORT_RSSI_LEN   1
 
#define BM_APPLICATION_MODE_CMD(x)   (appCmds[x])
 
#define BM_APPLICATION_MODE_CMD_LEN(x)   (appCmds[x].length)
 
#define BM_CFG_CMD_SOF_VAL   0xAA
 
#define BM_LE_ADV_INTERVAL_MAX   (0x4000)
 
#define BM_LE_ADV_INTERVAL_MIN   (0x0020)
 
#define BM_LE_ADV_INTERVAL_MS(x)   (((uint32_t)x * BM_LE_ADV_INTERVAL_UNIT) >> 10)
 
#define BM_LE_ADV_INTERVAL_UNIT   (640) /* 0.625ms x 1024 */
 
#define BM_LE_ADV_INTERVAL_VAL(x)   (((uint32_t)x << 10)/BM_LE_ADV_INTERVAL_UNIT)
 
#define BM_PKT_LEN_MAX   0x01FF
 
#define DESC_DISC_RESP_ATTRIB_HANDLE_LEN   2
 
#define DESC_DISC_RESP_ATTRIB_HANDLE_START   0
 
#define DESC_DISC_RESP_CONN_HANDLE_LEN   1
 
#define DESC_DISC_RESP_CONN_HANDLE_START   0
 
#define DESC_DISC_RESP_DATA_START   (DESC_DISC_RESP_FORMAT_START + DESC_DISC_RESP_FORMAT_LEN)
 
#define DESC_DISC_RESP_FORMAT_LEN   1
 
#define DESC_DISC_RESP_FORMAT_START   (DESC_DISC_RESP_CONN_HANDLE_START + DESC_DISC_RESP_CONN_HANDLE_LEN)
 
#define DESC_DISC_RESP_UUID_128B_LEN   16
 
#define DESC_DISC_RESP_UUID_16B_LEN   2
 
#define DESC_DISC_RESP_UUID_START   (DESC_DISC_RESP_ATTRIB_HANDLE_START + DESC_DISC_RESP_ATTRIB_HANDLE_LEN)
 
#define SERVICE_DISC_CHAR_RESP_ATTRIB_DATA_START   (SERVICE_DISC_CHAR_RESP_LENGTH_START + SERVICE_DISC_CHAR_RESP_LENGTH_LEN)
 
#define SERVICE_DISC_CHAR_RESP_ATTRIB_HANDLE_LEN   2
 
#define SERVICE_DISC_CHAR_RESP_ATTRIB_HANDLE_START   0
 
#define SERVICE_DISC_CHAR_RESP_CHAR_PROPERTY_LEN   1
 
#define SERVICE_DISC_CHAR_RESP_CHAR_PROPERTY_START   (SERVICE_DISC_CHAR_RESP_ATTRIB_HANDLE_START + SERVICE_DISC_CHAR_RESP_ATTRIB_HANDLE_LEN)
 
#define SERVICE_DISC_CHAR_RESP_CHAR_UUID_128_LEN   16
 
#define SERVICE_DISC_CHAR_RESP_CHAR_UUID_16_LEN   2
 
#define SERVICE_DISC_CHAR_RESP_CHAR_UUID_START   (SERVICE_DISC_CHAR_RESP_CHAR_VAL_ATTRIB_HANDLE_START + SERVICE_DISC_CHAR_RESP_CHAR_VAL_ATTRIB_HANDLE_LEN)
 
#define SERVICE_DISC_CHAR_RESP_CHAR_VAL_ATTRIB_HANDLE_LEN   2
 
#define SERVICE_DISC_CHAR_RESP_CHAR_VAL_ATTRIB_HANDLE_START   (SERVICE_DISC_CHAR_RESP_CHAR_PROPERTY_START + SERVICE_DISC_CHAR_RESP_CHAR_PROPERTY_LEN)
 
#define SERVICE_DISC_CHAR_RESP_CONN_HANDLE_LEN   1
 
#define SERVICE_DISC_CHAR_RESP_CONN_HANDLE_START   0
 
#define SERVICE_DISC_CHAR_RESP_LENGTH_LEN   1
 
#define SERVICE_DISC_CHAR_RESP_LENGTH_START   (SERVICE_DISC_CHAR_RESP_CONN_HANDLE_START + SERVICE_DISC_CHAR_RESP_CONN_HANDLE_LEN)
 

Typedefs

typedef struct
_all_desc_discovery_resp 
All_DESC_DISCOVERY_RESP
 
typedef enum _bm_adc_channel BM_ADC_CHANNEL
 
typedef enum _bm_adv_address BM_ADV_ADDRESS
 
typedef enum _bm_adv_type BM_ADV_TYPE
 
typedef enum _bm_adv_type_store BM_ADV_TYPE_STORE
 
typedef struct _bm_application_cmd BM_APPLICATION_CMD
 
typedef enum
_bm_application_cmd_index 
BM_APPLICATION_CMD_INDEX
 
typedef enum
_bm_application_cmd_opcode 
BM_APPLICATION_CMD_OPCODE
 
typedef enum
_bm_application_cmd_state 
BM_APPLICATION_CMD_STATE
 
typedef struct
_bm_application_cmdpkt 
BM_APPLICATION_CMDPKT
 
typedef enum
_bm_application_error_code 
BM_APPLICATION_ERROR_CODE
 
typedef struct
_bm_application_event 
BM_APPLICATION_EVENT
 
typedef enum
_bm_application_event_opcode 
BM_APPLICATION_EVENT_OPCODE
 
typedef enum
_bm_application_rsp_ret 
BM_APPLICATION_RSP_RET
 
typedef enum _bm_pair_mode BM_PAIR_MODE
 
typedef enum _bm_pair_mode_rsp BM_PAIR_MODE_RSP
 
typedef enum _bm_status BM_STATUS
 
typedef struct
_primary_service_char_discovery_resp 
PRIMARY_SERVICE_CHAR_DISCOVERY_RESP
 

Enumerations

enum  _bm_adc_channel {
  BM_ADC_CHANNEL_0 = 0x00,
  BM_ADC_CHANNEL_1,
  BM_ADC_CHANNEL_2,
  BM_ADC_CHANNEL_3,
  BM_ADC_CHANNEL_4,
  BM_ADC_CHANNEL_5,
  BM_ADC_CHANNEL_6,
  BM_ADC_CHANNEL_7,
  BM_ADC_CHANNEL_8,
  BM_ADC_CHANNEL_9,
  BM_ADC_CHANNEL_10,
  BM_ADC_CHANNEL_11,
  BM_ADC_CHANNEL_12,
  BM_ADC_CHANNEL_13,
  BM_ADC_CHANNEL_14,
  BM_ADC_CHANNEL_15,
  BM_BATTERY_VOLTAGE,
  BM_TEMPERATURE_VALUE
}
 
enum  _bm_adv_address {
  BM_ADV_ADDRESS_PUBLIC = 0x00,
  BM_ADV_ADDRESS_RANDOM
}
 
enum  _bm_adv_type {
  BM_ADV_CONNECTABLE_UNDIRECTED = 0x00,
  BM_ADV_CONNECTABLE_DIRECTED,
  BM_ADV_SCANNABLE_UNDIRECTED,
  BM_ADV_NONCONNECTABLE_UNDIRECTED,
  BM_ADV_PROPRIETARY_BEACON
}
 
enum  _bm_adv_type_store {
  BM_ADV_NO_EEPROM = 0x00,
  BM_ADV_EEPROM = 0x01,
  BM_BEACON_NO_EEPROM = 0x80,
  BM_BEACON_EEPROM = 0x81
}
 
enum  _bm_application_cmd_index {
  BM_LOCAL_INFORMATION_READ_INDEX = 0x00,
  BM_RESET_INDEX,
  BM_STATUS_READ_INDEX,
  BM_ADC_READ_INDEX,
  BM_SHUTDOWN_INDEX,
  BM_DEBUG_INDEX,
  BM_NAME_READ_INDEX,
  BM_NAME_WRITE_INDEX,
  BM_PDL_ERASE_INDEX,
  BM_PAIR_MODE_READ_INDEX,
  BM_PAIR_MODE_WRITE_INDEX,
  BM_PDL_READ_INDEX,
  BM_DEVICE_ERASE_INDEX,
  BM_DIO_CONTROL_INDEX,
  BM_PWM_CONTROL_INDEX,
  BM_RSSI_READ_INDEX,
  BM_ADV_DATA_WRITE_INDEX,
  BM_SCAN_DATA_WRITE_INDEX,
  BM_ADV_PARAM_SET_INDEX,
  BM_CONN_PARAM_SET_INDEX,
  BM_SCAN_PARAM_SET_INDEX,
  BM_SCAN_ENABLE_SET_INDEX,
  BM_CONNECT_INDEX,
  BM_CONNECT_CANCEL_INDEX,
  BM_CONNECTION_PARAM_UPDATE_INDEX,
  BM_DISCONNECT_INDEX,
  BM_SET_ADV_ENABLE_INDEX,
  BM_REMOTE_NAME_READ_INDEX,
  BM_CLIENT_WRITE_REQUEST_PREPARE_INDEX,
  BM_CLIENT_WRITE_REQUEST_EXECUTE_INDEX,
  BM_CLIENT_BLOB_REQUEST_READ_INDEX,
  BM_CLIENT_HANDLE_VALUE_CONFIRM_INDEX,
  BM_CLIENT_DISCOVER_ALL_SERVICES_INDEX,
  BM_CLIENT_DISCOVER_CHARACTERISTICS_INDEX,
  BM_CLIENT_CHARACTERISTIC_READ_INDEX,
  BM_CLIENT_CHARACTERISTIC_UUID_READ_INDEX,
  BM_CLIENT_CHARACTERISTIC_WRITE_INDEX,
  BM_TRANSPARENT_ENABLE_INDEX,
  BM_SERVER_CREATE_SERVICE_REQUEST_INDEX,
  BM_SERVER_WRITE_RESPONSE_PREPARE_INDEX,
  BM_SERVER_WRITE_RESPONSE_EXECUTE_INDEX,
  BM_SERVER_BLOB_RESPONSE_READ_INDEX,
  BM_SERVER_ERROR_RESPONSE_INDEX,
  BM_SERVER_CHARACTERISTIC_SEND_INDEX,
  BM_SERVER_CHARACTERISTIC_UPDATE_INDEX,
  BM_SERVER_CHARACTERISTIC_READ_INDEX,
  BM_SERVER_ALL_SERVICES_READ_INDEX,
  BM_SERVER_SERVICE_READ_INDEX,
  BM_SERVER_WRITE_RESPONSE_SEND_INDEX,
  BM_SERVER_READ_RESPONSE_SEND_INDEX,
  BM_TRANSPARENT_DATA_SEND_INDEX,
  BM_PASSKEY_ENTRY_INDEX,
  BM_PASSKEY_YESNO_CONFIRM_INDEX,
  BM_PAIRING_REQUEST_INDEX,
  BM_CONFIG_MODE_CLOSE_INDEX,
  BM_RECEIVER_TEST_INDEX,
  BM_TRANSMITTER_TEST_INDEX,
  BM_END_TEST_INDEX,
  BM_PATTERN_SET_INDEX
}
 
enum  _bm_application_cmd_opcode {
  BM_LOCAL_INFORMATION_READ = 0x01,
  BM_RESET,
  BM_STATUS_READ,
  BM_ADC_READ,
  BM_SHUTDOWN = 0x05,
  BM_DEBUG,
  BM_NAME_READ,
  BM_NAME_WRITE,
  BM_PDL_ERASE,
  BM_PAIR_MODE_READ,
  BM_PAIR_MODE_WRITE,
  BM_PDL_READ,
  BM_DEVICE_ERASE,
  BM_DIO_CONTROL,
  BM_PWM_CONTROL,
  BM_RSSI_READ = 0x10,
  BM_ADV_DATA_WRITE,
  BM_SCAN_DATA_WRITE,
  BM_ADV_PARAM_SET = 0x13,
  BM_CONN_PARAM_SET,
  BM_SCAN_PARAM_SET = 0x15,
  BM_SCAN_ENABLE_SET,
  BM_CONNECT,
  BM_CONNECT_CANCEL,
  BM_CONNECTION_PARAM_UPDATE,
  BM_DISCONNECT = 0x1B,
  BM_SET_ADV_ENABLE = 0x1C,
  BM_REMOTE_NAME_READ = 0x1F,
  BM_CLIENT_WRITE_REQUEST_PREPARE = 0x20,
  BM_CLIENT_WRITE_REQUEST_EXECUTE,
  BM_CLIENT_BLOB_REQUEST_READ,
  BM_CLIENT_HANDLE_VALUE_CONFIRM = 0x2D,
  BM_CLIENT_DISCOVER_ALL_SERVICES = 0x30,
  BM_CLIENT_DISCOVER_CHARACTERISTICS,
  BM_CLIENT_CHARACTERISTIC_READ,
  BM_CLIENT_CHARACTERISTIC_UUID_READ,
  BM_CLIENT_CHARACTERISTIC_WRITE,
  BM_TRANSPARENT_ENABLE,
  BM_SERVER_CREATE_SERVICE_REQUEST = 0x27,
  BM_SERVER_WRITE_RESPONSE_PREPARE = 0x28,
  BM_SERVER_WRITE_RESPONSE_EXECUTE,
  BM_SERVER_BLOB_RESPONSE_READ = 0x2A,
  BM_SERVER_ERROR_RESPONSE = 0x37,
  BM_SERVER_CHARACTERISTIC_SEND = 0x38,
  BM_SERVER_CHARACTERISTIC_UPDATE,
  BM_SERVER_CHARACTERISTIC_READ,
  BM_SERVER_ALL_SERVICES_READ,
  BM_SERVER_SERVICE_READ,
  BM_SERVER_WRITE_RESPONSE_SEND,
  BM_SERVER_READ_RESPONSE_SEND,
  BM_TRANSPARENT_DATA_SEND = 0x3F,
  BM_PASSKEY_ENTRY = 0x40,
  BM_PASSKEY_YESNO_CONFIRM,
  BM_PAIRING_REQUEST,
  BM_CONFIG_MODE_CLOSE = 0x52,
  BM_RECEIVER_TEST,
  BM_TRANSMITTER_TEST,
  BM_END_TEST,
  BM_PATTERN_SET = 0x57
}
 
enum  _bm_application_cmd_state {
  BM_CFG_CMD_SOF = 0x00,
  BM_CFG_CMD_LENH,
  BM_CFG_CMD_LENL,
  BM_CFG_CMD_OPCODE,
  BM_CFG_CMD_DATA,
  BM_CFG_CMD_CHKSUM
}
 
enum  _bm_application_error_code {
  BM_COMMAND_SUCCESS = 0x00,
  BM_COMMAND_UNKNOWN,
  BM_CONNECTION_ID_UNKNOWN,
  BM_HARDWARE_FAIL,
  BM_AUTHENTICATION_FAIL = 0x05,
  BM_KEY_MISSING,
  BM_MEMORY_FULL,
  BM_CONNECTION_TIMEOUT,
  BM_CONNECTION_LIMIT,
  BM_ACL_EXISTS = 0x0B,
  BM_COMMAND_DISALLOWED,
  BM_CONNECTION_REJECT_RESOURCES,
  BM_CONNECTION_REJECT_SECURITY,
  BM_CONNECTION_REJECT_ADDRESS,
  BM_CONNECTION_ACCEPT_TIMEOUT,
  BM_FEATURE_UNKNOWN,
  BM_PARAMETERS_INVALID,
  BM_REMOTE_CONNECTION_END,
  BM_CONNECTION_END_RESOURCES,
  BM_CONNECTION_END_POWER,
  BM_CONNECTION_END_LOCAL,
  BM_PAIRING_DISALLOWED = 0x18,
  BM_ERROR_UNSPECIFIED = 0x1F,
  BM_INSTANT_PASS = 0x28,
  BM_PAIRING_KEY_DISALLOWED,
  BM_SECURITY_INSUFFICIENT = 0x2F,
  BM_CONNECTION_REJECT_CHANNEL = 0x39,
  BM_CONTROLLER_BUSY,
  BM_CONNECTION_INTERVAL_INVALID,
  BM_ADVERTISING_TIMEOUT,
  BM_CONNECTION_END_MIC,
  BM_CONNECTION_FAIL,
  BM_HANDLE_INVALID = 0x81,
  BM_READ_DISALLOWED,
  BM_WRITE_DISALLOWED,
  BM_PDU_INVALID,
  BM_AUTHENTICATION_INSUFFIECIENT,
  BM_REQUEST_INVALID,
  BM_OFFSET_INVALID,
  BM_AUTHORIZATION_INSUFFICIENT,
  BM_QUEUE_FULL,
  BM_ATTRIBUTE_UNSPECIFIED,
  BM_ATTRIBUTE_INSUFFICIENT,
  BM_ENCRYPTION_KEY_INSUFFICIENT,
  BM_ATTRIBUTE_LENGTH_INSUFFICIENT,
  BM_UNLIKELY_ERROR,
  BM_ENCRYPTION_INSUFFICIENT,
  BM_GROUP_INVALID,
  BM_RESOURCES_INSUFFICIENT,
  BM_UART_CHECKSUM_ERROR = 0xFF
}
 
enum  _bm_application_event_opcode {
  BM_EVENT_NONE = 0x00,
  BM_PASSKEY_REQUEST = 0x60,
  BM_PAIR_COMPLETE,
  BM_PASSKEY_YESNO_REQUEST,
  BM_ADVERTISING_REPORT = 0x70,
  BM_LE_CONNECT_COMPLETE,
  BM_DISCONNECT_COMPLETE,
  BM_CONNECTION_PARAMTER_UPDATE,
  BM_COMMAND_COMPLETE = 0x80,
  BM_STATUS_REPORT,
  BM_LE_END_TEST_RESULT,
  BM_CONFIGURE_MODE_STATUS = 0x8F,
  BM_CLIENT_DISCOVER_ALL_SERVICES_RESULT = 0x90,
  BM_CLIENT_DISCOVER_CHARACTERISTICS_RESULT,
  BM_CLIENT_DISCOVER_CHARACTERISTICS_DESCRIPTORS_RESULT,
  BM_CLIENT_CHARACTERISTIC_VALUE_RECEIVED,
  BM_SERVER_CHARACTERICTIC_VALUE_WRITE = 0x98,
  BM_SERVER_CHARACTERISTIC_VALUE_READ,
  BM_TRANSPARENT_DATA_RECEIVED = 0x9A,
  BM_SERVER_PREPARE_WRITE_REQUEST,
  BM_SERVER_EXECUTE_WRITE_REQUEST,
  BM_SERVER_BLOB_READ_REQUEST = 0xA0,
  BM_CLIENT_PREPARE_WRITE_RESPONSE,
  BM_CLIENT_EXECUTE_WRITE_RESPONSE,
  BM_ERROR = 0xFF
}
 
enum  _bm_application_rsp_ret {
  BM_CFG_RSP_ERROR = -1,
  BM_CFG_RSP_UNKNOWN = 0,
  BM_CFG_RSP_AOK,
  BM_CFG_RSP_ERR
}
 
enum  _bm_pair_mode {
  BM_PAIR_DISPLAY_ONLY = 0,
  BM_PAIR_DISPLAY_CONFIRM = 1,
  BM_PAIR_KEYBOARD_ONLY = 2,
  BM_PAIR_NO_INPUT_OUTPUT = 3,
  BM_PAIR_DISPLAY_KEYBOARD = 4,
  BM_PAIR_INVALID_MODE = 5
}
 
enum  _bm_pair_mode_rsp {
  BM_RSP_DISPLAY_ONLY = 0,
  BM_RSP_DISPLAY_CONFIRM = 1,
  BM_RSP_KEYBOARD_ONLY = 2,
  BM_RSP_NO_INPUT_OUTPUT = 3,
  BM_RSP_DISPLAY_KEYBOARD = 4
}
 
enum  _bm_status {
  BM_STATUS_POWER_ON = 0x00,
  BM_STATUS_SCANNING,
  BM_STATUS_CONNECTING,
  BM_STATUS_STANDBY,
  BM_STATUS_BROADCAST,
  BM_STATUS_TRANSPARENT_UART,
  BM_STATUS_IDLE,
  BM_STATUS_SHUTDOWN,
  BM_STATUS_CONFIGURE,
  BM_STATUS_CONNECTED
}
 
enum  BM_PASSKEY_ACTION_OPTION {
  BM_PASSKEY_DIGIT_ENTER = 1,
  BM_PASSKEY_DIGIT_ERASE,
  BM_PASSKEY_CLEAR,
  BM_PASSKEY_ENTRY_COMPLETE
}
 

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 advertiseMode)
 
void BM_APPLICATION_AdvertisementParameterSetPkt (BM_APPLICATION_CMDPKT *applicationCmdPkt, uint8_t *advertiseParameter)
 
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)
 
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)
 
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_DiscoverCharRespEventParser (void *data, uint32_t *dataLen)
 Parse a Discover primary service characteristic response event PRIMARY_SERVICE_CHAR_DISCOVERY_RESP. More...
 
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 (void)
 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)
 
bool BM_APPLICATION_ResponseCheck (uint8_t *data, uint8_t length)
 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...
 

#define ADV_REPORT_ADDRESS_LEN   6
#define ADV_REPORT_ADDRESS_START   (ADV_REPORT_ADDRESS_TYPE_START + ADV_REPORT_ADDRESS_TYPE_LEN)
#define ADV_REPORT_ADDRESS_TYPE_LEN   1
#define ADV_REPORT_ADDRESS_TYPE_START   (ADV_REPORT_EVENT_TYPE_START + ADV_REPORT_EVENT_TYPE_LEN)
#define ADV_REPORT_DATA_LENGTH_LEN   1
#define ADV_REPORT_DATA_LENGTH_START   (ADV_REPORT_ADDRESS_START + ADV_REPORT_ADDRESS_LEN)
#define ADV_REPORT_EVENT_TYPE_LEN   1
#define ADV_REPORT_EVENT_TYPE_START   0
#define ADV_REPORT_RSSI_LEN   1
#define BM_APPLICATION_MODE_CMD (   x)    (appCmds[x])

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

#define BM_CFG_CMD_SOF_VAL   0xAA
#define BM_LE_ADV_INTERVAL_MAX   (0x4000)
#define BM_LE_ADV_INTERVAL_MIN   (0x0020)
#define BM_LE_ADV_INTERVAL_MS (   x)    (((uint32_t)x * BM_LE_ADV_INTERVAL_UNIT) >> 10)
#define BM_LE_ADV_INTERVAL_UNIT   (640) /* 0.625ms x 1024 */
#define BM_LE_ADV_INTERVAL_VAL (   x)    (((uint32_t)x << 10)/BM_LE_ADV_INTERVAL_UNIT)
#define BM_PKT_LEN_MAX   0x01FF
#define DESC_DISC_RESP_ATTRIB_HANDLE_LEN   2
#define DESC_DISC_RESP_ATTRIB_HANDLE_START   0
#define DESC_DISC_RESP_CONN_HANDLE_LEN   1
#define DESC_DISC_RESP_CONN_HANDLE_START   0
#define DESC_DISC_RESP_DATA_START   (DESC_DISC_RESP_FORMAT_START + DESC_DISC_RESP_FORMAT_LEN)
#define DESC_DISC_RESP_FORMAT_LEN   1
#define DESC_DISC_RESP_FORMAT_START   (DESC_DISC_RESP_CONN_HANDLE_START + DESC_DISC_RESP_CONN_HANDLE_LEN)
#define DESC_DISC_RESP_UUID_128B_LEN   16
#define DESC_DISC_RESP_UUID_16B_LEN   2
#define DESC_DISC_RESP_UUID_START   (DESC_DISC_RESP_ATTRIB_HANDLE_START + DESC_DISC_RESP_ATTRIB_HANDLE_LEN)
#define SERVICE_DISC_CHAR_RESP_ATTRIB_DATA_START   (SERVICE_DISC_CHAR_RESP_LENGTH_START + SERVICE_DISC_CHAR_RESP_LENGTH_LEN)
#define SERVICE_DISC_CHAR_RESP_ATTRIB_HANDLE_LEN   2
#define SERVICE_DISC_CHAR_RESP_ATTRIB_HANDLE_START   0

Referenced by app_char_disc_resp_cb().

#define SERVICE_DISC_CHAR_RESP_CHAR_PROPERTY_LEN   1
#define SERVICE_DISC_CHAR_RESP_CHAR_PROPERTY_START   (SERVICE_DISC_CHAR_RESP_ATTRIB_HANDLE_START + SERVICE_DISC_CHAR_RESP_ATTRIB_HANDLE_LEN)
#define SERVICE_DISC_CHAR_RESP_CHAR_UUID_128_LEN   16
#define SERVICE_DISC_CHAR_RESP_CHAR_UUID_16_LEN   2
#define SERVICE_DISC_CHAR_RESP_CHAR_VAL_ATTRIB_HANDLE_LEN   2
#define SERVICE_DISC_CHAR_RESP_CHAR_VAL_ATTRIB_HANDLE_START   (SERVICE_DISC_CHAR_RESP_CHAR_PROPERTY_START + SERVICE_DISC_CHAR_RESP_CHAR_PROPERTY_LEN)
#define SERVICE_DISC_CHAR_RESP_CONN_HANDLE_LEN   1

Referenced by app_char_disc_resp_cb().

#define SERVICE_DISC_CHAR_RESP_CONN_HANDLE_START   0
#define SERVICE_DISC_CHAR_RESP_LENGTH_LEN   1

Referenced by app_char_disc_resp_cb().

#define SERVICE_DISC_CHAR_RESP_LENGTH_START   (SERVICE_DISC_CHAR_RESP_CONN_HANDLE_START + SERVICE_DISC_CHAR_RESP_CONN_HANDLE_LEN)

typedef enum _bm_adv_type BM_ADV_TYPE
typedef enum _bm_status BM_STATUS

Enumerator
BM_ADC_CHANNEL_0 
BM_ADC_CHANNEL_1 
BM_ADC_CHANNEL_2 
BM_ADC_CHANNEL_3 
BM_ADC_CHANNEL_4 
BM_ADC_CHANNEL_5 
BM_ADC_CHANNEL_6 
BM_ADC_CHANNEL_7 
BM_ADC_CHANNEL_8 
BM_ADC_CHANNEL_9 
BM_ADC_CHANNEL_10 
BM_ADC_CHANNEL_11 
BM_ADC_CHANNEL_12 
BM_ADC_CHANNEL_13 
BM_ADC_CHANNEL_14 
BM_ADC_CHANNEL_15 
BM_BATTERY_VOLTAGE 
BM_TEMPERATURE_VALUE 
Enumerator
BM_ADV_ADDRESS_PUBLIC 

Public device address.

BM_ADV_ADDRESS_RANDOM 

Random device address.

Enumerator
BM_ADV_CONNECTABLE_UNDIRECTED 

Connectable undirected advertising.

BM_ADV_CONNECTABLE_DIRECTED 

Connectable directed advertising.

BM_ADV_SCANNABLE_UNDIRECTED 

Scannable undirected advertising.

BM_ADV_NONCONNECTABLE_UNDIRECTED 

Non connectable undirected advertising.

BM_ADV_PROPRIETARY_BEACON 

Proprietary Beacon.

Enumerator
BM_ADV_NO_EEPROM 

Advertising data not stored to EEPROM.

BM_ADV_EEPROM 

Advertising data stored to EEPROM.

BM_BEACON_NO_EEPROM 

Beacon data not stored to EEPROM.

BM_BEACON_EEPROM 

Beacon data stored to EEPROM.

Enumerator
BM_LOCAL_INFORMATION_READ_INDEX 
BM_RESET_INDEX 
BM_STATUS_READ_INDEX 
BM_ADC_READ_INDEX 
BM_SHUTDOWN_INDEX 
BM_DEBUG_INDEX 
BM_NAME_READ_INDEX 
BM_NAME_WRITE_INDEX 
BM_PDL_ERASE_INDEX 
BM_PAIR_MODE_READ_INDEX 
BM_PAIR_MODE_WRITE_INDEX 
BM_PDL_READ_INDEX 
BM_DEVICE_ERASE_INDEX 
BM_DIO_CONTROL_INDEX 
BM_PWM_CONTROL_INDEX 
BM_RSSI_READ_INDEX 
BM_ADV_DATA_WRITE_INDEX 
BM_SCAN_DATA_WRITE_INDEX 
BM_ADV_PARAM_SET_INDEX 
BM_CONN_PARAM_SET_INDEX 
BM_SCAN_PARAM_SET_INDEX 
BM_SCAN_ENABLE_SET_INDEX 
BM_CONNECT_INDEX 
BM_CONNECT_CANCEL_INDEX 
BM_CONNECTION_PARAM_UPDATE_INDEX 
BM_DISCONNECT_INDEX 
BM_SET_ADV_ENABLE_INDEX 
BM_REMOTE_NAME_READ_INDEX 
BM_CLIENT_WRITE_REQUEST_PREPARE_INDEX 
BM_CLIENT_WRITE_REQUEST_EXECUTE_INDEX 
BM_CLIENT_BLOB_REQUEST_READ_INDEX 
BM_CLIENT_HANDLE_VALUE_CONFIRM_INDEX 
BM_CLIENT_DISCOVER_ALL_SERVICES_INDEX 
BM_CLIENT_DISCOVER_CHARACTERISTICS_INDEX 
BM_CLIENT_CHARACTERISTIC_READ_INDEX 
BM_CLIENT_CHARACTERISTIC_UUID_READ_INDEX 
BM_CLIENT_CHARACTERISTIC_WRITE_INDEX 
BM_TRANSPARENT_ENABLE_INDEX 
BM_SERVER_CREATE_SERVICE_REQUEST_INDEX 
BM_SERVER_WRITE_RESPONSE_PREPARE_INDEX 
BM_SERVER_WRITE_RESPONSE_EXECUTE_INDEX 
BM_SERVER_BLOB_RESPONSE_READ_INDEX 
BM_SERVER_ERROR_RESPONSE_INDEX 
BM_SERVER_CHARACTERISTIC_SEND_INDEX 
BM_SERVER_CHARACTERISTIC_UPDATE_INDEX 
BM_SERVER_CHARACTERISTIC_READ_INDEX 
BM_SERVER_ALL_SERVICES_READ_INDEX 
BM_SERVER_SERVICE_READ_INDEX 
BM_SERVER_WRITE_RESPONSE_SEND_INDEX 
BM_SERVER_READ_RESPONSE_SEND_INDEX 
BM_TRANSPARENT_DATA_SEND_INDEX 
BM_PASSKEY_ENTRY_INDEX 
BM_PASSKEY_YESNO_CONFIRM_INDEX 
BM_PAIRING_REQUEST_INDEX 
BM_CONFIG_MODE_CLOSE_INDEX 
BM_RECEIVER_TEST_INDEX 
BM_TRANSMITTER_TEST_INDEX 
BM_END_TEST_INDEX 
BM_PATTERN_SET_INDEX 
Enumerator
BM_LOCAL_INFORMATION_READ 
BM_RESET 
BM_STATUS_READ 
BM_ADC_READ 
BM_SHUTDOWN 
BM_DEBUG 
BM_NAME_READ 
BM_NAME_WRITE 
BM_PDL_ERASE 
BM_PAIR_MODE_READ 
BM_PAIR_MODE_WRITE 
BM_PDL_READ 
BM_DEVICE_ERASE 
BM_DIO_CONTROL 
BM_PWM_CONTROL 
BM_RSSI_READ 
BM_ADV_DATA_WRITE 
BM_SCAN_DATA_WRITE 
BM_ADV_PARAM_SET 
BM_CONN_PARAM_SET 
BM_SCAN_PARAM_SET 
BM_SCAN_ENABLE_SET 
BM_CONNECT 
BM_CONNECT_CANCEL 
BM_CONNECTION_PARAM_UPDATE 
BM_DISCONNECT 
BM_SET_ADV_ENABLE 
BM_REMOTE_NAME_READ 
BM_CLIENT_WRITE_REQUEST_PREPARE 
BM_CLIENT_WRITE_REQUEST_EXECUTE 
BM_CLIENT_BLOB_REQUEST_READ 
BM_CLIENT_HANDLE_VALUE_CONFIRM 
BM_CLIENT_DISCOVER_ALL_SERVICES 
BM_CLIENT_DISCOVER_CHARACTERISTICS 
BM_CLIENT_CHARACTERISTIC_READ 
BM_CLIENT_CHARACTERISTIC_UUID_READ 
BM_CLIENT_CHARACTERISTIC_WRITE 
BM_TRANSPARENT_ENABLE 
BM_SERVER_CREATE_SERVICE_REQUEST 
BM_SERVER_WRITE_RESPONSE_PREPARE 
BM_SERVER_WRITE_RESPONSE_EXECUTE 
BM_SERVER_BLOB_RESPONSE_READ 
BM_SERVER_ERROR_RESPONSE 
BM_SERVER_CHARACTERISTIC_SEND 
BM_SERVER_CHARACTERISTIC_UPDATE 
BM_SERVER_CHARACTERISTIC_READ 
BM_SERVER_ALL_SERVICES_READ 
BM_SERVER_SERVICE_READ 
BM_SERVER_WRITE_RESPONSE_SEND 
BM_SERVER_READ_RESPONSE_SEND 
BM_TRANSPARENT_DATA_SEND 
BM_PASSKEY_ENTRY 
BM_PASSKEY_YESNO_CONFIRM 
BM_PAIRING_REQUEST 
BM_CONFIG_MODE_CLOSE 
BM_RECEIVER_TEST 
BM_TRANSMITTER_TEST 
BM_END_TEST 
BM_PATTERN_SET 
Enumerator
BM_CFG_CMD_SOF 
BM_CFG_CMD_LENH 
BM_CFG_CMD_LENL 
BM_CFG_CMD_OPCODE 
BM_CFG_CMD_DATA 
BM_CFG_CMD_CHKSUM 
Enumerator
BM_COMMAND_SUCCESS 
BM_COMMAND_UNKNOWN 
BM_CONNECTION_ID_UNKNOWN 
BM_HARDWARE_FAIL 
BM_AUTHENTICATION_FAIL 
BM_KEY_MISSING 
BM_MEMORY_FULL 
BM_CONNECTION_TIMEOUT 
BM_CONNECTION_LIMIT 
BM_ACL_EXISTS 
BM_COMMAND_DISALLOWED 
BM_CONNECTION_REJECT_RESOURCES 
BM_CONNECTION_REJECT_SECURITY 
BM_CONNECTION_REJECT_ADDRESS 
BM_CONNECTION_ACCEPT_TIMEOUT 
BM_FEATURE_UNKNOWN 
BM_PARAMETERS_INVALID 
BM_REMOTE_CONNECTION_END 
BM_CONNECTION_END_RESOURCES 
BM_CONNECTION_END_POWER 
BM_CONNECTION_END_LOCAL 
BM_PAIRING_DISALLOWED 
BM_ERROR_UNSPECIFIED 
BM_INSTANT_PASS 
BM_PAIRING_KEY_DISALLOWED 
BM_SECURITY_INSUFFICIENT 
BM_CONNECTION_REJECT_CHANNEL 
BM_CONTROLLER_BUSY 
BM_CONNECTION_INTERVAL_INVALID 
BM_ADVERTISING_TIMEOUT 
BM_CONNECTION_END_MIC 
BM_CONNECTION_FAIL 
BM_HANDLE_INVALID 
BM_READ_DISALLOWED 
BM_WRITE_DISALLOWED 
BM_PDU_INVALID 
BM_AUTHENTICATION_INSUFFIECIENT 
BM_REQUEST_INVALID 
BM_OFFSET_INVALID 
BM_AUTHORIZATION_INSUFFICIENT 
BM_QUEUE_FULL 
BM_ATTRIBUTE_UNSPECIFIED 
BM_ATTRIBUTE_INSUFFICIENT 
BM_ENCRYPTION_KEY_INSUFFICIENT 
BM_ATTRIBUTE_LENGTH_INSUFFICIENT 
BM_UNLIKELY_ERROR 
BM_ENCRYPTION_INSUFFICIENT 
BM_GROUP_INVALID 
BM_RESOURCES_INSUFFICIENT 
BM_UART_CHECKSUM_ERROR 
Enumerator
BM_EVENT_NONE 
BM_PASSKEY_REQUEST 
BM_PAIR_COMPLETE 
BM_PASSKEY_YESNO_REQUEST 
BM_ADVERTISING_REPORT 
BM_LE_CONNECT_COMPLETE 
BM_DISCONNECT_COMPLETE 
BM_CONNECTION_PARAMTER_UPDATE 
BM_COMMAND_COMPLETE 
BM_STATUS_REPORT 
BM_LE_END_TEST_RESULT 
BM_CONFIGURE_MODE_STATUS 
BM_CLIENT_DISCOVER_ALL_SERVICES_RESULT 
BM_CLIENT_DISCOVER_CHARACTERISTICS_RESULT 
BM_CLIENT_DISCOVER_CHARACTERISTICS_DESCRIPTORS_RESULT 
BM_CLIENT_CHARACTERISTIC_VALUE_RECEIVED 
BM_SERVER_CHARACTERICTIC_VALUE_WRITE 
BM_SERVER_CHARACTERISTIC_VALUE_READ 
BM_TRANSPARENT_DATA_RECEIVED 
BM_SERVER_PREPARE_WRITE_REQUEST 
BM_SERVER_EXECUTE_WRITE_REQUEST 
BM_SERVER_BLOB_READ_REQUEST 
BM_CLIENT_PREPARE_WRITE_RESPONSE 
BM_CLIENT_EXECUTE_WRITE_RESPONSE 
BM_ERROR 
Enumerator
BM_CFG_RSP_ERROR 

Error in response.

BM_CFG_RSP_UNKNOWN 

Unknown response.

BM_CFG_RSP_AOK 

Response for successful command.

BM_CFG_RSP_ERR 

Response for unsuccessful command.

Enumerator
BM_PAIR_DISPLAY_ONLY 

Display only.

BM_PAIR_DISPLAY_CONFIRM 

Display yes/no confirm..

BM_PAIR_KEYBOARD_ONLY 

Keyboard only.

BM_PAIR_NO_INPUT_OUTPUT 

No input no output.

BM_PAIR_DISPLAY_KEYBOARD 

Display keyboard.

BM_PAIR_INVALID_MODE 
Enumerator
BM_RSP_DISPLAY_ONLY 

Display only.

BM_RSP_DISPLAY_CONFIRM 

Display yes/no confirm..

BM_RSP_KEYBOARD_ONLY 

Keyboard only.

BM_RSP_NO_INPUT_OUTPUT 

No input no output.

BM_RSP_DISPLAY_KEYBOARD 

Display keyboard.

enum _bm_status
Enumerator
BM_STATUS_POWER_ON 
BM_STATUS_SCANNING 
BM_STATUS_CONNECTING 
BM_STATUS_STANDBY 
BM_STATUS_BROADCAST 
BM_STATUS_TRANSPARENT_UART 
BM_STATUS_IDLE 
BM_STATUS_SHUTDOWN 
BM_STATUS_CONFIGURE 
BM_STATUS_CONNECTED 

Enumeration of the passkey entry actions during pairing procedure.

Enumerator
BM_PASSKEY_DIGIT_ENTER 

Passkey digit enter.

BM_PASSKEY_DIGIT_ERASE 

Passkey digit erase.

BM_PASSKEY_CLEAR 

Passkey clear.

BM_PASSKEY_ENTRY_COMPLETE 

Passkey entry complete.

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  advertiseMode 
)
void BM_APPLICATION_AdvertisementParameterSetPkt ( BM_APPLICATION_CMDPKT applicationCmdPkt,
uint8_t *  advertiseParameter 
)
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 
)
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_DiscoverCharRespEventParser ( void *  data,
uint32_t *  dataLen 
)

Parse a Discover primary service characteristic response event PRIMARY_SERVICE_CHAR_DISCOVERY_RESP.

Parameters
dataevent data.
dataLenlength of the data.
Precondition
None.
Returns
None.
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  length 
)

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