Bluetooth generic API. More...
Go to the source code of this file.
Classes | |
struct | bt_common_state_s |
Bluetooth base context. More... | |
struct | bt_acl_state_s |
Bluetooth ACL context. More... | |
struct | ble_state_s |
Bluetooth LE context. More... | |
struct | bt_common_ops_s |
Bluetooth Common application callbacks. More... | |
struct | ble_common_ops_s |
Bluetooth LE Common application callbacks. More... | |
Enumerations | |
enum | BT_CONNECT_STATUS { BT_DISCONNECTED = 0, BT_DISCONNECTING = 1, BT_CONNECTING = 2, BT_CONNECTED = 3 } |
BT profile connection status. More... | |
Functions | |
int | bt_init (void) |
Bluetooth module initialize For initialize a pin config, NV storage, UART, etc. More... | |
int | bt_finalize (void) |
Bluetooth module finalize. More... | |
int | bt_set_address (BT_ADDR *addr) |
Set Bluetooth module address This is Spresense side address and should be call before bt_enable. More... | |
int | bt_get_address (BT_ADDR *addr) |
Get Bluetooth module address. More... | |
int | bt_set_name (char *name) |
Set Bluetooth module name This name visible for other devices and should be call before bt_enable. More... | |
int | bt_get_name (char *name) |
Get Bluetooth module name. More... | |
int | bt_enable (void) |
Bluetooth module enable Bluetooth set power on(and download firmware, etc). More... | |
int | bt_disable (void) |
Bluetooth module disable Bluetooth set power off. More... | |
int | bt_pairing_enable (void) |
Bluetooth pairing enable Entering bluetooth pairing mode. More... | |
int | bt_paring_disable (void) |
Bluetooth pairing disable Escaping bluetooth pairing mode. More... | |
int | bt_get_bond_list (BT_ADDR *addr, int *num) |
Bluetooth get bond device list Get bond devices list with BD_ADDR. More... | |
int | bt_unbond (BT_ADDR *addr) |
Bluetooth unbond by BD_ADDR Unbond device by BD_ADDR. More... | |
int | bt_set_visibility (BT_VISIBILITY visibility) |
Bluetooth set visible Visible this device from others. More... | |
int | bt_start_inquiry (void) |
Bluetooth inquiry start Start to inquiry for connect peer device. More... | |
int | bt_cancel_inquiry (void) |
Bluetooth inquiry cancel Cancel to inquiry. More... | |
int | bt_register_common_cb (struct bt_common_ops_s *bt_common_ops) |
Bluetooth register common callbacks Register Connect/Pairing/Inquiry callback. More... | |
int | ble_set_address (BT_ADDR *addr) |
Set Bluetooth LE module address This is Spresense side address and should be call before bt_enable. More... | |
int | ble_get_address (BT_ADDR *addr) |
Get Bluetooth LE module address. More... | |
int | ble_set_name (char *name) |
Set Bluetooth LE module name This name visible for other devices and should be call before bt_enable. More... | |
int | ble_get_name (char *name) |
Get Bluetooth LE module name. More... | |
int | ble_enable (void) |
Bluetooth LE enable. More... | |
int | ble_disable (void) |
Bluetooth LE disable. More... | |
int | ble_connect (struct ble_state_s *ble_state) |
Bluetooth LE connect for Central. More... | |
int | ble_disconnect (struct ble_state_s *ble_state) |
Bluetooth LE dicsonnect for Central. More... | |
int | ble_start_advertise (void) |
Bluetooth LE start advertise Start BLE advertise mode. More... | |
int | ble_cancel_advertise (void) |
Bluetooth LE cancel advertise Cancel BLE advertise mode. More... | |
int | ble_start_scan (void) |
Bluetooth LE start scan Start BLE scan mode. More... | |
int | ble_cancel_scan (void) |
Bluetooth LE cancel scan Cancel BLE scan mode. More... | |
int | ble_register_common_cb (struct ble_common_ops_s *ble_common_ops) |
Bluetooth LE register common callbacks Register Connect/Advertise/Scan callback. More... | |
Bluetooth generic API.
This API is generic functions for bluetooth operations
enum BT_CONNECT_STATUS |
int bt_init | ( | void | ) |
Bluetooth module initialize For initialize a pin config, NV storage, UART, etc.
error | code |
int bt_finalize | ( | void | ) |
Bluetooth module finalize.
error | code |
int bt_set_address | ( | BT_ADDR * | addr | ) |
Set Bluetooth module address This is Spresense side address and should be call before bt_enable.
[in] | addr | Bluetooth device address BT_ADDR |
error | code |
int bt_get_address | ( | BT_ADDR * | addr | ) |
Get Bluetooth module address.
[out] | addr | Bluetooth device address BT_ADDR |
error | code |
int bt_set_name | ( | char * | name | ) |
Set Bluetooth module name This name visible for other devices and should be call before bt_enable.
[in] | name | Bluetooth device name |
error | code |
int bt_get_name | ( | char * | name | ) |
Get Bluetooth module name.
[out] | name | Bluetooth device name |
error | code |
int bt_enable | ( | void | ) |
Bluetooth module enable Bluetooth set power on(and download firmware, etc).
error | code |
int bt_disable | ( | void | ) |
Bluetooth module disable Bluetooth set power off.
error | code |
int bt_pairing_enable | ( | void | ) |
Bluetooth pairing enable Entering bluetooth pairing mode.
error | code |
int bt_paring_disable | ( | void | ) |
Bluetooth pairing disable Escaping bluetooth pairing mode.
error | code |
int bt_get_bond_list | ( | BT_ADDR * | addr, |
int * | num | ||
) |
Bluetooth get bond device list Get bond devices list with BD_ADDR.
[in] | addr | Device address list BT_ADDR |
[in] | num | Number of BD_ADDR |
error | code |
int bt_unbond | ( | BT_ADDR * | addr | ) |
Bluetooth unbond by BD_ADDR Unbond device by BD_ADDR.
[out] | addr | Unbond device BD_ADDR BT_ADDR |
error | code |
int bt_set_visibility | ( | BT_VISIBILITY | visibility | ) |
Bluetooth set visible Visible this device from others.
[in] | visibility | Device visibility parameter BT_VISIBILITY |
error | code |
int bt_start_inquiry | ( | void | ) |
Bluetooth inquiry start Start to inquiry for connect peer device.
error | code |
int bt_cancel_inquiry | ( | void | ) |
Bluetooth inquiry cancel Cancel to inquiry.
error | code |
int bt_register_common_cb | ( | struct bt_common_ops_s * | bt_common_ops | ) |
Bluetooth register common callbacks Register Connect/Pairing/Inquiry callback.
[in] | bt_common_ops | Application callback bt_common_ops_s |
error | code |
int ble_set_address | ( | BT_ADDR * | addr | ) |
Set Bluetooth LE module address This is Spresense side address and should be call before bt_enable.
[in] | addr | Bluetooth LE device address BT_ADDR |
error | code |
int ble_get_address | ( | BT_ADDR * | addr | ) |
Get Bluetooth LE module address.
[out] | addr | Bluetooth LE device address BT_ADDR |
error | code |
int ble_set_name | ( | char * | name | ) |
Set Bluetooth LE module name This name visible for other devices and should be call before bt_enable.
[in] | name | Bluetooth LE device name |
error | code |
int ble_get_name | ( | char * | name | ) |
Get Bluetooth LE module name.
[out] | name | Bluetooth LE device name |
error | code |
int ble_enable | ( | void | ) |
Bluetooth LE enable.
error | code |
int ble_disable | ( | void | ) |
Bluetooth LE disable.
error | code |
int ble_connect | ( | struct ble_state_s * | ble_state | ) |
Bluetooth LE connect for Central.
[in] | ble_state | Bluetooth context ble_state_s |
error | code |
int ble_disconnect | ( | struct ble_state_s * | ble_state | ) |
Bluetooth LE dicsonnect for Central.
[in] | ble_state | Bluetooth context ble_state_s |
error | code |
int ble_start_advertise | ( | void | ) |
Bluetooth LE start advertise Start BLE advertise mode.
error | code |
int ble_cancel_advertise | ( | void | ) |
Bluetooth LE cancel advertise Cancel BLE advertise mode.
error | code |
int ble_start_scan | ( | void | ) |
Bluetooth LE start scan Start BLE scan mode.
error | code |
int ble_cancel_scan | ( | void | ) |
Bluetooth LE cancel scan Cancel BLE scan mode.
error | code |
int ble_register_common_cb | ( | struct ble_common_ops_s * | ble_common_ops | ) |
Bluetooth LE register common callbacks Register Connect/Advertise/Scan callback.
[in] | ble_common_ops | Application callback ble_common_ops_s |
error | code |