![]() |
m2mb API docs
25.21.002
m2mb API sets documentation
|
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 |
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) |
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.
| #define M2MB_BLE_ATT_PROTOCOL_ERROR_CODE_INSUFFICIENT_RESOURCES 0x11 |
The following define GATT Characteristic Properties Definitions
| #define M2MB_BLE_GATT_CHARACTERISTIC_PROPERTIES_EXTENDED_PROPERTIES 0x80 |
The following define GATT Client Configuration Characteristic Definitions
| #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.
| #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.
| #define M2MB_BLE_MAX_DEVICE_NAME_LENGTH (39+1) |
GAP_DEVICE_NAME_LEN in gap.h
| #define M2MB_BLE_MAX_PAIRED_DEVICES 4 |
Maximum paired devices allowed when the device is in Central Mode. This is platform specific
| typedef struct M2MB_BLE_BD_ADDR_S 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
| typedef struct M2MB_BLE_BD_NAME_S M2MB_BLE_BD_NAME_T |
Bluetooth Device Name.
Bluetooth Device Name within M2MB_BLE_MAX_DEVICE_NAME_LENGTH Bluetooth Device Name
| typedef INT8 M2MB_BLE_BOARDSTR_T[16] |
BLE board address in string format.
Use to hold MAX address in Hex format. Ex: 0xAABBCCDDEEFF
| typedef struct M2MB_BLE_BOND_LIST_INFO_S M2MB_BLE_BOND_LIST_INFO_T |
BLE bond list information.
maintains BLE bond list information
| typedef struct M2MB_BLE_CENTRAL_CFG_S M2MB_BLE_CENTRAL_CFG_T |
BLE Central configuration parameters.
Enumeration that indicates BLE Central configuration parameters
BLE notification and indication data.
structure to hold notification and indication data from remote GATT server
| typedef struct M2MB_BLE_CGF_S M2MB_BLE_CGF_T |
BLE configuration parameters.
Enumeration that indicates BLE configuration parameters
| typedef struct M2MB_BLE_CONN_PARAM_S M2MB_BLE_CONN_PARAM_T |
BLE connection configuration parameters.
Enumeration that indicates BLE connection configuration parameters
| typedef struct M2MB_BLE_DEVICE_INFO_S 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.
| typedef struct M2MB_BLE_DIS_INFO_S M2MB_BLE_DIS_INFO_T |
BLE DIS configuration parameters.
Enumeration that indicates BLE DIS configuration parameters
| 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
| typedef struct M2MB_BLE_GATT_ELEMENT_S M2MB_BLE_GATT_ELEMENT_T |
BLE GATT elements.
maintains BLE GATT elements
BLE GATT server event details.
maintain BLE GATT server event details like service id, value, etc,.
| typedef struct M2MB_BLE_GATT_SRVD_S M2MB_BLE_GATT_SRVD_T |
BLE service discovery feature.
used for service discovery feature
| typedef struct M2MB_BLE_GENERAL_PARAM_S M2MB_BLE_GENERAL_PARAM_T |
BLE general configuration parameters.
Enumeration that indicates BLE general configuration parameters
| typedef HANDLE M2MB_BLE_HANDLE |
BLE handle.
BLE handle for all contexts
| typedef struct M2MB_BLE_PERIPHERAL_CFG_S M2MB_BLE_PERIPHERAL_CFG_T |
BLE Peripheral configuration parameters.
Enumeration that indicates BLE Peripheral configuration parameters
| typedef struct M2MB_BLE_SCAN_REPORT_DATA_S 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
| typedef struct M2MB_BLE_SECURITY_CFG_S M2MB_BLE_SECURITY_CFG_T |
BLE security configuration parameters.
Enumeration that indicates BLE security configuration parameters
| typedef struct M2MB_BLE_USER_EVENT_CTX_S M2MB_BLE_USER_EVENT_CTX_T |
BLE user event.
This BLE user event context is sent to registered callback with user event type
| typedef struct M2MB_BLE_UUID_128_S M2MB_BLE_UUID_128_T |
BLE 128 bit UUID.
used to store BLE 128 bit UUID bytes
| typedef struct M2MB_BLE_UUID_16_S M2MB_BLE_UUID_16_T |
BLE 16 bit UUID.
used to store BLE 16 bit UUID bytes
| typedef struct M2MB_BLE_UUID_32_S M2MB_BLE_UUID_32_T |
BLE 32 bit UUID.
used to store BLE 32 bit UUID bytes
| typedef struct M2MB_BLE_UUID_S M2MB_BLE_UUID_T |
BLE UUID.
Enumeration that indicates BLE UUID type,16,32,128 bit
BLE address types.
Enumeration that indicates BLE address types
| enum M2MB_BLE_ADV_TYPE_T |
BLE ADV type.
Enumeration that indicates BLE advertisement type
BLE Advertise event.
Enumeration that indicates BLE Advertise event types < Enumeration of the BLE Advertise event types
| enum M2MB_BLE_CCCD_T |
BLE configuration parameters.
Enumeration that indicates BLE configuration parameters like adv set, scan duration set, etc,.
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. |
BLE GATT attribute type.
Enumeration that indicates BLE GATT attribute type
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).
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. |
| enum M2MB_BLE_RESPONSE_T |
BLE status.
Enumeration that indicates status of BLE operations
| enum M2MB_BLE_ROLE_T |
BLE EVENTS to the user.
Enumeration that indicates BLE EVENTS to the user / application layer from M2MB to registered callback
| enum M2MB_BLE_UUID_TYPE_T |
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | adv_type | Type of advertisement |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | bd_addr | specifies remote device address |
| [in] | dev_info | specifies device information |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | bd_addr | remote device address |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [out] | bond_list_info | Pointer to bond list info structure |
| [out] | num_of_entries | number of bonded ble devices in the bond list |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | connection_id | specifies connection id previously created by m2mb_ble_connect api |
| [in] | char_handle | specifies the characteristic handle |
| [in] | cccd_val | specifies the characteristic cccd value |
Example
| 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.
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | num_cmds | specifies number of params follows after this param |
Example
| 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)
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | bd_addr | remote device address |
| [in] | bd_addr_type | remote 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., |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | conn_id | specifies connection id |
| [out] | dev_info | this argument filled with device info |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [out] | bd_addr | specifies remote device address |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | connection_id | connection id previously created by m2mb_ble_connect API |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | properties | Characteristic properties |
| [in] | characteristic_uuid | Characteristic UUID |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | permissions | Characteristic permissions |
| [in] | value_len | Characteristic value length |
| [in] | value | value in string format |
| [out] | characteristic_id | Characteristic ID or Handle. This value is filled from the m2mb API and this value should be notified to the user |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [out] | service_id | This value is filled from the m2mb API and this value should be notified to the user |
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | serv_id | Service ID |
| [in] | char_id | Characteristic ID |
| [in] | value | Characteristic value |
| [in] | value_len | Characteristic value length |
| [in] | cccd | CCCD value |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | service_uuid | Service UUID |
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [out] | state | filled with BLE state |
Example
| 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
| [in] | ble_callback | BLE event callback function pointer. This function is called for all BLE related events |
| [in] | user_data | A pointer to generic BLE user data that will be returned as it is in the callback |
| [out] | ble_handle | Pointer to ble_handle. This is filled by ble_init API. This should be used in all M2MB BLE API's |
Example
| M2MB_BLE_RESPONSE_T m2mb_ble_provisioning_get | ( | M2MB_BLE_HANDLE | ble_handle, |
| INT32 * | status | ||
| ) |
Gets the provisioning status.
Gets the provisioning status
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [out] | status | This argument filled with provisioning status |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | status | specifies provisioning status |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | connection_id | specifies connection id previously created by m2mb_ble_connect api |
| [in] | char_handle | specifies the characteristic handle |
| [out] | value_len | this param is filled with the characteristic handle value length from m2mb API |
| [out] | value | this param is filled with the characteristic handle value read from m2mb API |
Example
| 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)
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | bd_addr | remote device address |
Example
| M2MB_BLE_RESPONSE_T m2mb_ble_scan_stop | ( | M2MB_BLE_HANDLE | ble_handle | ) |
Stops BLE scanning.
Stop BLE scanning
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | attribute_handle | specifies attribute handle |
| [in] | conn_id | specifies connection id |
| [in] | len | specifies length |
| [in] | confirm | specifies confirm |
| [in] | value | specifies value |
Example
| M2MB_BLE_RESPONSE_T m2mb_ble_shutdown | ( | M2MB_BLE_HANDLE | ble_handle | ) |
Deinitialization of BLE.
Deinitialization of BLE by passing ble handle
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | bd_addr | remote device address |
| [in] | bd_addr_type | remote device address type |
| [in] | confirmation_flag | flag 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 |
Example
| 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.
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | bd_addr | remote device address |
| [in] | bd_addr_type | remote device address type |
| [in] | ssppin | SSP passkey |
| [in] | accept_flag | flag 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 |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | connection_id | connection id previously created by m2mb_ble_connect API |
| [in] | uuid | specifies UUID value |
| [out] | results | service discovery results |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | connection_id | specifies connection id previously created by m2mb_ble_connect API |
| [in] | char_handle | specifies the characteristic handle |
| [in] | value | specifies characteristic value |
| [in] | value_len | specifies characteristic value length |
Example
| 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
| [in] | ble_handle | specifies the BLE handle previously created through m2mb_ble_initialize |
| [in] | connection_id | specifies connection id previously created by m2mb_ble_connect api |
| [in] | char_handle | specifies the characteristic handle |
| [in] | value | specifies characteristic value |
| [in] | value_len | specifies characteristic value length |
Example