WE310F5  39.00.000
M2MB BLE DRIVER

This section describes the M2MB APIs for BLE functionality. More...

#define M2MB_BLE_MAX_DEVICE_NAME_LENGTH   (39+1)
 
#define M2MB_BLE_MAX_MANUFACTURER_NAME_LENGTH   M2MB_BLE_MAX_DEVICE_NAME_LENGTH
 
#define M2MB_BLE_FIXPIN_SIZE   6
 
#define M2MB_BLE_ADV_DATA_SIZE   31
 
#define M2MB_BLE_SCAN_RSP_DATA_SIZE   31
 
#define M2MB_BLE_BOND_ENTRIES_MAX   20
 
#define M2MB_BLE_MAX_GATT_SERVER_SERVICES   10
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_HANDLE   0x01
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_READ_NOT_PERMITTED   0x02
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_WRITE_NOT_PERMITTED   0x03
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_PDU   0x04
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_AUTHENTICATION   0x05
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_REQUEST_NOT_SUPPORTED   0x06
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_OFFSET   0x07
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_AUTHORIZATION   0x08
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_ATTRIBUTE_NOT_FOUND   0x0A
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_ATTRIBUTE_NOT_LONG   0x0B
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_ENCRYPTION_KEY_SIZE   0x0C
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_ATTRIBUTE_VALUE_LENGTH   0x0D
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_ENCRYPTION   0x0F
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_UNSUPPORTED_GROUP_TYPE   0x10
 
#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_RESOURCES   0x11
 
#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_BROADCAST   0x01
 
#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_READ   0x02
 
#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_WRITE_WITHOUT_RESPONSE   0x04
 
#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_WRITE   0x08
 
#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_NOTIFY   0x10
 
#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_INDICATE   0x20
 
#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_AUTHENTICATED_SIGNED_WRITES   0x40
 
#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_EXTENDED_PROPERTIES   0x80
 
#define M2MB_BLE_DIS_PNP_ID_VENDOR_SOURCE_BLUETOOTH_SIG   0x01
 
#define M2MB_BLE_DIS_PNP_ID_VENDOR_SOURCE_USB_IMPLEMENTORS_FORUM   0x02
 
enum  M2MB_BLE_UUID_TYPE_T {
  UUID_TYPE_16_BIT_E,
  UUID_TYPE_32_BIT_E,
  UUID_TYPE_128_BIT_E,
  UUID_INVALID_E
}
 Enumeration of UUIDs suuported. More...
 
enum  M2MB_BLE_GATT_ATTRIB_TYPE_T {
  M2MB_BLE_GATT_PRIMARY_SERVICE_E,
  M2MB_BLE_GATT_SECONDARY_SERVICE_E,
  M2MB_BLE_GATT_INCLUDED_SERVICE_E,
  M2MB_BLE_GATT_CHARACTERISTIC_E,
  M2MB_BLE_GATT_DESCRIPTOR_E
}
 Enumeration that defines GATT element type. More...
 
enum  M2MB_BLE_ADVERTISE_EVENT_TYPE_T {
  M2MB_BLE_ADV_EVT_TYPE_UNDIRECTED = 0,
  M2MB_BLE_ADV_EVT_TYPE_DIRECTED = 1,
  M2MB_BLE_ADV_EVT_TYPE_SCANNABLE = 2,
  M2MB_BLE_ADV_EVT_TYPE_NON_CONNECTABLE,
  M2MB_BLE_ADV_EVT_TYPE_SCAN_RSP
}
 Enumeration of BLE Advertise event types. More...
 
enum  M2MB_BLE_CONNECTABILITY_MODE_T {
  M2MB_BLE_NON_CONNECTABLE_E,
  M2MB_BLE_CONNECTABLE_E,
  M2MB_BLE_DIRECT_CONNECTABLE_E
}
 Enumeration of BLE connectability modes. More...
 
enum  M2MB_BLE_DISCOVERABILITY_MODE_T {
  M2MB_BLE_NON_DISCOVERABLE_MODE_E,
  M2MB_BLE_LIMITED_DISCOVERABLE_MODE_E,
  M2MB_BLE_GENERAL_DISCOVERABLE_MODE_E
}
 Enumeration of BLE discoverability modes. More...
 
enum  M2MB_BLE_PAIRABILITY_MODE_T {
  M2MB_BLE_NON_PAIRABLEMODE_E,
  M2MB_BLE_PAIRABLE_MODE_E,
  M2MB_BLE_PAIRABLE_MODE_ENABLE_EXTENDED_EVENTS_E
}
 Enumeration of BLE pairability modes. More...
 
enum  M2MB_BLE_ROLE_T {
  M2MB_BLE_PERIPHERAL_ROLE_E,
  M2MB_BLE_CENTRAL_ROLE_E,
  M2MB_BLE_DUAL_ROLE_E
}
 Enumeration of BLE roles. More...
 
enum  M2MB_BLE_PHYS_INFO_T {
  M2MB_BLE_PHYS_1M_E = 0x1,
  M2MB_BLE_PHYS_2M_E = 0x2,
  M2MB_BLE_PHYS_CODED_E = 0x4
}
 Enumeration of BLE PHY modes. More...
 
enum  M2MB_BLE_PHY_CODED_OPTIONS_T {
  M2MB_BLE_PHYS_OPTIONS_CODED_PREFER_NO,
  M2MB_BLE_PHYS_OPTIONS_CODED_PREFER_S2,
  M2MB_BLE_PHYS_OPTIONS_CODED_PREFER_S8
}
 Enumeration of BLE Coded PHY options. More...
 
enum  M2MB_BLE_ADDRESS_TYPE_T {
  M2MB_BLE_PUBLIC_E,
  M2MB_BLE_RANDOM_E,
  M2MB_BLE_RESOLVABLE_FALLBACK_PUBLIC_E,
  M2MB_BLE_RESOLVABLE_FALLBACK_PRIVATE_E,
  M2MB_BLE_ANONYMOUS_E
}
 Enumeration of BLE address types. More...
 
enum  M2MB_BLE_IO_CAPABILITY_T {
  M2MB_BLE_DISPLAY_ONLY_E,
  M2MB_BLE_DISPLAY_YES_NO_E,
  M2MB_BLE_KEYBOARD_ONLY_E,
  M2MB_BLE_NO_INPUT_NO_OUTPUT_E,
  M2MB_BLE_KEYBOARD_DISPLAY_E
}
 Enumeration of BLE IO capabilities. More...
 
enum  M2MB_BLE_CCCD_T {
  M2MB_BLE_DISABLE_INDICATION_NOTIFICATION_E,
  M2MB_BLE_ENABLE_NOTIFICATION_E,
  M2MB_BLE_ENABLE_INDICATION_E
}
 Enumeration of Notify / Indicate enable of an Client Characteristic Descriptor. More...
 
enum  M2MB_BLE_WLAN_START_MODE {
  M2MB_BLE_WLAN_AP,
  M2MB_BLE_WLAN_STA,
  M2MB_BLE_WLAN_STA_AP
}
 Enumeration for WLAN mode to start at the time of BLE initialization. More...
 
enum  M2MB_BLE_CONFIG_PARAM_T {
  M2MB_BLE_CFG_GET_E,
  M2MB_BLE_CFG_SET_E,
  M2MB_BLE_CFG_SCAN_DURATION_GET_E,
  M2MB_BLE_CFG_SCAN_DURATION_SET_E,
  M2MB_BLE_CFG_SCAN_INTERVAL_GET_E,
  M2MB_BLE_CFG_SCAN_INTERVAL_SET_E,
  M2MB_BLE_CFG_SCAN_WINDOW_GET_E,
  M2MB_BLE_CFG_SCAN_WINDOW_SET_E,
  M2MB_BLE_CFG_SCAN_FILTER_POLICY_GET_E,
  M2MB_BLE_CFG_SCAN_FILTER_POLICY_SET_E,
  M2MB_BLE_CFG_SCAN_FILTER_DUPLICATES_GET_E,
  M2MB_BLE_CFG_SCAN_FILTER_DUPLICATES_SET_E,
  M2MB_BLE_CFG_ADV_INT_MIN_GET_E,
  M2MB_BLE_CFG_ADV_INT_MIN_SET_E,
  M2MB_BLE_CFG_ADV_INT_MAX_GET_E,
  M2MB_BLE_CFG_ADV_INT_MAX_SET_E,
  M2MB_BLE_CFG_ADV_DATA_GET_E,
  M2MB_BLE_CFG_ADV_DATA_SET_E,
  M2MB_BLE_CFG_SCAN_RSP_DATA_GET_E,
  M2MB_BLE_CFG_SCAN_RSP_DATA_SET_E,
  M2MB_BLE_CFG_CONNECT_MODE_GET_E,
  M2MB_BLE_CFG_CONNECT_MODE_SET_E,
  M2MB_BLE_CFG_DISCOVER_MODE_GET_E,
  M2MB_BLE_CFG_DISCOVER_MODE_SET_E,
  M2MB_BLE_CFG_PAIR_MODE_GET_E,
  M2MB_BLE_CFG_PAIR_MODE_SET_E,
  M2MB_BLE_CFG_CONNECTION_INT_MIN_GET_E,
  M2MB_BLE_CFG_CONNECTION_INT_MIN_SET_E,
  M2MB_BLE_CFG_CONNECTION_INT_MAX_GET_E,
  M2MB_BLE_CFG_CONNECTION_INT_MAX_SET_E,
  M2MB_BLE_CFG_SLAVE_LATENCY_GET_E,
  M2MB_BLE_CFG_SLAVE_LATENCY_SET_E,
  M2MB_BLE_CFG_SUPERVISION_TIMEOUT_GET_E,
  M2MB_BLE_CFG_SUPERVISION_TIMEOUT_SET_E,
  M2MB_BLE_CFG_IOCAPABILITY_GET_E,
  M2MB_BLE_CFG_IOCAPABILITY_SET_E,
  M2MB_BLE_CFG_MITM_GET_E,
  M2MB_BLE_CFG_MITM_SET_E,
  M2MB_BLE_CFG_FIXPIN_GET_E,
  M2MB_BLE_CFG_FIXPIN_SET_E,
  M2MB_BLE_CFG_LEPRIVACY_GET_E,
  M2MB_BLE_CFG_LEPRIVACY_SET_E,
  M2MB_BLE_CFG_BOND_STORE_SUPPORT_GET_E,
  M2MB_BLE_CFG_BOND_STORE_SUPPORT_SET_E,
  M2MB_BLE_CFG_BOND_SIZE_GET_E,
  M2MB_BLE_CFG_BOND_SIZE_SET_E,
  M2MB_BLE_CFG_PNP_VERSION_ID_GET_E,
  M2MB_BLE_CFG_PNP_VERSION_ID_SET_E,
  M2MB_BLE_CFG_PNP_VERSION_ID_SOURCE_GET_E,
  M2MB_BLE_CFG_PNP_VERSION_ID_SOURCE_SET_E,
  M2MB_BLE_CFG_PNP_PRODUCT_ID_GET_E,
  M2MB_BLE_CFG_PNP_PRODUCT_ID_SET_E,
  M2MB_BLE_CFG_PNP_PRODUCT_VERSION_GET_E,
  M2MB_BLE_CFG_PNP_PRODUCT_VERSION_SET_E,
  M2MB_BLE_CFG_BLE_ROLE_GET_E,
  M2MB_BLE_CFG_BLE_ROLE_SET_E,
  M2MB_BLE_CFG_BLE_BD_ADDR_GET_E,
  M2MB_BLE_CFG_BLE_DEVICE_NAME_GET_E,
  M2MB_BLE_CFG_BLE_DEVICE_NAME_SET_E,
  M2MB_BLE_CFG_BLE_MANUFACTURER_NAME_GET_E,
  M2MB_BLE_CFG_BLE_MANUFACTURER_NAME_SET_E,
  M2MB_BLE_CFG_BLE_TIO_MODE_GET_E,
  M2MB_BLE_CFG_BLE_TIO_MODE_SET_E
}
 Enumeration of BLE configuration parameters. More...
 
enum  M2MB_BLE_USER_EVENTS_T {
  M2MB_BLE_PERIPHERAL_CONNECT_EVENT_E,
  M2MB_BLE_PERIPHERAL_DISCONNECT_EVENT_E,
  M2MB_BLE_PERIPHERAL_MTU_UPDATE_EVENT_E,
  M2MB_BLE_GATT_SERVER_READ_REQUEST_EVENT_E,
  M2MB_BLE_GATT_SERVER_WRITE_REQUEST_EVENT_E,
  M2MB_BLE_GATT_SERVER_WRITE_WITHOUT_RESPONSE_EVENT_E,
  M2MB_BLE_GATT_SERVER_NOTIFICATION_ENABLE_EVENT_E,
  M2MB_BLE_GATT_SERVER_INDICATION_ENABLE_EVENT_E,
  M2MB_BLE_GATT_SERVER_NOTIFY_INDICATE_ENABLE_EVENT_E,
  M2MB_BLE_GATT_SERVER_NOTIFY_INDICATE_DISABLE_EVENT_E,
  M2MB_BLE_SCAN_EVENT_E,
  M2MB_BLE_CENTRAL_CONNECT_EVENT_E,
  M2MB_BLE_CENTRAL_DISCONNECT_EVENT_E,
  M2MB_BLE_CENTRAL_MTU_UPDATE_EVENT_E,
  M2MB_BLE_CENTRAL_NOTIFY_INDICATE_EVENT_E,
  M2MB_BLE_CONNECT_PARAM_UPDATE_EVENT_E,
  M2MB_BLE_SSP_PIN_NOTIFICATION_EVENT_E,
  M2MB_BLE_SSP_PIN_REQUEST_EVENT_E,
  M2MB_BLE_SSP_CONF_REQUEST_EVENT_E,
  M2MB_BLE_SSP_JUST_WORKS_EVENT_E,
  M2MB_BLE_REMOTE_DEVICE_PHY_INFO_EVENT_E,
  M2MB_BLE_PHY_UPDATE_INFO_EVENT_E,
  M2MB_BLE_DATA_LEN_CHANGE_EVENT_E
}
 Enumeration of BLE events from M2MB layer to application. More...
 
enum  M2MB_BLE_CENTRAL_SCAN_FILTER_DUPLICATES_T {
  M2MB_BLE_SCAN_FILTER_DUPLICATE_DISABLE,
  M2MB_BLE_SCAN_FILTER_DUPLICATE_ENABLE
}
 Enumeration of Scan filter policy. More...
 
enum  M2MB_BLE_RESPONSE_T {
  M2MB_BLE_STATUS_SUCCESS_E,
  M2MB_BLE_STATUS_FAILURE_E,
  M2MB_BLE_STATUS_OUT_OF_RANGE_E,
  M2MB_BLE_STATUS_NOT_READY_E,
  M2MB_BLE_STATUS_UNSUPPORTED_E,
  M2MB_BLE_STATUS_PARAM_INVALID_E,
  M2MB_BLE_STATUS_NO_MEM_E,
  M2MB_BLE_STATUS_AUTH_FAILURE_E,
  M2MB_BLE_STATUS_AUTH_REJECTED_E,
  M2MB_BLE_STATUS_INVALID_E,
  M2MB_BLE_STATUS_ERR_INVALID_HANDLE_E,
  M2MB_BLE_STATUS_ERR_READ_NOT_PERMITTED_E,
  M2MB_BLE_STATUS_ERR_WRITE_NOT_PERMITTED_E,
  M2MB_BLE_STATUS_ERR_INVALID_PDU_E,
  M2MB_BLE_STATUS_ERR_REQUEST_NOT_SUPPORTED_E,
  M2MB_BLE_STATUS_ERR_INVALID_OFFSET_E,
  M2MB_BLE_STATUS_ERR_ATTRIBUTE_NOT_FOUND_E,
  M2MB_BLE_STATUS_ERR_INVALID_ATTRIBUTE_VALUE_LENGTH_E,
  M2MB_BLE_STATUS_ERR_OUT_OF_ORDER_E,
  M2MB_BLE_STATUS_ERR_INSUFFICIENT_AUTHORIZATION_E,
  M2MB_BLE_STATUS_ERR_INSUFFICIENT_AUTHENTICATION_E,
  M2MB_BLE_STATUS_ERR_INSUFFICIENT_ENCRYPTION_E
}
 Enumeration of BLE response status types. More...
 
enum  M2MB_BLE_ADV_TYPE_T {
  M2MB_BLE_ADVERTISE_ON_WITH_CUSTOMIZED_ADV_DISABLE,
  M2MB_BLE_ADVERTISE_ON_WITH_CUSTOMIZED_ADV_ENABLE,
  M2MB_BLE_ADVERTISE_OFF
}
 Enumeration of BLE advertisement types. More...
 
typedef struct M2MB_BLE_UUID_16_S M2MB_BLE_UUID_16_T
 Structure for 16 bit UUID. More...
 
typedef struct M2MB_BLE_UUID_32_S M2MB_BLE_UUID_32_T
 Structure for 32 bit UUID. More...
 
typedef struct M2MB_BLE_UUID_128_S M2MB_BLE_UUID_128_T
 Structure for 128 bit UUID. More...
 
typedef struct M2MB_BLE_UUID_S M2MB_BLE_UUID_T
 Structure which holds 16 bit / 32 bit / 128 bit UUID value. More...
 
typedef struct M2MB_BLE_GATT_ELEMENT_S M2MB_BLE_GATT_ELEMENT_T
 Structure which stores all information of an GATT element. More...
 
typedef struct M2MB_BLE_GATT_SRVD_S M2MB_BLE_GATT_SRVD_T
 Structure which contains GATT element information. More...
 
typedef struct M2MB_BLE_BD_ADDR_S M2MB_BLE_BD_ADDR_T
 Structure to store BLE address. More...
 
typedef INT8 M2MB_BLE_BOARDSTR_T[16]
 Type definition to hold Bluetooth device name in string format. More...
 
typedef struct M2MB_BLE_BD_NAME_S M2MB_BLE_BD_NAME_T
 Structure to store Bluetooth device name. More...
 
typedef struct M2MB_BLE_CENTRAL_CFG_S M2MB_BLE_CENTRAL_CFG_T
 Structure for BLE central configuration parameters. More...
 
typedef struct M2MB_BLE_PERIPHERAL_CFG_S M2MB_BLE_PERIPHERAL_CFG_T
 Structure for BLE peripheral configuration parameters. More...
 
typedef struct M2MB_BLE_CONN_PARAM_S M2MB_BLE_CONN_PARAM_T
 Structure for BLE connection parameters configuration. More...
 
typedef struct M2MB_BLE_SECURITY_CFG_S M2MB_BLE_SECURITY_CFG_T
 Structure for BLE security configuration parameters. More...
 
typedef struct M2MB_BLE_DIS_INFO_S M2MB_BLE_DIS_INFO_T
 Structure for BLE Device information service configuration parameters. More...
 
typedef struct M2MB_BLE_GENERAL_PARAM_S M2MB_BLE_GENERAL_PARAM_T
 Structure for BLE generic configuration parameters. More...
 
typedef struct M2MB_BLE_CGF_S M2MB_BLE_CGF_T
 Structure for all BLE configuration parameters. More...
 
typedef struct M2MB_BLE_SCAN_REPORT_DATA_S M2MB_BLE_SCAN_REPORT_DATA_T
 Structure for scan results in Central mode. More...
 
typedef struct M2MB_BLE_CENTRAL_NOTIFY_INDICATE_DATA_S M2MB_BLE_CENTRAL_NOTIFY_INDICATE_DATA_T
 Structure to hold notification and indication data from remote GATT server. More...
 
typedef struct M2MB_BLE_GATT_SERVER_EVENT_DETAILS_S M2MB_BLE_GATT_SERVER_EVENT_DETAILS_T
 Structure to hold information for a GATT server event. More...
 
typedef struct M2MB_BLE_USER_EVENT_CTX_S M2MB_BLE_USER_EVENT_CTX_T
 Structure to hold all the information required related to an event notified to the application. More...
 
typedef struct M2MB_BLE_DEVICE_INFO_S M2MB_BLE_DEVICE_INFO_T
 Structure to hold connected peer BLE device information. More...
 
typedef HANDLE M2MB_BLE_HANDLE
 Type definition for BLE handle. More...
 
typedef struct M2MB_BLE_BOND_LIST_INFO_S M2MB_BLE_BOND_LIST_INFO_T
 Structure to hold information of bonded devices. More...
 
typedef void(* m2mb_ble_event_callback) (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_USER_EVENTS_T ble_event, UINT16 resp_size, void *resp, void *userdata)
 BLE callback function prototype. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_initialize (M2MB_BLE_HANDLE *ble_handle, m2mb_ble_event_callback ble_callback, void *user_data)
 BLE stack initialization. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_shutdown (M2MB_BLE_HANDLE ble_handle)
 BLE stack shutdown. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_conf (M2MB_BLE_HANDLE ble_handle, UINT8 num_cmds,...)
 BLE configuration GET / SET. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_ssppin_reply (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_BD_ADDR_T bd_addr, M2MB_BLE_ADDRESS_TYPE_T bd_addr_type, INT32 ssppin, UINT8 accept_flag)
 SSP Pin reply used as part of BLE pairing procedure. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_sspconf_reply (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_BD_ADDR_T bd_addr, M2MB_BLE_ADDRESS_TYPE_T bd_addr_type, UINT32 confirmation_flag)
 SSP CONF reply used as part of BLE pairing procedure. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_bond_list_get (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_BOND_LIST_INFO_T *bond_list_info, UINT32 *num_of_entries)
 Gets the list of bonded devices. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_bond_delete (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_BD_ADDR_T bd_addr)
 Deletes the bond information of a BLE device from the bonded list. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_advertise (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_ADV_TYPE_T adv_type)
 BLE advertise start and stop funtion. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_gatts_secure_ccccd (M2MB_BLE_HANDLE ble_handle)
 Secure all client characteristic descriptors of a new service. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_gatts_service_add (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_UUID_T service_uuid)
 Add a new BLE GATT service. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_gatts_characteristic_add (M2MB_BLE_HANDLE ble_handle, UINT8 properties, M2MB_BLE_UUID_T characteristic_uuid)
 Add BLE GATT characteristic in a service. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_gatts_characteristic_value_add (M2MB_BLE_HANDLE ble_handle, UINT16 permissions, UINT16 value_len, UINT8 *value, UINT32 *characteristic_id)
 Add BLE GATT characteristic value in a service. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_gatts_complete (M2MB_BLE_HANDLE ble_handle, UINT32 *service_id)
 Stop adding new characteristics to a GATT service. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_gatts_serv_send_data (M2MB_BLE_HANDLE ble_handle, UINT32 serv_id, UINT32 char_id, UINT8 *value, UINT16 value_len, M2MB_BLE_CCCD_T cccd)
 Send GATT server data to remote GATT client. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_scan_start (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_BD_ADDR_T bd_addr)
 Start to scan for BLE devices. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_scan_stop (M2MB_BLE_HANDLE ble_handle)
 Stop the BLE device scaning. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_connect (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_BD_ADDR_T bd_addr, M2MB_BLE_ADDRESS_TYPE_T bd_addr_type, INT32 *connection_id)
 Connect to a BLE peripheral device. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_disconnect (M2MB_BLE_HANDLE ble_handle, INT32 connection_id)
 Disconnects from a connected BLE peripheral device. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_start_discovery (M2MB_BLE_HANDLE ble_handle, INT32 connection_id, M2MB_BLE_UUID_T uuid, M2MB_BLE_GATT_SRVD_T *results)
 Discovery of services and characteristics of a GATT server. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_read_value_request (M2MB_BLE_HANDLE ble_handle, INT32 connection_id, INT32 char_handle, UINT8 **value, UINT16 *value_len)
 Read value request on a discovered characteristic. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_write_value_request (M2MB_BLE_HANDLE ble_handle, INT32 connection_id, INT32 char_handle, UINT8 *value, UINT16 value_len)
 Write value request on a discovered characteristic. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_write_value_command (M2MB_BLE_HANDLE ble_handle, INT32 connection_id, INT32 char_handle, UINT8 *value, UINT16 value_len)
 Write command on a discovered characteristic. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_cccd_request (M2MB_BLE_HANDLE ble_handle, INT32 connection_id, INT32 char_handle, M2MB_BLE_CCCD_T cccd_val)
 Enables and disables a Notication/Indication on a client characteristic descriptor. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_set_phy (M2MB_BLE_HANDLE ble_handle, UINT8 conn_id, M2MB_BLE_PHYS_INFO_T phy_pref, M2MB_BLE_PHY_CODED_OPTIONS_T phy_coded_options)
 Set the PHY options. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_data_len_set (M2MB_BLE_HANDLE ble_handle, UINT8 conn_id, UINT16 tx_octets)
 Set data length used in Link Layer for data length extension. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_connid_device_info_get (M2MB_BLE_HANDLE ble_handle, UINT8 conn_id, M2MB_BLE_DEVICE_INFO_T *dev_info)
 Get connected peer device information using connection ID. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_bdaddr_device_info_get (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_BD_ADDR_T bd_addr, M2MB_BLE_DEVICE_INFO_T *dev_info)
 Get connected peer device information using remote BD address. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_central_initiate_pairing (M2MB_BLE_HANDLE ble_handle, UINT8 conn_id)
 Initiate pairing to a connected device in Central mode. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_wlan_config_set (M2MB_BLE_WLAN_START_MODE wlan_start_mode)
 WLAN mode to start at the time of BLE initialization. More...
 

Detailed Description

This section describes the M2MB APIs for BLE functionality.

This section describes the M2MB BLE utility APIs.

BLE stands for Bluetooth Low Energy(Bluetooth LE,and marketed as Bluetooth Smart). BLE is a form of wireless communication designed specially for short range communication. BLE is very similar to Wi-Fi in the sense that it allows devices to communicate with each other.However, BLE is meant for situations where battery life is preferred over high data transfer speeds.

M2MB BLE utility functions.

Macro Definition Documentation

◆ M2MB_BLE_ADV_DATA_SIZE

#define M2MB_BLE_ADV_DATA_SIZE   31

Advertise data size

Definition at line 57 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_ATTRIBUTE_NOT_FOUND

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_ATTRIBUTE_NOT_FOUND   0x0A

Attribute not found error

Definition at line 71 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_ATTRIBUTE_NOT_LONG

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_ATTRIBUTE_NOT_LONG   0x0B

Attribute not long error

Definition at line 72 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_AUTHENTICATION

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_AUTHENTICATION   0x05

Insufficient Authentication error

Definition at line 67 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_AUTHORIZATION

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_AUTHORIZATION   0x08

Insufficient authorization error

Definition at line 70 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_ENCRYPTION

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_ENCRYPTION   0x0F

Insufficient encryption error

Definition at line 75 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_ENCRYPTION_KEY_SIZE

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_ENCRYPTION_KEY_SIZE   0x0C

Insufficient encryption key size error

Definition at line 73 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_RESOURCES

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_RESOURCES   0x11

Insufficient resources error

Definition at line 77 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_ATTRIBUTE_VALUE_LENGTH

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_ATTRIBUTE_VALUE_LENGTH   0x0D

Invalid attribute value length error

Definition at line 74 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_HANDLE

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_HANDLE   0x01

Invalid handle error

Definition at line 63 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_OFFSET

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_OFFSET   0x07

Invalid offset error

Definition at line 69 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_PDU

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INVALID_PDU   0x04

Invalid PDU error

Definition at line 66 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_READ_NOT_PERMITTED

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_READ_NOT_PERMITTED   0x02

Read not permitted error

Definition at line 64 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_REQUEST_NOT_SUPPORTED

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_REQUEST_NOT_SUPPORTED   0x06

Request not suuported error

Definition at line 68 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_UNSUPPORTED_GROUP_TYPE

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_UNSUPPORTED_GROUP_TYPE   0x10

Unsupported group type error

Definition at line 76 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_WRITE_NOT_PERMITTED

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_WRITE_NOT_PERMITTED   0x03

Write not permitted error

Definition at line 65 of file m2mb_ble_driver.h.

◆ M2MB_BLE_BOND_ENTRIES_MAX

#define M2MB_BLE_BOND_ENTRIES_MAX   20

Maximum bond entries

Definition at line 59 of file m2mb_ble_driver.h.

◆ M2MB_BLE_DIS_PNP_ID_VENDOR_SOURCE_BLUETOOTH_SIG

#define M2MB_BLE_DIS_PNP_ID_VENDOR_SOURCE_BLUETOOTH_SIG   0x01

Definition at line 92 of file m2mb_ble_driver.h.

◆ M2MB_BLE_DIS_PNP_ID_VENDOR_SOURCE_USB_IMPLEMENTORS_FORUM

#define M2MB_BLE_DIS_PNP_ID_VENDOR_SOURCE_USB_IMPLEMENTORS_FORUM   0x02

Definition at line 93 of file m2mb_ble_driver.h.

◆ M2MB_BLE_FIXPIN_SIZE

#define M2MB_BLE_FIXPIN_SIZE   6

BLE Fix pin size

Definition at line 56 of file m2mb_ble_driver.h.

◆ M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_AUTHENTICATED_SIGNED_WRITES

#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_AUTHENTICATED_SIGNED_WRITES   0x40

Property: Authenticated signed writes

Definition at line 85 of file m2mb_ble_driver.h.

◆ M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_BROADCAST

#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_BROADCAST   0x01

Property: Broadcast

Definition at line 79 of file m2mb_ble_driver.h.

◆ M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_EXTENDED_PROPERTIES

#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_EXTENDED_PROPERTIES   0x80

Property: Extended properties The following values define the valid values that the Vendor ID Source field of the DIS PNP characteristic may contain.

Definition at line 86 of file m2mb_ble_driver.h.

◆ M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_INDICATE

#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_INDICATE   0x20

Property: Indicate

Definition at line 84 of file m2mb_ble_driver.h.

◆ M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_NOTIFY

#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_NOTIFY   0x10

Property: Notify

Definition at line 83 of file m2mb_ble_driver.h.

◆ M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_READ

#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_READ   0x02

Property: Read

Definition at line 80 of file m2mb_ble_driver.h.

◆ M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_WRITE

#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_WRITE   0x08

Property: Write

Definition at line 82 of file m2mb_ble_driver.h.

◆ M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_WRITE_WITHOUT_RESPONSE

#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_WRITE_WITHOUT_RESPONSE   0x04

Property: Write without response

Definition at line 81 of file m2mb_ble_driver.h.

◆ M2MB_BLE_MAX_DEVICE_NAME_LENGTH

#define M2MB_BLE_MAX_DEVICE_NAME_LENGTH   (39+1)

Maximum length of BLE Device name

Definition at line 54 of file m2mb_ble_driver.h.

◆ M2MB_BLE_MAX_GATT_SERVER_SERVICES

#define M2MB_BLE_MAX_GATT_SERVER_SERVICES   10

Maximum GATT services supported

Definition at line 61 of file m2mb_ble_driver.h.

◆ M2MB_BLE_MAX_MANUFACTURER_NAME_LENGTH

#define M2MB_BLE_MAX_MANUFACTURER_NAME_LENGTH   M2MB_BLE_MAX_DEVICE_NAME_LENGTH

Maximum length of manufactureres name

Definition at line 55 of file m2mb_ble_driver.h.

◆ M2MB_BLE_SCAN_RSP_DATA_SIZE

#define M2MB_BLE_SCAN_RSP_DATA_SIZE   31

Scan response data size

Definition at line 58 of file m2mb_ble_driver.h.

Typedef Documentation

◆ M2MB_BLE_BD_ADDR_T

Structure to store BLE address.

Structure for storing BLE MAC address. IF In BLE MAC Addr = 0xAABBCCDDEEFF, then BD_ADDR0 = 0xAA and BD_ADDR5 = 0xFF.

◆ M2MB_BLE_BD_NAME_T

Structure to store Bluetooth device name.

Structure for storing Bluetooth device name.

◆ M2MB_BLE_BOARDSTR_T

typedef INT8 M2MB_BLE_BOARDSTR_T[16]

Type definition to hold Bluetooth device name in string format.

Type definition to hold Bluetooth device name in string format.

Definition at line 380 of file m2mb_ble_driver.h.

◆ M2MB_BLE_BOND_LIST_INFO_T

Structure to hold information of bonded devices.

Structure to hold information of bonded devices.

◆ M2MB_BLE_CENTRAL_CFG_T

Structure for BLE central configuration parameters.

Structure for BLE central configuration parameters.

◆ M2MB_BLE_CENTRAL_NOTIFY_INDICATE_DATA_T

Structure to hold notification and indication data from remote GATT server.

Structure to hold notification and indication data from remote GATT server.

◆ M2MB_BLE_CGF_T

Structure for all BLE configuration parameters.

Structure for all BLE configuration parameters.

◆ M2MB_BLE_CONN_PARAM_T

Structure for BLE connection parameters configuration.

Structure for BLE connection parameters configuration. These parameters are used by the central after the connection is established.

◆ M2MB_BLE_DEVICE_INFO_T

Structure to hold connected peer BLE device information.

Structure to hold connected peer BLE device information both in Central and Peripheral mode.

◆ M2MB_BLE_DIS_INFO_T

Structure for BLE Device information service configuration parameters.

Structure for BLE Device information service configuration parameters.

◆ m2mb_ble_event_callback

typedef void(* m2mb_ble_event_callback) (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_USER_EVENTS_T ble_event, UINT16 resp_size, void *resp, void *userdata)

BLE callback function prototype.

Type definition of the user callback to receive asynchronous events from BLE driver. ble_handle represents ble handle, ble_event represents BLE asynchronous events from BLE driver, resp_size represents size of response, resp represents the data from BLE stack userdata represents the user data context

Definition at line 883 of file m2mb_ble_driver.h.

◆ M2MB_BLE_GATT_ELEMENT_T

Structure which stores all information of an GATT element.

Structure for storing all information of an GATT element. This structure is used for service discovery feature.

◆ M2MB_BLE_GATT_SERVER_EVENT_DETAILS_T

Structure to hold information for a GATT server event.

Structure to hold information for a GATT server event.

◆ M2MB_BLE_GATT_SRVD_T

Structure which contains GATT element information.

Structure which contains GATT element information. This structure is used for service discovery feature.

◆ M2MB_BLE_GENERAL_PARAM_T

Structure for BLE generic configuration parameters.

Structure for BLE generic configuration parameters.

◆ M2MB_BLE_HANDLE

Type definition for BLE handle.

Type definition for BLE handle. This BLE handle is provided from M2MB to application at the time of BLE init.

Definition at line 813 of file m2mb_ble_driver.h.

◆ M2MB_BLE_PERIPHERAL_CFG_T

Structure for BLE peripheral configuration parameters.

Structure for BLE peripheral configuration parameters.

◆ M2MB_BLE_SCAN_REPORT_DATA_T

Structure for scan results in Central mode.

Structure for scan results in Central mode. When scan for BLE devices, the list of scanned devices information is sent to the application in this format.

◆ M2MB_BLE_SECURITY_CFG_T

Structure for BLE security configuration parameters.

Structure for BLE security configuration parameters.

◆ M2MB_BLE_USER_EVENT_CTX_T

Structure to hold all the information required related to an event notified to the application.

Structure to hold all the information required related to an event notified to the application. This context information is sent to registerd callback with event type.

◆ M2MB_BLE_UUID_128_T

Structure for 128 bit UUID.

Structure for storing 128 bit UUID. IF UUID = 0x00112233445566778899AABBCCDDEEFF, then UUID_Byte0 = 0x00, UUID_Byte1 = 0x11 ..... UUID_Byte14 = 0xEE, UUID_Byte15 = 0xFF.

◆ M2MB_BLE_UUID_16_T

Structure for 16 bit UUID.

Structure for storing 16 bit UUID. IF UUID = 0xAABB, then UUID_Byte0 = 0xAA, UUID_Byte1 = 0xBB.

◆ M2MB_BLE_UUID_32_T

Structure for 32 bit UUID.

Structure for storing 32 bit UUID. IF UUID = 0xAABBCCDD, then UUID_Byte0 = 0xAA, UUID_Byte1 = 0xBB, UUID_Byte2 = 0xCC, UUID_Byte3 = 0xDD.

◆ M2MB_BLE_UUID_T

Structure which holds 16 bit / 32 bit / 128 bit UUID value.

Structure for storing 16 bit / 32 bit / 128 bit UUID value.

Enumeration Type Documentation

◆ M2MB_BLE_ADDRESS_TYPE_T

Enumeration of BLE address types.

Enumeration of BLE address types.

Enumerator
M2MB_BLE_PUBLIC_E 

Indicates a public identity address. Indicates a random identity address.

M2MB_BLE_RANDOM_E 

Indicates the local use of a resolvable private address with the fall-back of using the devices public address.

M2MB_BLE_RESOLVABLE_FALLBACK_PUBLIC_E 

Indicates the local use of a resolvable private address with the fall-back of using currently configured random address.

M2MB_BLE_RESOLVABLE_FALLBACK_PRIVATE_E 

Indicates that address is that of anonymous device (address not present in advertising packet.

M2MB_BLE_ANONYMOUS_E 

Definition at line 313 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ADV_TYPE_T

Enumeration of BLE advertisement types.

Enumeration of BLE advertisement types.

Enumerator
M2MB_BLE_ADVERTISE_ON_WITH_CUSTOMIZED_ADV_DISABLE 

Advertisement ON with customize advertise data enable

M2MB_BLE_ADVERTISE_ON_WITH_CUSTOMIZED_ADV_ENABLE 

Advertisement ON with customize advertise data disable

M2MB_BLE_ADVERTISE_OFF 

Advertisement OFF

Definition at line 865 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ADVERTISE_EVENT_TYPE_T

Enumeration of BLE Advertise event types.

Enumeration of BLE Advertise event types.

Enumerator
M2MB_BLE_ADV_EVT_TYPE_UNDIRECTED 

Connectable undirected advertising.

M2MB_BLE_ADV_EVT_TYPE_DIRECTED 

Connectable directed advertising.

M2MB_BLE_ADV_EVT_TYPE_SCANNABLE 

Scanable undirected advertising.

M2MB_BLE_ADV_EVT_TYPE_NON_CONNECTABLE 

Nonconnectable undirected advertising.

M2MB_BLE_ADV_EVT_TYPE_SCAN_RSP 

scan response.

Definition at line 226 of file m2mb_ble_driver.h.

◆ M2MB_BLE_CCCD_T

Enumeration of Notify / Indicate enable of an Client Characteristic Descriptor.

Enumeration that identifies Notify / Indicate enable of an Client Characteristic Descriptor.

Enumerator
M2MB_BLE_DISABLE_INDICATION_NOTIFICATION_E 

Disable notification and indication

M2MB_BLE_ENABLE_NOTIFICATION_E 

Enable notification

M2MB_BLE_ENABLE_INDICATION_E 

Enable indication

Definition at line 398 of file m2mb_ble_driver.h.

◆ M2MB_BLE_CENTRAL_SCAN_FILTER_DUPLICATES_T

Enumeration of Scan filter policy.

Enumeration of Scan filter policy.

Enumerator
M2MB_BLE_SCAN_FILTER_DUPLICATE_DISABLE 

Duplicate filtering disabled.

M2MB_BLE_SCAN_FILTER_DUPLICATE_ENABLE 

Duplicate filtering enabled.

Definition at line 682 of file m2mb_ble_driver.h.

◆ M2MB_BLE_CONFIG_PARAM_T

Enumeration of BLE configuration parameters.

Enumeration of BLE configuration parameters. All BLE configuration parameters can be set or get using m2mb_ble_conf() function

Enumerator
M2MB_BLE_CFG_GET_E 

All BLE configuration parametrs GET

M2MB_BLE_CFG_SET_E 

All BLE configuration parametrs SET

M2MB_BLE_CFG_SCAN_DURATION_GET_E 

Scan duration GET

M2MB_BLE_CFG_SCAN_DURATION_SET_E 

Scan duration SET

M2MB_BLE_CFG_SCAN_INTERVAL_GET_E 

Scan Interval GET

M2MB_BLE_CFG_SCAN_INTERVAL_SET_E 

Scan Interval SET

M2MB_BLE_CFG_SCAN_WINDOW_GET_E 

Scan window GET

M2MB_BLE_CFG_SCAN_WINDOW_SET_E 

Scan window SET

M2MB_BLE_CFG_SCAN_FILTER_POLICY_GET_E 

Scan Filter policy GET

M2MB_BLE_CFG_SCAN_FILTER_POLICY_SET_E 

Scan Filter policy SET

M2MB_BLE_CFG_SCAN_FILTER_DUPLICATES_GET_E 

Scan Filter duplicates GET

M2MB_BLE_CFG_SCAN_FILTER_DUPLICATES_SET_E 

Scan Filter duplicates SET

M2MB_BLE_CFG_ADV_INT_MIN_GET_E 

Advertise interval minimum GET

M2MB_BLE_CFG_ADV_INT_MIN_SET_E 

Advertise interval minimum SET

M2MB_BLE_CFG_ADV_INT_MAX_GET_E 

Advertise interval maximum GET

M2MB_BLE_CFG_ADV_INT_MAX_SET_E 

Advertise interval maximum SET

M2MB_BLE_CFG_ADV_DATA_GET_E 

Advetrise data GET

M2MB_BLE_CFG_ADV_DATA_SET_E 

Advetrise data SET

M2MB_BLE_CFG_SCAN_RSP_DATA_GET_E 

Scan response data GET

M2MB_BLE_CFG_SCAN_RSP_DATA_SET_E 

Scan response data SET

M2MB_BLE_CFG_CONNECT_MODE_GET_E 

Connection mode GET

M2MB_BLE_CFG_CONNECT_MODE_SET_E 

Connection mode SET

M2MB_BLE_CFG_DISCOVER_MODE_GET_E 

Discover mode GET

M2MB_BLE_CFG_DISCOVER_MODE_SET_E 

Discover mode SET

M2MB_BLE_CFG_PAIR_MODE_GET_E 

Pair mode GET

M2MB_BLE_CFG_PAIR_MODE_SET_E 

Pair mode SET

M2MB_BLE_CFG_CONNECTION_INT_MIN_GET_E 

Connection interval minimum GET

M2MB_BLE_CFG_CONNECTION_INT_MIN_SET_E 

Connection interval minimum SET

M2MB_BLE_CFG_CONNECTION_INT_MAX_GET_E 

Connection interval maximum GET

M2MB_BLE_CFG_CONNECTION_INT_MAX_SET_E 

Connection interval maximum SET

M2MB_BLE_CFG_SLAVE_LATENCY_GET_E 

Slave latency GET

M2MB_BLE_CFG_SLAVE_LATENCY_SET_E 

Slave latency SET

M2MB_BLE_CFG_SUPERVISION_TIMEOUT_GET_E 

Supervision timeout GET

M2MB_BLE_CFG_SUPERVISION_TIMEOUT_SET_E 

Supervision timeout SET

M2MB_BLE_CFG_IOCAPABILITY_GET_E 

IO capabilities GET

M2MB_BLE_CFG_IOCAPABILITY_SET_E 

IO capabilities SET

M2MB_BLE_CFG_MITM_GET_E 

MITM GET

M2MB_BLE_CFG_MITM_SET_E 

MITM SET

M2MB_BLE_CFG_FIXPIN_GET_E 

Fix pin GET

M2MB_BLE_CFG_FIXPIN_SET_E 

Fix pin SET

M2MB_BLE_CFG_LEPRIVACY_GET_E 

LE Privacy GET

M2MB_BLE_CFG_LEPRIVACY_SET_E 

LE Privacy SET

M2MB_BLE_CFG_BOND_STORE_SUPPORT_GET_E 

Bond strore support GET

M2MB_BLE_CFG_BOND_STORE_SUPPORT_SET_E 

Bond strore support SET

M2MB_BLE_CFG_BOND_SIZE_GET_E 

Bond size GET

M2MB_BLE_CFG_BOND_SIZE_SET_E 

Bond size SET

M2MB_BLE_CFG_PNP_VERSION_ID_GET_E 

PNP Version ID GET

M2MB_BLE_CFG_PNP_VERSION_ID_SET_E 

PNP Version ID SET

M2MB_BLE_CFG_PNP_VERSION_ID_SOURCE_GET_E 

PNP Version ID source GET

M2MB_BLE_CFG_PNP_VERSION_ID_SOURCE_SET_E 

PNP Version ID source SET

M2MB_BLE_CFG_PNP_PRODUCT_ID_GET_E 

PNP product ID GET

M2MB_BLE_CFG_PNP_PRODUCT_ID_SET_E 

PNP product ID SET

M2MB_BLE_CFG_PNP_PRODUCT_VERSION_GET_E 

PNP product version GET

M2MB_BLE_CFG_PNP_PRODUCT_VERSION_SET_E 

PNP product version SET

M2MB_BLE_CFG_BLE_ROLE_GET_E 

BLE role GET

M2MB_BLE_CFG_BLE_ROLE_SET_E 

BLE role SET

M2MB_BLE_CFG_BLE_BD_ADDR_GET_E 

BD address GET

M2MB_BLE_CFG_BLE_DEVICE_NAME_GET_E 

DEVICE name GET

M2MB_BLE_CFG_BLE_DEVICE_NAME_SET_E 

DEVICE name SET

M2MB_BLE_CFG_BLE_MANUFACTURER_NAME_GET_E 

Manfacturer name GET

M2MB_BLE_CFG_BLE_MANUFACTURER_NAME_SET_E 

Manfacturer name SET

M2MB_BLE_CFG_BLE_TIO_MODE_GET_E 

TIO mode GET

M2MB_BLE_CFG_BLE_TIO_MODE_SET_E 

TIO mode SET

Definition at line 427 of file m2mb_ble_driver.h.

◆ M2MB_BLE_CONNECTABILITY_MODE_T

Enumeration of BLE connectability modes.

Enumeration of BLE connectability modes.

Enumerator
M2MB_BLE_NON_CONNECTABLE_E 

non-connectable mode.

M2MB_BLE_CONNECTABLE_E 

connectable mode.

M2MB_BLE_DIRECT_CONNECTABLE_E 

directed connectable mode.

Definition at line 240 of file m2mb_ble_driver.h.

◆ M2MB_BLE_DISCOVERABILITY_MODE_T

Enumeration of BLE discoverability modes.

Enumeration of BLE discoverability modes.

Enumerator
M2MB_BLE_NON_DISCOVERABLE_MODE_E 

Non-discoverable mode.

M2MB_BLE_LIMITED_DISCOVERABLE_MODE_E 

Limited-discoverable mode.

M2MB_BLE_GENERAL_DISCOVERABLE_MODE_E 

General-discoverable mode.

Definition at line 252 of file m2mb_ble_driver.h.

◆ M2MB_BLE_GATT_ATTRIB_TYPE_T

Enumeration that defines GATT element type.

Enumeration that defines GATT element types.

Enumerator
M2MB_BLE_GATT_PRIMARY_SERVICE_E 

Primary service

M2MB_BLE_GATT_SECONDARY_SERVICE_E 

Secondary service

M2MB_BLE_GATT_INCLUDED_SERVICE_E 

Included service

M2MB_BLE_GATT_CHARACTERISTIC_E 

Characteristic

M2MB_BLE_GATT_DESCRIPTOR_E 

Characteristic Descriptor

Definition at line 183 of file m2mb_ble_driver.h.

◆ M2MB_BLE_IO_CAPABILITY_T

Enumeration of BLE IO capabilities.

Enumeration of BLE IO capabilities which are used during pairing procedure.

Enumerator
M2MB_BLE_DISPLAY_ONLY_E 

Indicates device can only display a value. Indicates device can only display a value and ask a yes/no confirmation.

M2MB_BLE_DISPLAY_YES_NO_E 

Indicates device can only input a value.

M2MB_BLE_KEYBOARD_ONLY_E 

Indicates device has no input and no output capability.

M2MB_BLE_NO_INPUT_NO_OUTPUT_E 

Indicates device can both input and display a value.

M2MB_BLE_KEYBOARD_DISPLAY_E 

Definition at line 339 of file m2mb_ble_driver.h.

◆ M2MB_BLE_PAIRABILITY_MODE_T

Enumeration of BLE pairability modes.

Enumeration of BLE pairability modes.

Enumerator
M2MB_BLE_NON_PAIRABLEMODE_E 

Non-pairable mode.

M2MB_BLE_PAIRABLE_MODE_E 

Pairable mode.

M2MB_BLE_PAIRABLE_MODE_ENABLE_EXTENDED_EVENTS_E 

Pairable mode with enabling of extended events.

Definition at line 264 of file m2mb_ble_driver.h.

◆ M2MB_BLE_PHY_CODED_OPTIONS_T

Enumeration of BLE Coded PHY options.

Enumeration of BLE Coded PHY options.

Enumerator
M2MB_BLE_PHYS_OPTIONS_CODED_PREFER_NO 

Host has no preferred coding when transmitting on the LE Coded PHY

M2MB_BLE_PHYS_OPTIONS_CODED_PREFER_S2 

Host prefers that S=2 coding be used when transmitting on the LE Coded PHY

M2MB_BLE_PHYS_OPTIONS_CODED_PREFER_S8 

Host prefers that S=8 coding be used when transmitting on the LE Coded PHY

Definition at line 300 of file m2mb_ble_driver.h.

◆ M2MB_BLE_PHYS_INFO_T

Enumeration of BLE PHY modes.

Enumeration of BLE PHY modes.

Enumerator
M2MB_BLE_PHYS_1M_E 

The Host prefers to use the LE 1M PHY (possibly among others)

M2MB_BLE_PHYS_2M_E 

The Host prefers to use the LE 2M PHY (possibly among others)

M2MB_BLE_PHYS_CODED_E 

The Host prefers to use the LE Coded PHY (possibly among others)

Definition at line 288 of file m2mb_ble_driver.h.

◆ M2MB_BLE_RESPONSE_T

Enumeration of BLE response status types.

Enumeration of BLE response status types.

Enumerator
M2MB_BLE_STATUS_SUCCESS_E 

Success

M2MB_BLE_STATUS_FAILURE_E 

Failure

M2MB_BLE_STATUS_OUT_OF_RANGE_E 

Out of range

M2MB_BLE_STATUS_NOT_READY_E 

Not ready

M2MB_BLE_STATUS_UNSUPPORTED_E 

operation not supported

M2MB_BLE_STATUS_PARAM_INVALID_E 

invalid param

M2MB_BLE_STATUS_NO_MEM_E 

no memory

M2MB_BLE_STATUS_AUTH_FAILURE_E 

Authentication failure

M2MB_BLE_STATUS_AUTH_REJECTED_E 

Authentication rejected

M2MB_BLE_STATUS_INVALID_E 

invalid operation

M2MB_BLE_STATUS_ERR_INVALID_HANDLE_E 

Invalid handle

M2MB_BLE_STATUS_ERR_READ_NOT_PERMITTED_E 

Read not permitted

M2MB_BLE_STATUS_ERR_WRITE_NOT_PERMITTED_E 

Write not permitted

M2MB_BLE_STATUS_ERR_INVALID_PDU_E 

Invalid PDU

M2MB_BLE_STATUS_ERR_REQUEST_NOT_SUPPORTED_E 

GATT request not supported

M2MB_BLE_STATUS_ERR_INVALID_OFFSET_E 

invalid data offset

M2MB_BLE_STATUS_ERR_ATTRIBUTE_NOT_FOUND_E 

Attribute not found

M2MB_BLE_STATUS_ERR_INVALID_ATTRIBUTE_VALUE_LENGTH_E 

invalid attribute value length

M2MB_BLE_STATUS_ERR_OUT_OF_ORDER_E 

out of order

M2MB_BLE_STATUS_ERR_INSUFFICIENT_AUTHORIZATION_E 

insufficient authorization

M2MB_BLE_STATUS_ERR_INSUFFICIENT_AUTHENTICATION_E 

insufficient authentication

M2MB_BLE_STATUS_ERR_INSUFFICIENT_ENCRYPTION_E 

insufficient encryption

Definition at line 820 of file m2mb_ble_driver.h.

◆ M2MB_BLE_ROLE_T

Enumeration of BLE roles.

Enumeration of BLE roles.

Enumerator
M2MB_BLE_PERIPHERAL_ROLE_E 

Peripheral role

M2MB_BLE_CENTRAL_ROLE_E 

Cetral role

M2MB_BLE_DUAL_ROLE_E 

Both peripheral and central roles

Definition at line 276 of file m2mb_ble_driver.h.

◆ M2MB_BLE_USER_EVENTS_T

Enumeration of BLE events from M2MB layer to application.

Enumeration of BLE events from M2MB layer to application. BLE events are notified to the application layer from M2MB to the registered callback function at the time of BLE initialization using m2mb_ble_initialize().

Enumerator
M2MB_BLE_PERIPHERAL_CONNECT_EVENT_E 

Peripheral connect event

M2MB_BLE_PERIPHERAL_DISCONNECT_EVENT_E 

Peripheral disconnect event

M2MB_BLE_PERIPHERAL_MTU_UPDATE_EVENT_E 

Peripheral MTU update event

M2MB_BLE_GATT_SERVER_READ_REQUEST_EVENT_E 

GATT server read request event

M2MB_BLE_GATT_SERVER_WRITE_REQUEST_EVENT_E 

GATT server write request event

M2MB_BLE_GATT_SERVER_WRITE_WITHOUT_RESPONSE_EVENT_E 

GATT server write without response event

M2MB_BLE_GATT_SERVER_NOTIFICATION_ENABLE_EVENT_E 

GATT server notification enable event

M2MB_BLE_GATT_SERVER_INDICATION_ENABLE_EVENT_E 

GATT server indication enable event

M2MB_BLE_GATT_SERVER_NOTIFY_INDICATE_ENABLE_EVENT_E 

GATT server notification and indication enable event

M2MB_BLE_GATT_SERVER_NOTIFY_INDICATE_DISABLE_EVENT_E 

GATT server notification and indication disable event

M2MB_BLE_SCAN_EVENT_E 

scan result event

M2MB_BLE_CENTRAL_CONNECT_EVENT_E 

Central connect event

M2MB_BLE_CENTRAL_DISCONNECT_EVENT_E 

Central disconnect event

M2MB_BLE_CENTRAL_MTU_UPDATE_EVENT_E 

Central MTU update event

M2MB_BLE_CENTRAL_NOTIFY_INDICATE_EVENT_E 

Central notify / indicate event from remote GATT server

M2MB_BLE_CONNECT_PARAM_UPDATE_EVENT_E 

Connection parameter update event

M2MB_BLE_SSP_PIN_NOTIFICATION_EVENT_E 

SSP PIN display notification event

M2MB_BLE_SSP_PIN_REQUEST_EVENT_E 

SSP PIN request notification event

M2MB_BLE_SSP_CONF_REQUEST_EVENT_E 

SSP confirmation request event

M2MB_BLE_SSP_JUST_WORKS_EVENT_E 

SSP just works event

M2MB_BLE_REMOTE_DEVICE_PHY_INFO_EVENT_E 

Remote devie PHY information event

M2MB_BLE_PHY_UPDATE_INFO_EVENT_E 

PHY update event when switching between different PHYs supported

M2MB_BLE_DATA_LEN_CHANGE_EVENT_E 

Data Length change event

Definition at line 615 of file m2mb_ble_driver.h.

◆ M2MB_BLE_UUID_TYPE_T

Enumeration of UUIDs suuported.

Enumeration that identifies which UUID is used when UUID value is placed in structure M2MB_BLE_UUID_T.

Enumerator
UUID_TYPE_16_BIT_E 

16 bit UUID type

UUID_TYPE_32_BIT_E 

32 bit UUID type

UUID_TYPE_128_BIT_E 

128 bit UUID type

UUID_INVALID_E 

Invalid UUID

Definition at line 154 of file m2mb_ble_driver.h.

◆ M2MB_BLE_WLAN_START_MODE

Enumeration for WLAN mode to start at the time of BLE initialization.

Enumeration for WLAN mode to start at the time of BLE initialization.

Enumerator
M2MB_BLE_WLAN_AP 

WLAN AP mode

M2MB_BLE_WLAN_STA 

WLAN Station mode

M2MB_BLE_WLAN_STA_AP 

WLAN mixed mode. Station and AP mode

Definition at line 410 of file m2mb_ble_driver.h.

Function Documentation

◆ m2mb_ble_advertise()

M2MB_BLE_RESPONSE_T m2mb_ble_advertise ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_ADV_TYPE_T  adv_type 
)

BLE advertise start and stop funtion.

This API is used to start and stop the BLE advertisement. This API uses the advertise data sent from the application (using m2mb_ble_conf() API) when advertise is ON.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]adv_typeadvertise type ON / OFF
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_advertise(), m2mb_ble_initialize() should be called and it should return successful. Customize advertise data (based on ON / OFF) should be handled by the application. This API just used the advertise data present when the advertisement is ON.

ble_response = m2mb_ble_advertise(m2m_ble_handle, advParam);

◆ m2mb_ble_bdaddr_device_info_get()

M2MB_BLE_RESPONSE_T m2mb_ble_bdaddr_device_info_get ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_BD_ADDR_T  bd_addr,
M2MB_BLE_DEVICE_INFO_T dev_info 
)

Get connected peer device information using remote BD address.

This API is used to get connected peer device information using remote BD address.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]bd_addrremote BD address
[out]dev_infodecvice information of the connected peer device
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_bdaddr_device_info_get(), m2mb_ble_initialize() should be called and the API should return successful. If device information of connected peripheral devices is required, then before calling m2mb_ble_bdaddr_device_info_get(), m2mb_ble_connect() should be called and the API should return successful.

ble_response = m2mb_ble_bdaddr_device_info_get(m2m_ble_handle, bd_addr, &dev_info);

◆ m2mb_ble_bond_delete()

M2MB_BLE_RESPONSE_T m2mb_ble_bond_delete ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_BD_ADDR_T  bd_addr 
)

Deletes the bond information of a BLE device from the bonded list.

This API is used to delete the bond information of a BLE device from the bonded list.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]bd_addrBLE address
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_bond_delete(), m2mb_ble_initialize() should be called and it should return successful.

ble_response = m2mb_ble_bond_delete(m2m_ble_handle, bd_addr);

◆ m2mb_ble_bond_list_get()

M2MB_BLE_RESPONSE_T m2mb_ble_bond_list_get ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_BOND_LIST_INFO_T bond_list_info,
UINT32 num_of_entries 
)

Gets the list of bonded devices.

This API is used to get the list of bonded devices.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[out]bond_list_infoList of bonded devices
[out]num_of_entriesNumber of bonded devices filled
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_bond_list_get(), m2mb_ble_initialize() should be called and it should return successful.

ble_response = m2mb_ble_bond_list_get(m2m_ble_handle, bond_list_info, &num_of_entries);

◆ m2mb_ble_cccd_request()

M2MB_BLE_RESPONSE_T m2mb_ble_cccd_request ( M2MB_BLE_HANDLE  ble_handle,
INT32  connection_id,
INT32  char_handle,
M2MB_BLE_CCCD_T  cccd_val 
)

Enables and disables a Notication/Indication on a client characteristic descriptor.

This API is used to enables and disables a Notication/Indication on a client characteristic descriptor.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]connection_idconnection id
[in]char_handleattribute handle of the discovered characteristic.
[in]cccd_valvalue of client characteristic descriptor
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_cccd_request(), m2mb_ble_initialize(), m2mb_ble_connect(), and m2mb_ble_start_discovery() should be called and all API's should return successful. connection_id is the connection ID returned by m2mb_ble_connect() API. char_handle is the handle of a characteristic discovered using m2mb_ble_start_discovery() API.

ble_response = m2mb_ble_cccd_request(m2m_ble_handle, conn_id, char_handle, cccd_val);

◆ m2mb_ble_central_initiate_pairing()

M2MB_BLE_RESPONSE_T m2mb_ble_central_initiate_pairing ( M2MB_BLE_HANDLE  ble_handle,
UINT8  conn_id 
)

Initiate pairing to a connected device in Central mode.

This API is used to initiate pairing to a connected device in Central mode. This API is used normally when the device in central mode fails to read or write a secured characteristic. This API can also be called any time after a connection is established by the master / central.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]conn_idconnection id
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_cccd_request(), m2mb_ble_initialize() and m2mb_ble_connect() should be called and both API's should return successful.

ble_response = m2mb_ble_central_initiate_pairing(m2m_ble_handle, conn_id);

◆ m2mb_ble_conf()

M2MB_BLE_RESPONSE_T m2mb_ble_conf ( M2MB_BLE_HANDLE  ble_handle,
UINT8  num_cmds,
  ... 
)

BLE configuration GET / SET.

This API is used to GET / SET the BLE configuration parameters. This API supports variable length aruguments

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]num_cmdsNumber of commands used. Based on this number the variable length arguments are decided.
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_conf(), m2mb_ble_initialize() should be called and it should return successful.

ble_response = m2mb_ble_conf(m2m_ble_handle, 2, M2MB_BLE_CFG_BLE_BD_ADDR_GET_E, &bd_addr);

◆ m2mb_ble_connect()

M2MB_BLE_RESPONSE_T m2mb_ble_connect ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_BD_ADDR_T  bd_addr,
M2MB_BLE_ADDRESS_TYPE_T  bd_addr_type,
INT32 connection_id 
)

Connect to a BLE peripheral device.

This API is used connect to a BLE peripheral device. This API returns the connection ID of the new connection if successful.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]bd_addrble address of the device to be connected to
[in]bd_addr_typeble address type
[out]connection_idconnection ID of new connection
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_connect(), m2mb_ble_initialize() and should be called and this API's should return successful. bd_addr and bd_addr_type information of a BLE device can be obtained using m2mb_ble_scan_start() API.

ble_response = m2mb_ble_connect(m2m_ble_handle, bd_addr, bd_addr_type, &connection_id);

◆ m2mb_ble_connid_device_info_get()

M2MB_BLE_RESPONSE_T m2mb_ble_connid_device_info_get ( M2MB_BLE_HANDLE  ble_handle,
UINT8  conn_id,
M2MB_BLE_DEVICE_INFO_T dev_info 
)

Get connected peer device information using connection ID.

This API is used to get connected peer device information using connection ID.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]connection_idconnection id
[out]dev_infodecvice information of the connected peer device
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_connid_device_info_get(), m2mb_ble_initialize() should be called and the API should return successful. If device information of connected peripheral devices is required, then before calling m2mb_ble_connid_device_info_get(), m2mb_ble_connect() should be called and the API should return successful.

conn_id can be peripheral connection ID when remote Central device connects to the device or connection ID's of different connected peripherals in central mode.

ble_response = m2mb_ble_connid_device_info_get(m2m_ble_handle, conn_id, &dev_info);

◆ m2mb_ble_data_len_set()

M2MB_BLE_RESPONSE_T m2mb_ble_data_len_set ( M2MB_BLE_HANDLE  ble_handle,
UINT8  conn_id,
UINT16  tx_octets 
)

Set data length used in Link Layer for data length extension.

This API is used to set data length used in Link Layer for data length extension.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]connection_idconnection id
[in]tx_octetsmaximum number of payload octets that the local Controller should include in a single Link Layer packet
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_data_len_set(), m2mb_ble_initialize(), m2mb_ble_connect() should be called and both API's should return successful. connection_id is the connection ID returned by m2mb_ble_connect() API.

ble_response = m2mb_ble_data_len_set(m2m_ble_handle, conn_id, data_length);

◆ m2mb_ble_disconnect()

M2MB_BLE_RESPONSE_T m2mb_ble_disconnect ( M2MB_BLE_HANDLE  ble_handle,
INT32  connection_id 
)

Disconnects from a connected BLE peripheral device.

This API is used to disconnect from a connected BLE peripheral device.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]connection_idconnection id
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_disconnect(), m2mb_ble_initialize() and m2mb_ble_connect() should be called and both API's should return successful. connection_id is the connection ID returned by m2mb_ble_connect() API.

ble_response = m2mb_ble_connect(m2m_ble_handle, bd_addr, bd_addr_type, &connection_id);

◆ m2mb_ble_gatts_characteristic_add()

M2MB_BLE_RESPONSE_T m2mb_ble_gatts_characteristic_add ( M2MB_BLE_HANDLE  ble_handle,
UINT8  properties,
M2MB_BLE_UUID_T  characteristic_uuid 
)

Add BLE GATT characteristic in a service.

This API is used to add a new characteristic in a GATT service.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]propertiesproperties of characteristic
[in]characteristic_uuidUUID of characteristic
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_gatts_characteristic_add(), m2mb_ble_initialize() and m2mb_ble_gatts_service_add() should be called and both API's should return successful.

ble_response = m2mb_ble_gatts_characteristic_add(m2m_ble_handle, properties, uuid);

◆ m2mb_ble_gatts_characteristic_value_add()

M2MB_BLE_RESPONSE_T m2mb_ble_gatts_characteristic_value_add ( M2MB_BLE_HANDLE  ble_handle,
UINT16  permissions,
UINT16  value_len,
UINT8 value,
UINT32 characteristic_id 
)

Add BLE GATT characteristic value in a service.

This API is used to add a value for new characteristic in a GATT service. When this API is called new characteristic is added to GATT service data base and new characteristic ID is returned to the application

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]permissionspermissions of characteristic
[in]value_lenlength of characteristic value
[in]valuecharacteristic value
[out]characteristic_idcharacteristic id of the new characteristic
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_gatts_characteristic_value_add(), m2mb_ble_initialize(), m2mb_ble_gatts_service_add(), and m2mb_ble_gatts_characteristic_add() should be called and all API's should return successful.

ble_response = m2mb_ble_gatts_characteristic_value_add(m2m_ble_handle, permissions, hex_val_len, hex_val, &characteristic_id);

◆ m2mb_ble_gatts_complete()

M2MB_BLE_RESPONSE_T m2mb_ble_gatts_complete ( M2MB_BLE_HANDLE  ble_handle,
UINT32 service_id 
)

Stop adding new characteristics to a GATT service.

This API is used stop adding new characteristics to a GATT service. When this API is called new service is added to GATT server data base and new service ID is returned to the application

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[out]service_idservice id of the new service
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_gatts_complete(), m2mb_ble_initialize(), m2mb_ble_gatts_service_add() should be called and both API's should return successful. m2mb_ble_gatts_characteristic_add() and m2mb_ble_gatts_characteristic_value_add() should be called for each characteristic added in the service and both API's should return successful.

ble_response = m2mb_ble_gatts_complete(m2m_ble_handle, &service_id);

◆ m2mb_ble_gatts_secure_ccccd()

M2MB_BLE_RESPONSE_T m2mb_ble_gatts_secure_ccccd ( M2MB_BLE_HANDLE  ble_handle)

Secure all client characteristic descriptors of a new service.

This API is used to secure all client characteristic descriptors of a new service.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_gatts_secure_ccccd(), m2mb_ble_initialize() should be called and it should return successful. To secure all client characteristic descriptors of a new service, m2mb_ble_gatts_secure_ccccd() should be called before calling m2mb_ble_gatts_service_add() API

ble_response = m2mb_ble_gatts_secure_ccccd(m2m_ble_handle);

◆ m2mb_ble_gatts_serv_send_data()

M2MB_BLE_RESPONSE_T m2mb_ble_gatts_serv_send_data ( M2MB_BLE_HANDLE  ble_handle,
UINT32  serv_id,
UINT32  char_id,
UINT8 value,
UINT16  value_len,
M2MB_BLE_CCCD_T  cccd 
)

Send GATT server data to remote GATT client.

This API is used send GATT server data to remote GATT client, usually, when new data is available on a characteristic (not on READ request from GATT cleint), and when notification or indication is enable on the characteristic.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]service_idservice id
[in]char_idcharacteristic id
[in]valuevalue of the characteristic
[in]value_lenlength of the value of the characteristic
[in]cccdCCCD value.
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_gatts_serv_send_data(), m2mb_ble_initialize() should be called and this API's should return successful. The application should check the CCCD value of the characteristic in its database and use this API to send data to GATT client when notification / indication is enabled

ble_response = m2mb_ble_gatts_serv_send_data(m2m_ble_handle, service_id, char_id, val, val_length, cccd);

◆ m2mb_ble_gatts_service_add()

M2MB_BLE_RESPONSE_T m2mb_ble_gatts_service_add ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_UUID_T  service_uuid 
)

Add a new BLE GATT service.

This API is used to add a new service on GATT server.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]service_uuidUUID of the service
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_gatts_service_add(), m2mb_ble_initialize() should be called and it should return successful.

ble_response = m2mb_ble_gatts_service_add(m2m_ble_handle, uuid);

◆ m2mb_ble_initialize()

M2MB_BLE_RESPONSE_T m2mb_ble_initialize ( M2MB_BLE_HANDLE ble_handle,
m2mb_ble_event_callback  ble_callback,
void *  user_data 
)

BLE stack initialization.

This API enables and initializes BLE stack.

Parameters
[out]ble_handlePointer to ble_handle. This is filled by m2mb_ble_initialize API. This should be used in all M2MB BLE API's
[in]ble_callbackBLE event callback function pointer. This function is called for all BLE related events with event type.
[in]user_dataPointer to generic ble user data that will be returned as it is in the callback.
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error

ble_response = m2mb_ble_initialize(&m2m_ble_handle, m2m_ble_callback, NULL);

◆ m2mb_ble_read_value_request()

M2MB_BLE_RESPONSE_T m2mb_ble_read_value_request ( M2MB_BLE_HANDLE  ble_handle,
INT32  connection_id,
INT32  char_handle,
UINT8 **  value,
UINT16 value_len 
)

Read value request on a discovered characteristic.

This API is used to request for reading the value of a discovered characteristic.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]connection_idconnection id
[in]char_handleattribute handle of the discovered characteristic.
[out]valuevalue of the characteristic
[out]value_lenlength of the value of the characteristic
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_read_value_request(), m2mb_ble_initialize(), m2mb_ble_connect(), and m2mb_ble_start_discovery() should be called and all API's should return successful. connection_id is the connection ID returned by m2mb_ble_connect() API. char_handle is the handle of a characteristic discovered using m2mb_ble_start_discovery() API.

ble_response = m2mb_ble_read_value_request(m2m_ble_handle, conn_id, char_id, &value, &value_len);

◆ m2mb_ble_scan_start()

M2MB_BLE_RESPONSE_T m2mb_ble_scan_start ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_BD_ADDR_T  bd_addr 
)

Start to scan for BLE devices.

This API is used start to scan for BLE devices. This API is used to scan for a particular BLE device or scan for all available BLE devices.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]bd_addrscan for particular BLE address. When this is set to 0 for all bytes, then it scans for all available BLE devices.
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_scan_start(), m2mb_ble_initialize() should be called and this API's should return successful.

ble_response = m2mb_ble_scan_start(m2m_ble_handle, bd_addr);

◆ m2mb_ble_scan_stop()

M2MB_BLE_RESPONSE_T m2mb_ble_scan_stop ( M2MB_BLE_HANDLE  ble_handle)

Stop the BLE device scaning.

This API is used stop the BLE device scaning.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_scan_stop(), m2mb_ble_initialize() and m2mb_ble_scan_start should be called and both API's should return successful.

ble_response = m2mb_ble_scan_stop(m2m_ble_handle);

◆ m2mb_ble_set_phy()

M2MB_BLE_RESPONSE_T m2mb_ble_set_phy ( M2MB_BLE_HANDLE  ble_handle,
UINT8  conn_id,
M2MB_BLE_PHYS_INFO_T  phy_pref,
M2MB_BLE_PHY_CODED_OPTIONS_T  phy_coded_options 
)

Set the PHY options.

This API is used to set the PHY options of a connection.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]connection_idconnection id
[in]phy_prefPHY preferences
[in]phy_coded_optionscoded PHY options
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_set_phy(), m2mb_ble_initialize(), m2mb_ble_connect() should be called and both API's should return successful. connection_id is the connection ID returned by m2mb_ble_connect() API. The Controller may not make the change because of the peer that does not support the requested physical layer and may perfer the current physical layer. Low Energy(LE) coded Physical layer is not supported. Only Low Energy 1M and 2M physical layer are supported.

ble_response = m2mb_ble_set_phy(m2m_ble_handle, conn_id, phy_pref, coded_phy_options);

◆ m2mb_ble_shutdown()

M2MB_BLE_RESPONSE_T m2mb_ble_shutdown ( M2MB_BLE_HANDLE  ble_handle)

BLE stack shutdown.

This API shutdown the BLE stack.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_shutdown(), m2mb_ble_initialize() should be called and it should return successful.

ble_response = m2mb_ble_shutdown(p_m2m_ble_appctx->m2m_ble_handle);

◆ m2mb_ble_sspconf_reply()

M2MB_BLE_RESPONSE_T m2mb_ble_sspconf_reply ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_BD_ADDR_T  bd_addr,
M2MB_BLE_ADDRESS_TYPE_T  bd_addr_type,
UINT32  confirmation_flag 
)

SSP CONF reply used as part of BLE pairing procedure.

This API is used as part of BLE pairing procedure. This API accepts or denies the pairing procedure.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]bd_addrRemote BD address.
[in]bd_addr_typeRemote BD address type.
[in]confirmation_flagConfirmation flag for same PIN is generated on both BLE devices involved in pairing process.
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_sspconf_reply(), m2mb_ble_initialize() should be called and it should return successful. m2mb_ble_sspconf_reply() should be called only in case of M2MB_BLE_SSP_CONF_REQUEST_EVENT_E event.

ble_response = m2mb_ble_sspconf_reply(m2m_ble_handle, bd_addr, bd_addr_type, confirmation_flag);

◆ m2mb_ble_ssppin_reply()

M2MB_BLE_RESPONSE_T m2mb_ble_ssppin_reply ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_BD_ADDR_T  bd_addr,
M2MB_BLE_ADDRESS_TYPE_T  bd_addr_type,
INT32  ssppin,
UINT8  accept_flag 
)

SSP Pin reply used as part of BLE pairing procedure.

This API is used as part of BLE pairing procedure. This API accepts or denies the pairing procedure.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]bd_addrRemote BD address.
[in]bd_addr_typeRemote BD address type.
[in]ssppinSSP passkey.
[in]accept_flagFlag states whether to pair or not.
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_ssppin_reply(), m2mb_ble_initialize() should be called and it should return successful. m2mb_ble_ssppin_reply() should be called only in case of M2MB_BLE_SSP_PIN_REQUEST_EVENT_E event.

ble_response = m2mb_ble_ssppin_reply(m2m_ble_handle, bd_addr, bd_addr_type, SSP_Passkey, accept_flag);

◆ m2mb_ble_start_discovery()

M2MB_BLE_RESPONSE_T m2mb_ble_start_discovery ( M2MB_BLE_HANDLE  ble_handle,
INT32  connection_id,
M2MB_BLE_UUID_T  uuid,
M2MB_BLE_GATT_SRVD_T results 
)

Discovery of services and characteristics of a GATT server.

This API is used to discovery of services and characteristics of a GATT server. Primary services of the GATT server are discovered when the value of parameter 'uuid' is set to UUID_INVALID_E. If the value of 'uuid' parameter is a valid discovered primary service UUID value, then the characteristics of the service are discovered.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]connection_idconnection id
[in]uuiduuid of the service.
[out]resultsdiscovered results filled by BLE driver
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_start_discovery(), m2mb_ble_initialize() and m2mb_ble_connect() should be called and both API's should return successful. connection_id is the connection ID returned by m2mb_ble_connect() API.

ble_response = m2mb_ble_start_discovery(m2m_ble_handle, conn_id, uuid, &gatt_results);

◆ m2mb_ble_wlan_config_set()

M2MB_BLE_RESPONSE_T m2mb_ble_wlan_config_set ( M2MB_BLE_WLAN_START_MODE  wlan_start_mode)

WLAN mode to start at the time of BLE initialization.

This API is used to start WLAN in particular mode at the time of BLE initializaqtion.

Parameters
[in]wlan_start_modeWLAN mode to start at the time of BLE initialization
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
This API should be called before m2mb_ble_initialize() function.

ble_response = m2mb_ble_wlan_config_set(wlan_start_mode);

◆ m2mb_ble_write_value_command()

M2MB_BLE_RESPONSE_T m2mb_ble_write_value_command ( M2MB_BLE_HANDLE  ble_handle,
INT32  connection_id,
INT32  char_handle,
UINT8 value,
UINT16  value_len 
)

Write command on a discovered characteristic.

This API is used to do a write command of a discovered characteristic.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]connection_idconnection id
[in]char_handleattribute handle of the discovered characteristic.
[in]valuevalue of the characteristic
[in]value_lenlength of the value of the characteristic
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_write_value_command(), m2mb_ble_initialize(), m2mb_ble_connect(), and m2mb_ble_start_discovery() should be called and all API's should return successful. connection_id is the connection ID returned by m2mb_ble_connect() API. char_handle is the handle of a characteristic discovered using m2mb_ble_start_discovery() API.

ble_response = m2mb_ble_write_value_command(m2m_ble_handle, conn_id, char_id, value, value_len);

◆ m2mb_ble_write_value_request()

M2MB_BLE_RESPONSE_T m2mb_ble_write_value_request ( M2MB_BLE_HANDLE  ble_handle,
INT32  connection_id,
INT32  char_handle,
UINT8 value,
UINT16  value_len 
)

Write value request on a discovered characteristic.

This API is used to do a write value request of a discovered characteristic.

Parameters
[in]ble_handleble_handle from m2mb_ble_initialize API
[in]connection_idconnection id
[in]char_handleattribute handle of the discovered characteristic.
[in]valuevalue of the characteristic
[in]value_lenlength of the value of the characteristic
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error
Note
Before calling m2mb_ble_write_value_request(), m2mb_ble_initialize(), m2mb_ble_connect(), and m2mb_ble_start_discovery() should be called and all API's should return successful. connection_id is the connection ID returned by m2mb_ble_connect() API. char_handle is the handle of a characteristic discovered using m2mb_ble_start_discovery() API.

ble_response = m2mb_ble_write_value_request(m2m_ble_handle, conn_id, char_id, value, value_len);