m2mb API docs  25.21.002
m2mb API sets documentation
m2mb_ble.h File Reference

BLE driver functionality. More...

Go to the source code of this file.

Data Structures

struct  M2MB_BLE_UUID_16_S
 BLE 16 bit UUID. More...
 
struct  M2MB_BLE_UUID_32_S
 BLE 32 bit UUID. More...
 
struct  M2MB_BLE_UUID_128_S
 BLE 128 bit UUID. More...
 
struct  M2MB_BLE_UUID_S
 BLE UUID. More...
 
struct  M2MB_BLE_BD_ADDR_S
 Bluetooth Device Address. More...
 
struct  M2MB_BLE_BD_NAME_S
 Bluetooth Device Name. More...
 
struct  M2MB_BLE_CENTRAL_CFG_S
 BLE Central configuration parameters. More...
 
struct  M2MB_BLE_PERIPHERAL_CFG_S
 BLE Peripheral configuration parameters. More...
 
struct  M2MB_BLE_CONN_PARAM_S
 BLE connection configuration parameters. More...
 
struct  M2MB_BLE_SECURITY_CFG_S
 BLE security configuration parameters. More...
 
struct  M2MB_BLE_DIS_INFO_S
 BLE DIS configuration parameters. More...
 
struct  M2MB_BLE_GENERAL_PARAM_S
 BLE general configuration parameters. More...
 
struct  M2MB_BLE_CGF_S
 BLE configuration parameters. More...
 
struct  M2MB_BLE_SCAN_REPORT_DATA_S
 BLE scan report data. More...
 
struct  M2MB_BLE_CENTRAL_NOTIFY_INDICATE_DATA_S
 BLE notification and indication data. More...
 
struct  M2MB_BLE_GATT_SERVER_EVENT_DETAILS_S
 BLE GATT server event details. More...
 
struct  M2MB_BLE_SSP_REQUEST_CTX_T
 BLE SSP request. More...
 
struct  M2MB_BLE_PIN_REQUEST_CTX_T
 BLE PIN request. More...
 
struct  M2MB_BLE_CLIENT_WRITE_RESP_CTX_T
 BLE client write response. More...
 
struct  M2MB_BLE_CLIENT_READ_RESP_CTX_T
 BLE client read response. More...
 
struct  M2MB_BLE_USER_EVENT_CTX_S
 BLE user event. More...
 
union  M2MB_BLE_USER_EVENT_CTX_S::M2MB_BLE_EVENT_DATA_U
 BLE user event data. More...
 
struct  M2MB_BLE_DEVICE_INFO_S
 BLE device information. More...
 
struct  M2MB_BLE_BOND_LIST_INFO_S
 BLE bond list information. More...
 
struct  M2MB_BLE_GATT_ELEMENT_S
 BLE GATT elements. More...
 
struct  M2MB_BLE_GATT_SRVD_S
 BLE service discovery feature. More...
 

Macros

#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   32
 
#define M2MB_BLE_SCAN_RSP_DATA_SIZE   32
 
#define M2MB_BLE_ADDRESS_RESOLUTION_TIMEOUT   60
 
#define M2MB_BLE_MTU_SIZE_MAX   158
 
#define M2MB_BLE_BOND_ENTRIES_MAX   20
 
#define M2MB_BLE_MAX_ATTRIBUTE_LENGTH   600
 
#define M2MB_BLE_MAX_HEX_VALUE   ((2 * M2MB_BLE_MTU_SIZE_MAX) + 1)
 
#define M2MB_BLE_MAX_PAIRED_DEVICES   4
 
#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_GATT_CLIENT_CONFIGURATION_CHARACTERISTIC_NOTIFY_ENABLE   0x0001
 
#define M2MB_BLE_GATT_CLIENT_CONFIGURATION_CHARACTERISTIC_INDICATE_ENABLE   0x0002
 
#define M2MB_BLE_GATT_CLIENT_CHARACTERISTIC_CONFIGURATION_BLUETOOTH_UUID_CONSTANT   {0x02, 0x29}
 
#define M2MB_BLE_DIS_PNP_ID_VENDOR_SOURCE_BLUETOOTH_SIG   0x01
 
#define M2MB_BLE_DIS_PNP_ID_VENDOR_SOURCE_USB_IMPLEMENTORS_FORUM   0x02
 

Typedefs

typedef struct M2MB_BLE_UUID_16_S M2MB_BLE_UUID_16_T
 BLE 16 bit UUID. More...
 
typedef struct M2MB_BLE_UUID_32_S M2MB_BLE_UUID_32_T
 BLE 32 bit UUID. More...
 
typedef struct M2MB_BLE_UUID_128_S M2MB_BLE_UUID_128_T
 BLE 128 bit UUID. More...
 
typedef struct M2MB_BLE_UUID_S M2MB_BLE_UUID_T
 BLE UUID. More...
 
typedef struct M2MB_BLE_BD_ADDR_S M2MB_BLE_BD_ADDR_T
 Bluetooth Device Address. More...
 
typedef INT8 M2MB_BLE_BOARDSTR_T[16]
 BLE board address in string format. More...
 
typedef struct M2MB_BLE_BD_NAME_S M2MB_BLE_BD_NAME_T
 Bluetooth Device Name. More...
 
typedef struct M2MB_BLE_CENTRAL_CFG_S M2MB_BLE_CENTRAL_CFG_T
 BLE Central configuration parameters. More...
 
typedef struct M2MB_BLE_PERIPHERAL_CFG_S M2MB_BLE_PERIPHERAL_CFG_T
 BLE Peripheral configuration parameters. More...
 
typedef struct M2MB_BLE_CONN_PARAM_S M2MB_BLE_CONN_PARAM_T
 BLE connection configuration parameters. More...
 
typedef struct M2MB_BLE_SECURITY_CFG_S M2MB_BLE_SECURITY_CFG_T
 BLE security configuration parameters. More...
 
typedef struct M2MB_BLE_DIS_INFO_S M2MB_BLE_DIS_INFO_T
 BLE DIS configuration parameters. More...
 
typedef struct M2MB_BLE_GENERAL_PARAM_S M2MB_BLE_GENERAL_PARAM_T
 BLE general configuration parameters. More...
 
typedef struct M2MB_BLE_CGF_S M2MB_BLE_CGF_T
 BLE configuration parameters. More...
 
typedef struct M2MB_BLE_SCAN_REPORT_DATA_S M2MB_BLE_SCAN_REPORT_DATA_T
 BLE scan report data. More...
 
typedef struct M2MB_BLE_CENTRAL_NOTIFY_INDICATE_DATA_S M2MB_BLE_CENTRAL_NOTIFY_INDICATE_DATA_T
 BLE notification and indication data. More...
 
typedef struct M2MB_BLE_GATT_SERVER_EVENT_DETAILS_S M2MB_BLE_GATT_SERVER_EVENT_DETAILS_T
 BLE GATT server event details. More...
 
typedef struct M2MB_BLE_USER_EVENT_CTX_S M2MB_BLE_USER_EVENT_CTX_T
 BLE user event. More...
 
typedef struct M2MB_BLE_DEVICE_INFO_S M2MB_BLE_DEVICE_INFO_T
 BLE device information. More...
 
typedef HANDLE M2MB_BLE_HANDLE
 BLE handle. More...
 
typedef struct M2MB_BLE_BOND_LIST_INFO_S M2MB_BLE_BOND_LIST_INFO_T
 BLE bond list information. More...
 
typedef struct M2MB_BLE_GATT_ELEMENT_S M2MB_BLE_GATT_ELEMENT_T
 BLE GATT elements. More...
 
typedef struct M2MB_BLE_GATT_SRVD_S M2MB_BLE_GATT_SRVD_T
 BLE service discovery feature. 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 event callback. More...
 

Enumerations

enum  M2MB_BLE_UUID_TYPE_T { UUID_TYPE_16_BIT_E, UUID_TYPE_32_BIT_E, UUID_TYPE_128_BIT_E, UUID_INVALID_E }
 BLE UUID. 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
}
 BLE Advertise event. More...
 
enum  M2MB_BLE_CONNECTABILITY_MODE_T { M2MB_BLE_NON_CONNECTABLE_E, M2MB_BLE_CONNECTABLE_E, M2MB_BLE_DIRECT_CONNECTABLE_E }
 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 }
 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 }
 BLE pairability modes. More...
 
enum  M2MB_BLE_ROLE_T { M2MB_BLE_PERIPHERAL_ROLE_E, M2MB_BLE_CENTRAL_ROLE_E, M2MB_BLE_DUAL_ROLE_E }
 BLE Role. 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
}
 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
}
 different IO Capabilities of an LE device More...
 
enum  M2MB_BLE_CCCD_T { M2MB_BLE_DISABLE_INDICATION_NOTIFICATION_E, M2MB_BLE_ENABLE_NOTIFICATION_E, M2MB_BLE_ENABLE_INDICATION_E }
 BLE CCCD. 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
}
 BLE configuration parameters. 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
}
 BLE status. 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_GATT_SERVER_NOTIFY_INDICATE_READ_EVENT_E, M2MB_BLE_GATT_SERVER_CHAR_VALUE_UPDATED_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_CENTRAL_WRITE_EVENT_E, M2MB_BLE_CENTRAL_READ_EVENT_E, M2MB_BLE_CONNECT_PARAM_UPDATE_EVENT_E,
  M2MB_BLE_SSP_PIN_NOTIFICATION_EVENT_E, M2MB_BLE_SSP_PIN_EVENT_E, M2MB_BLE_SSP_CONF_EVENT_E, M2MB_BLE_PROVISIONING_SCAN_EVENT_E,
  M2MB_BLE_PROVISIONING_CONNECT_EVENT_E
}
 BLE EVENTS to the user. More...
 
enum  M2MB_BLE_CENTRAL_SCAN_FILTER_DUPLICATES_T { M2MB_BLE_SCAN_FILTER_DUPLICATE_DISABLE, M2MB_BLE_SCAN_FILTER_DUPLICATE_ENABLE }
 Scan results duplicate filtering. 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 }
 BLE ADV type. More...
 
enum  M2MB_BLE_INIT_STATE_T { M2MB_BLE_STATE_INITIALIZED, M2MB_BLE_STATE_UNINITIALIZED }
 BLE INIT state. 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
}
 BLE GATT attribute type. More...
 

Functions

M2MB_BLE_RESPONSE_T m2mb_ble_initialize (M2MB_BLE_HANDLE *ble_handle, m2mb_ble_event_callback ble_callback, void *user_data)
 Initialization of BLE. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_get_init_state (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_INIT_STATE_T *state)
 Getting BLE initialization state. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_shutdown (M2MB_BLE_HANDLE ble_handle)
 Deinitialization of BLE. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_conf (M2MB_BLE_HANDLE ble_handle, UINT8 num_cmds,...)
 BLE configuration API. 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)
 passkey response 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)
 passkey conformation 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 bond information. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_bond_delete (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_BD_ADDR_T bd_addr)
 Deletes bond information. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_advertise (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_ADV_TYPE_T adv_type)
 Starts advertising. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_gatts_service_add (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_UUID_T service_uuid)
 Adds ble service. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_gatts_characteristic_add (M2MB_BLE_HANDLE ble_handle, UINT8 properties, M2MB_BLE_UUID_T characteristic_uuid)
 Adds characteristic information. 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)
 Adds characteristic value information. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_gatts_complete (M2MB_BLE_HANDLE ble_handle, UINT32 *service_id)
 Register service to the BLE stack. 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 data to the server. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_scan_start (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_BD_ADDR_T bd_addr)
 Starts BLE scanning. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_scan_stop (M2MB_BLE_HANDLE ble_handle)
 Stops BLE scanning. 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)
 Connects to the BLE remote device. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_disconnect (M2MB_BLE_HANDLE ble_handle, INT32 connection_id)
 Disconnects BLE devices. 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)
 Starts service discovery. 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)
 Reads value request. 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. 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 value to the particular service's characteristic ID. 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)
 CCCD value request. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_device_bd_addr_get (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_BD_ADDR_T *bd_addr)
 Gets the BLE device bd address. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_provisioning_get (M2MB_BLE_HANDLE ble_handle, INT32 *status)
 Gets the provisioning status. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_provisioning_set (M2MB_BLE_HANDLE ble_handle, INT32 status)
 Sets the provisioning status. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_send_indication (M2MB_BLE_HANDLE ble_handle, INT32 attribute_handle, INT32 conn_id, INT32 len, INT32 confirm, UINT8 *value)
 Sending indication to the service. 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)
 Gets the Device information. 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)
 Gets the Device information. More...
 
M2MB_BLE_RESPONSE_T m2mb_ble_get_initialization_state (M2MB_BLE_HANDLE ble_handle, M2MB_BLE_INIT_STATE_T *state)
 

Detailed Description

BLE driver functionality.

m2m/m2m_generic/common/m2mb_inc/m2mb_ble.h

This file contains the public APIs and structures of Bluetooth Low Energy (BLE) client and server module.

Note
Author
Date
12/08/2020

Macro Definition Documentation

◆ M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_RESOURCES

#define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_RESOURCES   0x11

The following define GATT Characteristic Properties Definitions

◆ M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_EXTENDED_PROPERTIES

#define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_EXTENDED_PROPERTIES   0x80

The following define GATT Client Configuration Characteristic Definitions

◆ M2MB_BLE_GATT_CLIENT_CHARACTERISTIC_CONFIGURATION_BLUETOOTH_UUID_CONSTANT

#define M2MB_BLE_GATT_CLIENT_CHARACTERISTIC_CONFIGURATION_BLUETOOTH_UUID_CONSTANT   {0x02, 0x29}

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

◆ M2MB_BLE_GATT_CLIENT_CONFIGURATION_CHARACTERISTIC_INDICATE_ENABLE

#define M2MB_BLE_GATT_CLIENT_CONFIGURATION_CHARACTERISTIC_INDICATE_ENABLE   0x0002

The following defines the GATT Client Characteristic Configuration UUID that is used when building the service tables.

◆ M2MB_BLE_MAX_DEVICE_NAME_LENGTH

#define M2MB_BLE_MAX_DEVICE_NAME_LENGTH   (39+1)

GAP_DEVICE_NAME_LEN in gap.h

◆ M2MB_BLE_MAX_PAIRED_DEVICES

#define M2MB_BLE_MAX_PAIRED_DEVICES   4

Maximum paired devices allowed when the device is in Central Mode. This is platform specific

Typedef Documentation

◆ M2MB_BLE_BD_ADDR_T

Bluetooth Device Address.

Ex: In MAC Addr = 0xAABBCCDDEEFF, then BD_ADDR0 = 0xAA and BD_ADDR5 = 0xFF Bluetooth Device Address Ex: In MAC Addr = 0xAABBCCDDEEFF, then BD_ADDR0 = 0xAA and BD_ADDR5 = 0xFF

◆ M2MB_BLE_BD_NAME_T

Bluetooth Device Name.

Bluetooth Device Name within M2MB_BLE_MAX_DEVICE_NAME_LENGTH Bluetooth Device Name

◆ M2MB_BLE_BOARDSTR_T

typedef INT8 M2MB_BLE_BOARDSTR_T[16]

BLE board address in string format.

Use to hold MAX address in Hex format. Ex: 0xAABBCCDDEEFF

◆ M2MB_BLE_BOND_LIST_INFO_T

BLE bond list information.

maintains BLE bond list information

◆ M2MB_BLE_CENTRAL_CFG_T

BLE Central configuration parameters.

Enumeration that indicates BLE Central configuration parameters

◆ M2MB_BLE_CENTRAL_NOTIFY_INDICATE_DATA_T

BLE notification and indication data.

structure to hold notification and indication data from remote GATT server

◆ M2MB_BLE_CGF_T

BLE configuration parameters.

Enumeration that indicates BLE configuration parameters

◆ M2MB_BLE_CONN_PARAM_T

BLE connection configuration parameters.

Enumeration that indicates BLE connection configuration parameters

◆ M2MB_BLE_DEVICE_INFO_T

BLE device information.

Device Info structure is maintained for handling the device information of connected peer devices (both in Central and Peripheral mode). So, this device info handling API's should be protected with a Mutex so that the device info will not be corrupted in case of simultaneous events that handles the device info part. Ex: In central mode simultaneous operations are possible like, One device got connected and other device got disconnected at the same time.

BLE Device info will hold all the information related to connected peer device. BLE Device info can be implemented as either array or linked list.

Better to go with array with array size as (1 peripheral connection + max number of simultaneous connection supported by central). On successful connection the device info should be filled in the array, and on disconnect the device info should be deleted.

In peripheral mode, when Central connects to the BLE device, few stacks do not provide connect ID. In this case try to have some special connection ID defined for peripheral connection.

◆ M2MB_BLE_DIS_INFO_T

BLE DIS configuration parameters.

Enumeration that indicates BLE DIS 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 event callback.

register this callback during BLE init

◆ M2MB_BLE_GATT_ELEMENT_T

BLE GATT elements.

maintains BLE GATT elements

◆ M2MB_BLE_GATT_SERVER_EVENT_DETAILS_T

BLE GATT server event details.

maintain BLE GATT server event details like service id, value, etc,.

◆ M2MB_BLE_GATT_SRVD_T

BLE service discovery feature.

used for service discovery feature

◆ M2MB_BLE_GENERAL_PARAM_T

BLE general configuration parameters.

Enumeration that indicates BLE general configuration parameters

◆ M2MB_BLE_HANDLE

typedef HANDLE M2MB_BLE_HANDLE

BLE handle.

BLE handle for all contexts

◆ M2MB_BLE_PERIPHERAL_CFG_T

BLE Peripheral configuration parameters.

Enumeration that indicates BLE Peripheral configuration parameters

◆ M2MB_BLE_SCAN_REPORT_DATA_T

BLE scan report data.

When scan for BLE devices, send the list of scanned devices information in this format to the application

◆ M2MB_BLE_SECURITY_CFG_T

BLE security configuration parameters.

Enumeration that indicates BLE security configuration parameters

◆ M2MB_BLE_USER_EVENT_CTX_T

BLE user event.

This BLE user event context is sent to registered callback with user event type

◆ M2MB_BLE_UUID_128_T

BLE 128 bit UUID.

used to store BLE 128 bit UUID bytes

◆ M2MB_BLE_UUID_16_T

BLE 16 bit UUID.

used to store BLE 16 bit UUID bytes

◆ M2MB_BLE_UUID_32_T

BLE 32 bit UUID.

used to store BLE 32 bit UUID bytes

◆ M2MB_BLE_UUID_T

BLE UUID.

Enumeration that indicates BLE UUID type,16,32,128 bit

Enumeration Type Documentation

◆ M2MB_BLE_ADDRESS_TYPE_T

BLE address types.

Enumeration that indicates 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_ADV_TYPE_T

BLE ADV type.

Enumeration that indicates BLE advertisement type

Enumerator
M2MB_BLE_ADVERTISE_ON_WITH_CUSTOMIZED_ADV_DISABLE 

Indicates BLE advertise on with customized advertisement disable.

M2MB_BLE_ADVERTISE_ON_WITH_CUSTOMIZED_ADV_ENABLE 

Indicates BLE advertise on with customized advertisement enable.

M2MB_BLE_ADVERTISE_OFF 

Indicates BLE advertise OFF.

◆ M2MB_BLE_ADVERTISE_EVENT_TYPE_T

BLE Advertise event.

Enumeration that indicates BLE Advertise event types < Enumeration of the 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 

Scannable undirected advertising.

M2MB_BLE_ADV_EVT_TYPE_NON_CONNECTABLE 

Nonconnectable undirected advertising.

M2MB_BLE_ADV_EVT_TYPE_SCAN_RSP 

scan response.

◆ M2MB_BLE_CCCD_T

BLE CCCD.

Enumeration that indicates BLE CCCD values

Enumerator
M2MB_BLE_DISABLE_INDICATION_NOTIFICATION_E 

Indicates disable indication and notification.

M2MB_BLE_ENABLE_NOTIFICATION_E 

Indicates enable notification.

M2MB_BLE_ENABLE_INDICATION_E 

Indicates enable indication.

◆ M2MB_BLE_CENTRAL_SCAN_FILTER_DUPLICATES_T

Scan results duplicate filtering.

Enumeration that indicates Scan results duplicate filtering

Enumerator
M2MB_BLE_SCAN_FILTER_DUPLICATE_DISABLE 

Duplicate filtering disabled.

M2MB_BLE_SCAN_FILTER_DUPLICATE_ENABLE 

Duplicate filtering enabled.

◆ M2MB_BLE_CONFIG_PARAM_T

BLE configuration parameters.

Enumeration that indicates BLE configuration parameters like adv set, scan duration set, etc,.

Enumerator
M2MB_BLE_CFG_GET_E 

Indicates BLE configuration get.

M2MB_BLE_CFG_SET_E 

Indicates BLE configuration set.

M2MB_BLE_CFG_SCAN_DURATION_GET_E 

Indicates BLE scan duration get.

M2MB_BLE_CFG_SCAN_DURATION_SET_E 

Indicates BLE scan duration set.

M2MB_BLE_CFG_SCAN_INTERVAL_GET_E 

Indicates BLE scan interval get.

M2MB_BLE_CFG_SCAN_INTERVAL_SET_E 

Indicates BLE scan interval set.

M2MB_BLE_CFG_SCAN_WINDOW_GET_E 

Indicates BLE scan window get.

M2MB_BLE_CFG_SCAN_WINDOW_SET_E 

Indicates BLE scan window set.

M2MB_BLE_CFG_SCAN_FILTER_POLICY_GET_E 

Indicates BLE scan filter policy get.

M2MB_BLE_CFG_SCAN_FILTER_POLICY_SET_E 

Indicates BLE scan filter policy set.

M2MB_BLE_CFG_SCAN_FILTER_DUPLICATES_GET_E 

Indicates BLE scan filter duplicates get.

M2MB_BLE_CFG_SCAN_FILTER_DUPLICATES_SET_E 

Indicates BLE scan filter duplicates set.

M2MB_BLE_CFG_ADV_INT_MIN_GET_E 

Indicates BLE advertise interval minimum get.

M2MB_BLE_CFG_ADV_INT_MIN_SET_E 

Indicates BLE advertise interval minimum set.

M2MB_BLE_CFG_ADV_INT_MAX_GET_E 

Indicates BLE advertise interval maximum get.

M2MB_BLE_CFG_ADV_INT_MAX_SET_E 

Indicates BLE advertise interval maximum set.

M2MB_BLE_CFG_ADV_DATA_GET_E 

Indicates BLE advertise data get.

M2MB_BLE_CFG_ADV_DATA_SET_E 

Indicates BLE advertise data set.

M2MB_BLE_CFG_SCAN_RSP_DATA_GET_E 

Indicates BLE scan response data get.

M2MB_BLE_CFG_SCAN_RSP_DATA_SET_E 

Indicates BLE scan response data set.

M2MB_BLE_CFG_CONNECT_MODE_GET_E 

Indicates BLE connect mode get.

M2MB_BLE_CFG_CONNECT_MODE_SET_E 

Indicates BLE connect mode set.

M2MB_BLE_CFG_DISCOVER_MODE_GET_E 

Indicates BLE discovery mode get.

M2MB_BLE_CFG_DISCOVER_MODE_SET_E 

Indicates BLE discovery mode set.

M2MB_BLE_CFG_PAIR_MODE_GET_E 

Indicates BLE pair mode get.

M2MB_BLE_CFG_PAIR_MODE_SET_E 

Indicates BLE paor mode set.

M2MB_BLE_CFG_CONNECTION_INT_MIN_GET_E 

Indicates BLE connection interval minimum get.

M2MB_BLE_CFG_CONNECTION_INT_MIN_SET_E 

Indicates BLE connection interval minimum set.

M2MB_BLE_CFG_CONNECTION_INT_MAX_GET_E 

Indicates BLE connection interval maximum get.

M2MB_BLE_CFG_CONNECTION_INT_MAX_SET_E 

Indicates BLE connection interval maximum set.

M2MB_BLE_CFG_SLAVE_LATENCY_GET_E 

Indicates BLE slave latency get.

M2MB_BLE_CFG_SLAVE_LATENCY_SET_E 

Indicates BLE slave latency set.

M2MB_BLE_CFG_SUPERVISION_TIMEOUT_GET_E 

Indicates BLE supervision timeout get.

M2MB_BLE_CFG_SUPERVISION_TIMEOUT_SET_E 

Indicates BLE supervision timeout set.

M2MB_BLE_CFG_IOCAPABILITY_GET_E 

Indicates BLE IO capability timeout get.

M2MB_BLE_CFG_IOCAPABILITY_SET_E 

Indicates BLE IO capability timeout set.

M2MB_BLE_CFG_MITM_GET_E 

Indicates BLE MITM get.

M2MB_BLE_CFG_MITM_SET_E 

Indicates BLE MITM set.

M2MB_BLE_CFG_FIXPIN_GET_E 

Indicates BLE FIXPIN get.

M2MB_BLE_CFG_FIXPIN_SET_E 

Indicates BLE FIXPIN set.

M2MB_BLE_CFG_LEPRIVACY_GET_E 

Indicates BLE LEPRIVACY get.

M2MB_BLE_CFG_LEPRIVACY_SET_E 

Indicates BLE LEPRIVACY set.

M2MB_BLE_CFG_BOND_STORE_SUPPORT_GET_E 

Indicates BLE bond store support get.

M2MB_BLE_CFG_BOND_STORE_SUPPORT_SET_E 

Indicates BLE bond store support set.

M2MB_BLE_CFG_BOND_SIZE_GET_E 

Indicates BLE bond size get.

M2MB_BLE_CFG_BOND_SIZE_SET_E 

Indicates BLE bond size set.

M2MB_BLE_CFG_PNP_VERSION_ID_GET_E 

Indicates BLE PNP version id get.

M2MB_BLE_CFG_PNP_VERSION_ID_SET_E 

Indicates BLE PNP version id set.

M2MB_BLE_CFG_PNP_VERSION_ID_SOURCE_GET_E 

Indicates BLE PNP version id source get.

M2MB_BLE_CFG_PNP_VERSION_ID_SOURCE_SET_E 

Indicates BLE PNP version id source set.

M2MB_BLE_CFG_PNP_PRODUCT_ID_GET_E 

Indicates BLE PNP product id get.

M2MB_BLE_CFG_PNP_PRODUCT_ID_SET_E 

Indicates BLE PNP product id set.

M2MB_BLE_CFG_PNP_PRODUCT_VERSION_GET_E 

Indicates BLE PNP product version get.

M2MB_BLE_CFG_PNP_PRODUCT_VERSION_SET_E 

Indicates BLE PNP product version set.

M2MB_BLE_CFG_BLE_ROLE_GET_E 

Indicates BLE role get.

M2MB_BLE_CFG_BLE_ROLE_SET_E 

Indicates BLE role set.

M2MB_BLE_CFG_BLE_BD_ADDR_GET_E 

Indicates BLE device address get.

M2MB_BLE_CFG_BLE_DEVICE_NAME_GET_E 

Indicates BLE device name get.

M2MB_BLE_CFG_BLE_DEVICE_NAME_SET_E 

Indicates BLE device name set.

M2MB_BLE_CFG_BLE_MANUFACTURER_NAME_GET_E 

Indicates BLE device manufacturer name get.

M2MB_BLE_CFG_BLE_MANUFACTURER_NAME_SET_E 

Indicates BLE device manufacturer name set.

M2MB_BLE_CFG_BLE_TIO_MODE_GET_E 

Indicates BLE TIO mode get.

M2MB_BLE_CFG_BLE_TIO_MODE_SET_E 

Indicates BLE TIO mode set.

◆ M2MB_BLE_CONNECTABILITY_MODE_T

BLE connectability modes.

Enumeration that indicates BLE connectability modes < Enumeration of the 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.

◆ M2MB_BLE_DISCOVERABILITY_MODE_T

BLE discoverability modes.

Enumeration that indicates BLE discoverability modes < Enumeration of the 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.

◆ M2MB_BLE_GATT_ATTRIB_TYPE_T

BLE GATT attribute type.

Enumeration that indicates BLE GATT attribute type

Enumerator
M2MB_BLE_GATT_PRIMARY_SERVICE_E 

Indicates GATT primary service.

M2MB_BLE_GATT_SECONDARY_SERVICE_E 

Indicates GATT secondary service.

M2MB_BLE_GATT_INCLUDED_SERVICE_E 

Indicates GATT included service.

M2MB_BLE_GATT_CHARACTERISTIC_E 

Indicates GATT characteristic.

M2MB_BLE_GATT_DESCRIPTOR_E 

Indicates GATT descriptor.

◆ M2MB_BLE_INIT_STATE_T

BLE INIT state.

Enumeration that indicates BLE INIT state

Enumerator
M2MB_BLE_STATE_INITIALIZED 

Indicates BLE state initialized.

M2MB_BLE_STATE_UNINITIALIZED 

Indicates BLE state uninitialized.

◆ M2MB_BLE_IO_CAPABILITY_T

different IO Capabilities of an LE device

enumerated type represents the different IO Capabilities of an LE device may have (used during pairing procedure). < The following enumerated type represents the different IO Capabilities of an LE device may have (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_PAIRABILITY_MODE_T

BLE pairability modes.

Enumeration that indicates BLE pairability modes < Enumeration of the 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.

◆ M2MB_BLE_RESPONSE_T

BLE status.

Enumeration that indicates status of BLE operations

Enumerator
M2MB_BLE_STATUS_SUCCESS_E 

Indicates BLE status success.

M2MB_BLE_STATUS_FAILURE_E 

Indicates BLE status failure.

M2MB_BLE_STATUS_OUT_OF_RANGE_E 

Indicates BLE status out of range.

M2MB_BLE_STATUS_NOT_READY_E 

Indicates BLE status not ready.

M2MB_BLE_STATUS_UNSUPPORTED_E 

Indicates BLE status unsupported.

M2MB_BLE_STATUS_PARAM_INVALID_E 

Indicates BLE status invalid parameters.

M2MB_BLE_STATUS_NO_MEM_E 

Indicates BLE status no memory.

M2MB_BLE_STATUS_AUTH_FAILURE_E 

Indicates BLE status authentication failure.

M2MB_BLE_STATUS_AUTH_REJECTED_E 

Indicates BLE status authentication rejected.

M2MB_BLE_STATUS_INVALID_E 

Indicates BLE status Invalid.

M2MB_BLE_STATUS_ERR_INVALID_HANDLE_E 

Indicates BLE status invalid handle error.

M2MB_BLE_STATUS_ERR_READ_NOT_PERMITTED_E 

Indicates BLE status read not permitted error.

M2MB_BLE_STATUS_ERR_WRITE_NOT_PERMITTED_E 

Indicates BLE status write not permitted error.

M2MB_BLE_STATUS_ERR_INVALID_PDU_E 

Indicates BLE status invalid PDU error.

M2MB_BLE_STATUS_ERR_REQUEST_NOT_SUPPORTED_E 

Indicates BLE status request not supported error.

M2MB_BLE_STATUS_ERR_INVALID_OFFSET_E 

Indicates BLE status invalid OFFSET error.

M2MB_BLE_STATUS_ERR_ATTRIBUTE_NOT_FOUND_E 

Indicates BLE status attribute not found error.

M2MB_BLE_STATUS_ERR_INVALID_ATTRIBUTE_VALUE_LENGTH_E 

Indicates BLE status invalid attribute value length error.

M2MB_BLE_STATUS_ERR_OUT_OF_ORDER_E 

Indicates BLE status out of order error.

M2MB_BLE_STATUS_ERR_INSUFFICIENT_AUTHORIZATION_E 

Indicates BLE status insufficient authorization error.

M2MB_BLE_STATUS_ERR_INSUFFICIENT_AUTHENTICATION_E 

Indicates BLE status insufficient authentication error.

M2MB_BLE_STATUS_ERR_INSUFFICIENT_ENCRYPTION_E 

Indicates BLE status insufficient encryption error.

◆ M2MB_BLE_ROLE_T

BLE Role.

Enumeration that indicates BLE roles

Enumerator
M2MB_BLE_PERIPHERAL_ROLE_E 

Peripheral role

M2MB_BLE_CENTRAL_ROLE_E 

Central role

M2MB_BLE_DUAL_ROLE_E 

Both peripheral and central roles

◆ M2MB_BLE_USER_EVENTS_T

BLE EVENTS to the user.

Enumeration that indicates BLE EVENTS to the user / application layer from M2MB to registered callback

Enumerator
M2MB_BLE_PERIPHERAL_CONNECT_EVENT_E 

Indicates BLE peripheral connect event.

M2MB_BLE_PERIPHERAL_DISCONNECT_EVENT_E 

Indicates BLE peripheral disconnect event.

M2MB_BLE_PERIPHERAL_MTU_UPDATE_EVENT_E 

Indicates BLE peripheral MTU update event.

M2MB_BLE_GATT_SERVER_READ_REQUEST_EVENT_E 

Indicates BLE GATT server read request event.

M2MB_BLE_GATT_SERVER_WRITE_REQUEST_EVENT_E 

Indicates BLE GATT server write request event.

M2MB_BLE_GATT_SERVER_WRITE_WITHOUT_RESPONSE_EVENT_E 

Indicates BLE GATT server write response request event.

M2MB_BLE_GATT_SERVER_NOTIFICATION_ENABLE_EVENT_E 

Indicates BLE GATT server notification enable event.

M2MB_BLE_GATT_SERVER_INDICATION_ENABLE_EVENT_E 

Indicates BLE GATT server indication enable event.

M2MB_BLE_GATT_SERVER_NOTIFY_INDICATE_ENABLE_EVENT_E 

Indicates BLE GATT server notification indication enable event.

M2MB_BLE_GATT_SERVER_NOTIFY_INDICATE_DISABLE_EVENT_E 

Indicates BLE GATT server notification indication disable event.

M2MB_BLE_GATT_SERVER_NOTIFY_INDICATE_READ_EVENT_E 

Indicates BLE GATT server notification indication read event.

M2MB_BLE_GATT_SERVER_CHAR_VALUE_UPDATED_EVENT_E 

Indicates BLE GATT server characteristic value update event.

M2MB_BLE_SCAN_EVENT_E 

Indicates BLE scan event.

M2MB_BLE_CENTRAL_CONNECT_EVENT_E 

Indicates BLE central connect event.

M2MB_BLE_CENTRAL_DISCONNECT_EVENT_E 

Indicates BLE central disconnect event.

M2MB_BLE_CENTRAL_MTU_UPDATE_EVENT_E 

Indicates BLE central MTU update event.

M2MB_BLE_CENTRAL_NOTIFY_INDICATE_EVENT_E 

Indicates BLE central notify indicate event.

M2MB_BLE_CENTRAL_WRITE_EVENT_E 

Indicates BLE central write event.

M2MB_BLE_CENTRAL_READ_EVENT_E 

Indicates BLE central read event.

M2MB_BLE_CONNECT_PARAM_UPDATE_EVENT_E 

Indicates BLE connection parameter update event.

M2MB_BLE_SSP_PIN_NOTIFICATION_EVENT_E 

Indicates BLE SSP pin notification event.

M2MB_BLE_SSP_PIN_EVENT_E 

Indicates BLE SSP pin event.

M2MB_BLE_SSP_CONF_EVENT_E 

Indicates BLE SSP conformation event.

M2MB_BLE_PROVISIONING_SCAN_EVENT_E 

Indicates BLE provisioning scan event.

M2MB_BLE_PROVISIONING_CONNECT_EVENT_E 

Indicates BLE provisioning connect event.

◆ M2MB_BLE_UUID_TYPE_T

BLE UUID.

Enumeration that indicates BLE 16,32,128 bit UUID's

Enumerator
UUID_TYPE_16_BIT_E 

Indicates 16 bit UUID.

UUID_TYPE_32_BIT_E 

Indicates 32 bit UUID.

UUID_TYPE_128_BIT_E 

Indicates 128 bit UUID.

Function Documentation

◆ m2mb_ble_advertise()

M2MB_BLE_RESPONSE_T m2mb_ble_advertise ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_ADV_TYPE_T  adv_type 
)

Starts advertising.

This function starts advertisement based on advertisement type

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]adv_typeType of advertisement
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

Gets the Device information.

Gets the Device information based on bd address

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]bd_addrspecifies remote device address
[in]dev_infospecifies device information
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ 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 bond information.

This function deletes bond information for a praticular bd address or entire bond information

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]bd_addrremote device address
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ 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 bond information.

This function gives the bond list information

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[out]bond_list_infoPointer to bond list info structure
[out]num_of_entriesnumber of bonded ble devices in the bond list
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

CCCD value request.

CCCD value request to the particular service's characteristic ID

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]connection_idspecifies connection id previously created by m2mb_ble_connect api
[in]char_handlespecifies the characteristic handle
[in]cccd_valspecifies the characteristic cccd value
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ m2mb_ble_conf()

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

BLE configuration API.

This API will accept variable length arguments as part of its last parameter. ble_handle:ble_handle from BLE init API num_cmds: number of params follows after this param VA_ARGS (...): This final parameter is variable argument list. Make sure the first parameter in the variable arugument list is the Action on param (enum type to set or get ble param), followed by the "ble config param values". "ble config param values" can be a pointer to structure which is defined based on m2mb_ble_conf enum type (or) ble config param values can be passed individually to the API.

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]num_cmdsspecifies number of params follows after this param
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

Connects to the BLE remote device.

Connects to the particular BLE device (BD address provided by the user)

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]bd_addrremote device address
[in]bd_addr_typeremote device address type
[out]connection_id
This parameter is set by the m2mb API on successful connect. This connection ID is used for read, write, disconnect etc.,
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

Gets the Device information.

Gets device information based on connection id

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]conn_idspecifies connection id
[out]dev_infothis argument filled with device info
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ m2mb_ble_device_bd_addr_get()

M2MB_BLE_RESPONSE_T m2mb_ble_device_bd_addr_get ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_BD_ADDR_T bd_addr 
)

Gets the BLE device bd address.

Gets the BLE device bd address

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[out]bd_addrspecifies remote device address
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ m2mb_ble_disconnect()

M2MB_BLE_RESPONSE_T m2mb_ble_disconnect ( M2MB_BLE_HANDLE  ble_handle,
INT32  connection_id 
)

Disconnects BLE devices.

Based on the connection ID, this function disconnects remote device

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]connection_idconnection id previously created by m2mb_ble_connect API
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

Adds characteristic information.

This function adds characteristic information like UUID, properties

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]propertiesCharacteristic properties
[in]characteristic_uuidCharacteristic UUID
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note
The GATT server configuration like, the number of services supported and number of characteristics supported in each service should be defined by the application based on the memory available in the respective platform. This function must call after m2mb_ble_gatts_service_add

Example

<C code example>

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

Adds characteristic value information.

This function adds characteristic value information such as permissions, value length, value

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]permissionsCharacteristic permissions
[in]value_lenCharacteristic value length
[in]valuevalue in string format
[out]characteristic_idCharacteristic ID or Handle. This value is filled from the m2mb API and this value should be notified to the user
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note
The GATT server configuration like, the number of services supported and number of characteristics supported in each service should be defined by the application based on the memory available in the respective platform. This function must call after m2mb_ble_gatts_characteristic_add

Example

<C code example>

◆ m2mb_ble_gatts_complete()

M2MB_BLE_RESPONSE_T m2mb_ble_gatts_complete ( M2MB_BLE_HANDLE  ble_handle,
UINT32 *  service_id 
)

Register service to the BLE stack.

This function register services to the BLE stack

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[out]service_idThis value is filled from the m2mb API and this value should be notified to the user
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note
The GATT server configuration like, the number of services supported and number of characteristics supported in each service should be defined by the application based on the memory available in the respective platform. This function must call after m2mb_ble_gatts_service_add Example
<C code example>

◆ 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 data to the server.

Send data to the characteristic ID in a particular service

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]serv_idService ID
[in]char_idCharacteristic ID
[in]valueCharacteristic value
[in]value_lenCharacteristic value length
[in]cccdCCCD value
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

Adds ble service.

create service with UUID provided by the user

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]service_uuidService UUID
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note
The GATT server configuration like, the number of services supported and number of characteristics supported in each service should be defined by the application based on the memory available in the respective platform. Example
<C code example>

◆ m2mb_ble_get_init_state()

M2MB_BLE_RESPONSE_T m2mb_ble_get_init_state ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_INIT_STATE_T state 
)

Getting BLE initialization state.

Gets BLE init state by passing handle

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[out]statefilled with BLE state
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ m2mb_ble_initialize()

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

Initialization of BLE.

Initializes BLE and gives handle for application to be used in all contexts and starts event callback

Parameters
[in]ble_callbackBLE event callback function pointer. This function is called for all BLE related events
[in]user_dataA pointer to generic BLE user data that will be returned as it is in the callback
[out]ble_handlePointer to ble_handle. This is filled by ble_init API. This should be used in all M2MB BLE API's
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note
M2MB_BLE_HANDLE is valid until m2mb_ble_shutdown(M2MB_BLE_HANDLE ble_handle) is called

Example

<C code example>

◆ m2mb_ble_provisioning_get()

M2MB_BLE_RESPONSE_T m2mb_ble_provisioning_get ( M2MB_BLE_HANDLE  ble_handle,
INT32 *  status 
)

Gets the provisioning status.

Gets the provisioning status

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[out]statusThis argument filled with provisioning status
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ m2mb_ble_provisioning_set()

M2MB_BLE_RESPONSE_T m2mb_ble_provisioning_set ( M2MB_BLE_HANDLE  ble_handle,
INT32  status 
)

Sets the provisioning status.

provisioning status update when provisioning starts or stops

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]statusspecifies provisioning status
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

Reads value request.

Reads value request from particular service's characteristic ID

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]connection_idspecifies connection id previously created by m2mb_ble_connect api
[in]char_handlespecifies the characteristic handle
[out]value_lenthis param is filled with the characteristic handle value length from m2mb API
[out]valuethis param is filled with the characteristic handle value read from m2mb API
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ m2mb_ble_scan_start()

M2MB_BLE_RESPONSE_T m2mb_ble_scan_start ( M2MB_BLE_HANDLE  ble_handle,
M2MB_BLE_BD_ADDR_T  bd_addr 
)

Starts BLE scanning.

Starts scanning for particular device (BLE address) or scans available devices (Advertising devices)

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]bd_addrremote device address
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ m2mb_ble_scan_stop()

M2MB_BLE_RESPONSE_T m2mb_ble_scan_stop ( M2MB_BLE_HANDLE  ble_handle)

Stops BLE scanning.

Stop BLE scanning

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ m2mb_ble_send_indication()

M2MB_BLE_RESPONSE_T m2mb_ble_send_indication ( M2MB_BLE_HANDLE  ble_handle,
INT32  attribute_handle,
INT32  conn_id,
INT32  len,
INT32  confirm,
UINT8 *  value 
)

Sending indication to the service.

Sending indication to the particular service characteristic id

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]attribute_handlespecifies attribute handle
[in]conn_idspecifies connection id
[in]lenspecifies length
[in]confirmspecifies confirm
[in]valuespecifies value
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ m2mb_ble_shutdown()

M2MB_BLE_RESPONSE_T m2mb_ble_shutdown ( M2MB_BLE_HANDLE  ble_handle)

Deinitialization of BLE.

Deinitialization of BLE by passing ble handle

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

passkey conformation

This function conforms the passkey from user end

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]bd_addrremote device address
[in]bd_addr_typeremote device address type
[in]confirmation_flagflag states whether to pair or not (true or false). If SSPPIN is not received from the user within timeout, the AT command can call this m2mb API with accept_flag as false
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

passkey response

This function is called whenever a callback has been registered for the specified passkey response data event.

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]bd_addrremote device address
[in]bd_addr_typeremote device address type
[in]ssppinSSP passkey
[in]accept_flagflag states whether to pair or not (true or false). If SSPPIN is not received from the user within timeout, the AT command can call this m2mb API with accept_flag as false
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

Starts service discovery.

Starts service discovery and gives available services information from the server

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]connection_idconnection id previously created by m2mb_ble_connect API
[in]uuidspecifies UUID value
[out]resultsservice discovery results
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

◆ 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 value to the particular service's characteristic ID.

Write value to the particular service's characteristic ID

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]connection_idspecifies connection id previously created by m2mb_ble_connect API
[in]char_handlespecifies the characteristic handle
[in]valuespecifies characteristic value
[in]value_lenspecifies characteristic value length
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>

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

Write value request to the particular service's characteristic ID

Parameters
[in]ble_handlespecifies the BLE handle previously created through m2mb_ble_initialize
[in]connection_idspecifies connection id previously created by m2mb_ble_connect api
[in]char_handlespecifies the characteristic handle
[in]valuespecifies characteristic value
[in]value_lenspecifies characteristic value length
Returns
M2MB_BLE_RESPONSE_T: used for success or failure see m2mb_ble.h for details
Note

Example

<C code example>