bluetooth 2.0.0.0
|
Functions | |
void | bluetooth_cfg_setup (bluetooth_cfg_t *cfg) |
Config Object Initialization function. | |
BLUETOOTH_RETVAL | bluetooth_init (bluetooth_t *ctx, bluetooth_cfg_t *cfg) |
Initialization function. | |
void | bluetooth_generic_write (bluetooth_t *ctx, char *data_buf, uint16_t len) |
Generic write function. | |
int32_t | bluetooth_generic_read (bluetooth_t *ctx, char *data_buf, uint16_t max_len) |
Generic read function. | |
void | bluetooth_write_command (bluetooth_t *ctx, char *data_buf, uint16_t len) |
Write command function. | |
void | bluetooth_enable (bluetooth_t *ctx) |
Enable device function. | |
void | bluetooth_hw_reset (bluetooth_t *ctx) |
Hardwere reset function. | |
void | bluetooth_enter_command_mode (bluetooth_t *ctx) |
Enter the command mode function. | |
void | bluetooth_exit_command_mode (bluetooth_t *ctx) |
Exit the command mode function. | |
void | bluetooth_toggle_echo (bluetooth_t *ctx) |
Toggles echo function. | |
void | bluetooth_set_device_name (bluetooth_t *ctx, uint8_t *name) |
Set the device name function. | |
void | bluetooth_set_operating_mode (bluetooth_t *ctx, uint8_t op_mode) |
Set the operating mode function. | |
void | bluetooth_enable_7_bit_data_mode (bluetooth_t *ctx) |
Enable 7-Bit data mode function. | |
void | bluetooth_disable_7_bit_data_mode (bluetooth_t *ctx) |
Disable 7-Bit data mode function. | |
void | bluetooth_set_authentication (bluetooth_t *ctx, uint8_t auth_value) |
Set the authentication function. | |
void | bluetooth_set_break (bluetooth_t *ctx, uint8_t break_signal) |
Set the break function. | |
BLUETOOTH_RETVAL | bluetooth_set_cod (bluetooth_t *ctx, uint8_t *msw, uint8_t *lsw) |
Sets the class of device (COD) function. | |
void | bluetooth_set_factory_defaults (bluetooth_t *ctx) |
Set factory defaults settings function. | |
void | bluetooth_set_discoverability (bluetooth_t *ctx, uint8_t *d_hex_value) |
Set enable an inquiry scan function. | |
void | bluetooth_setConnectability (bluetooth_t *ctx, uint8_t *c_hex_value) |
Set enable page scanning function. | |
BLUETOOTH_RETVAL | bluetooth_set_uart_parity (bluetooth_t *ctx, uint8_t character) |
Set UART parity function. | |
void | bluetooth_set_extended_status_string (bluetooth_t *ctx, uint8_t *es_string) |
Set extended status string function. | |
BLUETOOTH_RETVAL | bluetooth_set_security_pin_code (bluetooth_t *ctx, uint8_t *sp_code) |
Set security pin code function. | |
BLUETOOTH_RETVAL | bluetooth_set_special_config (bluetooth_t *ctx, uint16_t special_config) |
Set special configuration settings function. | |
void | bluetooth_set_remote_address (bluetooth_t *ctx, uint8_t *r_addr) |
Set the remote Bluetooth address function. | |
BLUETOOTH_RETVAL | bluetooth_set_baud_rate (bluetooth_t *ctx, uint32_t baud_rate) |
Set the baud rate function. | |
void | bluetooth_enable_bonding (bluetooth_t *ctx) |
Set bonding enable function. | |
void | bluetooth_disable_bonding (bluetooth_t *ctx) |
Set bonding disable function. | |
void | bluetooth_reboot (bluetooth_t *ctx) |
Reboot the module function. | |
BLUETOOTH_RETVAL | bluetooth_set_profile (bluetooth_t *ctx, uint8_t profile) |
Set the profile function. | |
void | bluetooth_enable_role_switch (bluetooth_t *ctx) |
Enables the role switch function. | |
void | bluetooth_disable_role_switch (bluetooth_t *ctx) |
Disables the role switch function. | |
void | bluetooth_connect_to_remote_address (bluetooth_t *ctx, uint8_t *r_addr) |
Connect the device to a remote address function. | |
void | bluetooth_connect_to_remote_address_fast_mode (bluetooth_t *ctx, uint8_t *r_addr) |
Connect the device to a remote address fast mode function. | |
void | bluetooth_endspecial_config (bluetooth_t *ctx) |
Ends configuration and puts the device into fast data mode function. | |
void | bluetooth_get_help (bluetooth_t *ctx) |
Get displays a list of help command function. | |
void | bluetooth_get_basic_settings (bluetooth_t *ctx) |
Get displays basic settings function. | |
void | bluetooth_get_extended_settings (bluetooth_t *ctx) |
Get displays the device�s extended settings function. | |
void | bluetooth_get_device_address (bluetooth_t *ctx) |
Get displays the device�s eBluetooth address function. | |
void | bluetooth_scans_device (bluetooth_t *ctx) |
Scans for Bluetooth devices in pairing mode function. | |
void | bluetooth_get_signal_status (bluetooth_t *ctx) |
Displays the remote side modem signal status function. | |
void | bluetooth_set_undiscoverable (bluetooth_t *ctx) |
Set undiscoverable mode function. | |
BLUETOOTH_RETVAL | bluetooth_set_quiet_mode (bluetooth_t *ctx, uint8_t q_mode) |
Set quiet mode function. | |
void | bluetooth_get_firmware_version (bluetooth_t *ctx) |
Get firmware version function. | |
void bluetooth_cfg_setup | ( | bluetooth_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void bluetooth_connect_to_remote_address | ( | bluetooth_t * | ctx, |
uint8_t * | r_addr ) |
Connect the device to a remote address function.
ctx | Click object. |
r_addr | Pointer to the memory location where the remote address string be stored |
@description The function connect the device to a remote address to the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_connect_to_remote_address_fast_mode | ( | bluetooth_t * | ctx, |
uint8_t * | r_addr ) |
Connect the device to a remote address fast mode function.
ctx | Click object. |
r_addr | Pointer to the memory location where the remote address string be stored |
@description The function connect the device to a remote address fast mode to the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_disable_7_bit_data_mode | ( | bluetooth_t * | ctx | ) |
Disable 7-Bit data mode function.
ctx | Click object. |
@description The function disable 7-Bit data mode of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_disable_bonding | ( | bluetooth_t * | ctx | ) |
Set bonding disable function.
ctx | Click object. |
@description The function set bonding disable of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_disable_role_switch | ( | bluetooth_t * | ctx | ) |
Disables the role switch function.
ctx | Click object. |
@description The function disables the role switch of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_enable | ( | bluetooth_t * | ctx | ) |
Enable device function.
ctx | Click object. |
@description The function enable RN-41 Bluetooth module on Bluetooth Click board by set to '1' state of RST pin.
void bluetooth_enable_7_bit_data_mode | ( | bluetooth_t * | ctx | ) |
Enable 7-Bit data mode function.
ctx | Click object. |
@description The function enable 7-Bit data mode of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_enable_bonding | ( | bluetooth_t * | ctx | ) |
Set bonding enable function.
ctx | Click object. |
@description The function set bonding enable of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_enable_role_switch | ( | bluetooth_t * | ctx | ) |
Enables the role switch function.
ctx | Click object. |
@description The function enables the role switch of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_endspecial_config | ( | bluetooth_t * | ctx | ) |
Ends configuration and puts the device into fast data mode function.
ctx | Click object. |
@description The function ends configuration and puts the device into fast data mode to the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_enter_command_mode | ( | bluetooth_t * | ctx | ) |
Enter the command mode function.
ctx | Click object. |
@description The function enter the command mode of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_exit_command_mode | ( | bluetooth_t * | ctx | ) |
Exit the command mode function.
ctx | Click object. |
@description The function exit the command mode of the RN-41 Bluetooth module on Bluetooth Click board.
int32_t bluetooth_generic_read | ( | bluetooth_t * | ctx, |
char * | data_buf, | ||
uint16_t | max_len ) |
Generic read function.
bluetooth | Click object. |
data_buf | Data buffer for read data. |
max_len | The maximum length of data that can be read. |
void bluetooth_generic_write | ( | bluetooth_t * | ctx, |
char * | data_buf, | ||
uint16_t | len ) |
Generic write function.
bluetooth | Click object. |
data_buf | Data buffer for sends. |
len | Number of bytes for sends. |
void bluetooth_get_basic_settings | ( | bluetooth_t * | ctx | ) |
Get displays basic settings function.
ctx | Click object. |
@description The function get displays basic settings of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_get_device_address | ( | bluetooth_t * | ctx | ) |
Get displays the device�s eBluetooth address function.
ctx | Click object. |
@description The function get displays the Bluetooth address of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_get_extended_settings | ( | bluetooth_t * | ctx | ) |
Get displays the device�s extended settings function.
ctx | Click object. |
@description The function get displays the device�s extended settings of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_get_firmware_version | ( | bluetooth_t * | ctx | ) |
Get firmware version function.
ctx | Click object. |
@description The function get firmware version of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_get_help | ( | bluetooth_t * | ctx | ) |
Get displays a list of help command function.
ctx | Click object. |
@description The function get displays a list of help command of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_get_signal_status | ( | bluetooth_t * | ctx | ) |
Displays the remote side modem signal status function.
ctx | Click object. |
@description The function displays the remote side modem signal status of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_hw_reset | ( | bluetooth_t * | ctx | ) |
Hardwere reset function.
ctx | Click object. |
@description The function hardwere reset RN-41 Bluetooth module on Bluetooth Click board by cleared to '0' state of RST pin, weit 200 ms, set to '1' state of RST pin and weit 1 sec.
BLUETOOTH_RETVAL bluetooth_init | ( | bluetooth_t * | ctx, |
bluetooth_cfg_t * | cfg ) |
Initialization function.
bluetooth | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void bluetooth_reboot | ( | bluetooth_t * | ctx | ) |
Reboot the module function.
ctx | Click object. |
@description The function set bonding disable of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_scans_device | ( | bluetooth_t * | ctx | ) |
Scans for Bluetooth devices in pairing mode function.
ctx | Click object. |
@description The function scans for Bluetooth devices in pairing mode of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_set_authentication | ( | bluetooth_t * | ctx, |
uint8_t | auth_value ) |
Set the authentication function.
ctx | Click object. |
auth_value | - 0 : [ Open mode ] The module uses Bluetooth version 2.0 with NO encryption; - 1 : [ SSP keyboard I/O mode ] Default; The remote host receives a prompt, reply yes to pair; - 2 : [ SSP �just works� mode ] The mode works with iOS device and newer PCs; - 4 : [ Pin code mode ] Pin code mode authentication, which requires the host device to enter a pin code that matches the stored pin code; |
@description The function set the authentication value to the RN-41 Bluetooth module on Bluetooth Click board.
BLUETOOTH_RETVAL bluetooth_set_baud_rate | ( | bluetooth_t * | ctx, |
uint32_t | baud_rate ) |
Set the baud rate function.
ctx | Click object. |
baud_rate | Baud rate : - 1200 : 1200 bps; - 2400 : 2400 bps; - 9600 : 9600 bps; - 19200 : 19200 bps; - 38400 : 38400 bps; - 57600 : 57600 bps; - 115200 : 115200 bps [ Default ]; |
status | 0 - ERROR; 1 - OK; |
@description The function set the baud rate value to the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_set_break | ( | bluetooth_t * | ctx, |
uint8_t | break_signal ) |
Set the break function.
ctx | Click object. |
break_signal | Break Length : - 1 : 37 ms; - 2 : 18.5 ms; - 3 : 12 ms; - 4 : 9 ms; - 5 : 7 ms; - 6 : 6 ms; |
@description The function set the break signal length to the RN-41 Bluetooth module on Bluetooth Click board.
BLUETOOTH_RETVAL bluetooth_set_cod | ( | bluetooth_t * | ctx, |
uint8_t * | msw, | ||
uint8_t * | lsw ) |
Sets the class of device (COD) function.
ctx | Click object. |
msw | Pointer to the memory location where the msw hex value be stored |
lsw | Pointer to the memory location where the lsw hex value be stored |
status | 0 - ERROR; 1 - OK; |
@description The function set the bthe class of device (COD) to the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_set_device_name | ( | bluetooth_t * | ctx, |
uint8_t * | name ) |
Set the device name function.
ctx | Click object. |
name | Pointer to the memory location where the name be stored |
@description The function set the device name of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_set_discoverability | ( | bluetooth_t * | ctx, |
uint8_t * | d_hex_value ) |
Set enable an inquiry scan function.
ctx | Click object. |
d_hex_value | Pointer to the memory loc. where the discoverability hex value be stored |
@description The function set enable an inquiry scan to the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_set_extended_status_string | ( | bluetooth_t * | ctx, |
uint8_t * | es_string ) |
Set extended status string function.
ctx | Click object. |
es_string | Pointer to the memory location where the extended status string be stored |
@description The function set extended status string to the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_set_factory_defaults | ( | bluetooth_t * | ctx | ) |
Set factory defaults settings function.
ctx | Click object. |
@description The function set factory defaults settings to the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_set_operating_mode | ( | bluetooth_t * | ctx, |
uint8_t | op_mode ) |
Set the operating mode function.
ctx | Click object. |
op_mode | - 0 : [ Slave Mode ] Default mode, in which other Bluetooth devices can discover and connect to the module; - 1 : [ Master Mode ] In this low-speed connection mode, the module makes connections when a connect command (C) is received; - 2 : [ Trigger Mode ] In this low-speed connection mode, the module makes connections automatically when a character is received on the serial port (UART); - 3 : [ Auto-Connect Master Mode ] In this mode, the module makes connections automatically on power-up and re-connects when the connection is lost; - 4 : [ Auto-Connect DTR Mode ] Its operates like Auto-Connect Master Mode except that you control connection and disconnect evaluation kits; - 5 : [ Auto-Connect ANY Mode ] This mode operates like Auto-Connect DTR Mode; - 6 : [ Pairing Mode ] In this mode, the module attempts to connect with the remote device matching the store remote address; |
@description The function sets the operating mode of the RN-41 Bluetooth module on Bluetooth Click board.
BLUETOOTH_RETVAL bluetooth_set_profile | ( | bluetooth_t * | ctx, |
uint8_t | profile ) |
Set the profile function.
ctx | Click object. |
profile | Profile : - 0 : [ SPP ], Default, no modem control; - 1 : [ DUN-DCE ], Slave or gateway; - 2 : [ DUN-DTE ], Master or client; - 3 : [ MDM SPP ], With modem control signals; - 4 : [ SPP and DUN-DCE ], Multi-profile; - 5 : [ APL ], Apple (iAP) profile, Refer to the iAP Bluetooth Evaluation Kit for Developing Accessories Compatible with iOS Devices User Manual for more information on using this profile; - 6 : [ HID ], Device must be running a special firmware version |
status | 0 - ERROR; 1 - OK; |
@description The function set the profile of the RN-41 Bluetooth module on Bluetooth Click board.
BLUETOOTH_RETVAL bluetooth_set_quiet_mode | ( | bluetooth_t * | ctx, |
uint8_t | q_mode ) |
Set quiet mode function.
ctx | Click object. |
q_mode | - 0 : The module is discoverable and able to connect.; - 1 : The module is not discoverable and not able to connect; - 2 : The module is able to connect but is not discoverable; - 3 : Displays the current quiet mode is defined above; |
status | 0 - ERROR; 1 - OK; |
@description The function set quiet mode of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_set_remote_address | ( | bluetooth_t * | ctx, |
uint8_t * | r_addr ) |
Set the remote Bluetooth address function.
ctx | Click object. |
r_addr | Pointer to the memory location where the remote address string be stored |
@description The function stores the remote Bluetooth address to the RN-41 Bluetooth module on Bluetooth Click board.
BLUETOOTH_RETVAL bluetooth_set_security_pin_code | ( | bluetooth_t * | ctx, |
uint8_t * | sp_code ) |
Set security pin code function.
ctx | Click object. |
sp_code | Pointer to the memory location where the security pin code string be stored |
status | 0 - ERROR; 1 - OK; |
@description The function set security pin code string to the RN-41 Bluetooth module on Bluetooth Click board.
BLUETOOTH_RETVAL bluetooth_set_special_config | ( | bluetooth_t * | ctx, |
uint16_t | special_config ) |
Set special configuration settings function.
ctx | Click object. |
special_config | - 0 : Default. The device does not use any special configuration; - 4 : With this option set, the device does not read the GPIO3 and GPIO6 pin values on power-up; - 8 : Disables discoverability at power up; - 16 : This option configures the firmware to optimize for low latency data transfers rather than throughput; - 128 : This option causes the device to reboot after disconnect; - 256 : This option sets 2 stop bit mode on the UART; |
status | 0 - ERROR; 1 - OK; |
@description The function set special configuration settings to the RN-41 Bluetooth module on Bluetooth Click board.
BLUETOOTH_RETVAL bluetooth_set_uart_parity | ( | bluetooth_t * | ctx, |
uint8_t | character ) |
Set UART parity function.
ctx | Click object. |
character | UART parity values: - 'E' : Even; - 'O' : Odd; - 'N' : None; |
status | 0 - ERROR; 1 - OK; |
@description The function set UART parity to the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_set_undiscoverable | ( | bluetooth_t * | ctx | ) |
Set undiscoverable mode function.
ctx | Click object. |
@description The function set undiscoverable mode of the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_setConnectability | ( | bluetooth_t * | ctx, |
uint8_t * | c_hex_value ) |
Set enable page scanning function.
ctx | Click object. |
c_hex_value | Pointer to the memory location where the connectability hex value be stored |
@description The function set enable page scanning to the RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_toggle_echo | ( | bluetooth_t * | ctx | ) |
Toggles echo function.
ctx | Click object. |
@description The function toggles the local echo ON and OFF of RN-41 Bluetooth module on Bluetooth Click board.
void bluetooth_write_command | ( | bluetooth_t * | ctx, |
char * | data_buf, | ||
uint16_t | len ) |
Write command function.
bluetooth | Click object. |
data_buf | Data buffer for sends. |
len | Number of bytes for sends. |