rn4678 2.0.0.0
Public function

Functions

void rn4678_cfg_setup (rn4678_cfg_t *cfg)
 Config Object Initialization function.
 
RN4678_RETVAL rn4678_init (rn4678_t *ctx, rn4678_cfg_t *cfg)
 Initialization function.
 
void rn4678_generic_write (rn4678_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t rn4678_generic_read (rn4678_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
void rn4678_write_command (rn4678_t *ctx, char *data_buf, uint16_t len)
 Write command function.
 
void rn4678_set_cts_pin (rn4678_t *ctx, uint8_t state)
 CTS Pin Setting function.
 
void rn4678_enable (rn4678_t *ctx)
 Enable device function.
 
void rn4678_hw_reset (rn4678_t *ctx)
 Hardwere reset function.
 
void rn4678_enter_command_mode (rn4678_t *ctx)
 Enter the command mode function.
 
void rn4678_exit_command_mode (rn4678_t *ctx)
 Exit the command mode function.
 
void rn4678_toggle_echo (rn4678_t *ctx)
 Toggles echo function.
 
void rn4678_set_device_name (rn4678_t *ctx, uint8_t *name)
 Set the device name function.
 
void rn4678_set_operating_mode (rn4678_t *ctx, uint8_t op_mode)
 Set the operating mode function.
 
void rn4678_enable_7_bit_data_mode (rn4678_t *ctx)
 Enable 7-Bit data mode function.
 
void rn4678_disable_7_bit_data_mode (rn4678_t *ctx)
 Disable 7-Bit data mode function.
 
void rn4678_set_authentication (rn4678_t *ctx, uint8_t auth_value)
 Set the authentication function.
 
void rn4678_set_break (rn4678_t *ctx, uint8_t break_signal)
 Set the break function.
 
RN4678_RETVAL rn4678_set_cod (rn4678_t *ctx, uint8_t *msw, uint8_t *lsw)
 Sets the class of device (COD) function.
 
void rn4678_set_factory_defaults (rn4678_t *ctx)
 Set factory defaults settings function.
 
void rn4678_set_discoverability (rn4678_t *ctx, uint8_t *d_hex_value)
 Set enable an inquiry scan function.
 
void rn4678_setConnectability (rn4678_t *ctx, uint8_t *c_hex_value)
 Set enable page scanning function.
 
RN4678_RETVAL rn4678_set_uart_parity (rn4678_t *ctx, uint8_t character)
 Set UART parity function.
 
void rn4678_set_extended_status_string (rn4678_t *ctx, uint8_t *es_string)
 Set extended status string function.
 
RN4678_RETVAL rn4678_set_security_pin_code (rn4678_t *ctx, uint8_t *sp_code)
 Set security pin code function.
 
RN4678_RETVAL rn4678_set_special_config (rn4678_t *ctx, uint16_t special_config)
 Set special configuration settings function.
 
void rn4678_set_remote_address (rn4678_t *ctx, uint8_t *r_addr)
 Set the remote Bluetooth address function.
 
RN4678_RETVAL rn4678_set_baud_rate (rn4678_t *ctx, uint32_t baud_rate)
 Set the baud rate function.
 
void rn4678_enable_bonding (rn4678_t *ctx)
 Set bonding enable function.
 
void rn4678_disable_bonding (rn4678_t *ctx)
 Set bonding disable function.
 
void rn4678_reboot (rn4678_t *ctx)
 Reboot the module function.
 
RN4678_RETVAL rn4678_set_profile (rn4678_t *ctx, uint8_t profile)
 Set the profile function.
 
void rn4678_enable_role_switch (rn4678_t *ctx)
 Enables the role switch function.
 
void rn4678_disable_role_switch (rn4678_t *ctx)
 Disables the role switch function.
 
void rn4678_connect_to_remote_address (rn4678_t *ctx, uint8_t *r_addr)
 Connect the device to a remote address function.
 
void rn4678_connect_to_remote_address_fast_mode (rn4678_t *ctx, uint8_t *r_addr)
 Connect the device to a remote address fast mode function.
 
void rn4678_endspecial_config (rn4678_t *ctx)
 Ends configuration and puts the device into fast data mode function.
 
void rn4678_get_help (rn4678_t *ctx)
 Get displays a list of help command function.
 
void rn4678_get_basic_settings (rn4678_t *ctx)
 Get displays basic settings function.
 
void rn4678_get_extended_settings (rn4678_t *ctx)
 Get displays the device�s extended settings function.
 
void rn4678_get_device_address (rn4678_t *ctx)
 Get displays the device�s eBluetooth address function.
 
void rn4678_scans_device (rn4678_t *ctx)
 Scans for Bluetooth devices in pairing mode function.
 
void rn4678_get_signal_status (rn4678_t *ctx)
 Displays the remote side modem signal status function.
 
void rn4678_set_undiscoverable (rn4678_t *ctx)
 Set undiscoverable mode function.
 
RN4678_RETVAL rn4678_set_quiet_mode (rn4678_t *ctx, uint8_t q_mode)
 Set quiet mode function.
 
void rn4678_get_firmware_version (rn4678_t *ctx)
 Get firmware version function.
 

Detailed Description

Function Documentation

◆ rn4678_cfg_setup()

void rn4678_cfg_setup ( rn4678_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ rn4678_connect_to_remote_address()

void rn4678_connect_to_remote_address ( rn4678_t * ctx,
uint8_t * r_addr )

Connect the device to a remote address function.

Parameters
ctxClick object.
r_addrPointer to the memory location where the remote address string be stored

@description The function connect the device to a remote address to the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_connect_to_remote_address_fast_mode()

void rn4678_connect_to_remote_address_fast_mode ( rn4678_t * ctx,
uint8_t * r_addr )

Connect the device to a remote address fast mode function.

Parameters
ctxClick object.
r_addrPointer 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-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_disable_7_bit_data_mode()

void rn4678_disable_7_bit_data_mode ( rn4678_t * ctx)

Disable 7-Bit data mode function.

Parameters
ctxClick object.

@description The function disable 7-Bit data mode of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_disable_bonding()

void rn4678_disable_bonding ( rn4678_t * ctx)

Set bonding disable function.

Parameters
ctxClick object.

@description The function set bonding disable of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_disable_role_switch()

void rn4678_disable_role_switch ( rn4678_t * ctx)

Disables the role switch function.

Parameters
ctxClick object.

@description The function disables the role switch of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_enable()

void rn4678_enable ( rn4678_t * ctx)

Enable device function.

Parameters
ctxClick object.

@description The function enable RN-4678 Bluetooth module on RN4678 Click board by set to '1' state of RST pin.

◆ rn4678_enable_7_bit_data_mode()

void rn4678_enable_7_bit_data_mode ( rn4678_t * ctx)

Enable 7-Bit data mode function.

Parameters
ctxClick object.

@description The function enable 7-Bit data mode of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_enable_bonding()

void rn4678_enable_bonding ( rn4678_t * ctx)

Set bonding enable function.

Parameters
ctxClick object.

@description The function set bonding enable of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_enable_role_switch()

void rn4678_enable_role_switch ( rn4678_t * ctx)

Enables the role switch function.

Parameters
ctxClick object.

@description The function enables the role switch of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_endspecial_config()

void rn4678_endspecial_config ( rn4678_t * ctx)

Ends configuration and puts the device into fast data mode function.

Parameters
ctxClick object.

@description The function ends configuration and puts the device into fast data mode to the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_enter_command_mode()

void rn4678_enter_command_mode ( rn4678_t * ctx)

Enter the command mode function.

Parameters
ctxClick object.

@description The function enter the command mode of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_exit_command_mode()

void rn4678_exit_command_mode ( rn4678_t * ctx)

Exit the command mode function.

Parameters
ctxClick object.

@description The function exit the command mode of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_generic_read()

int32_t rn4678_generic_read ( rn4678_t * ctx,
char * data_buf,
uint16_t max_len )

Generic read function.

Parameters
rn4678Click object.
data_bufData buffer for read data.
max_lenThe maximum length of data that can be read.
Returns
Number of reads data.

◆ rn4678_generic_write()

void rn4678_generic_write ( rn4678_t * ctx,
char * data_buf,
uint16_t len )

Generic write function.

Parameters
rn4678Click object.
data_bufData buffer for sends.
lenNumber of bytes for sends.

◆ rn4678_get_basic_settings()

void rn4678_get_basic_settings ( rn4678_t * ctx)

Get displays basic settings function.

Parameters
ctxClick object.

@description The function get displays basic settings of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_get_device_address()

void rn4678_get_device_address ( rn4678_t * ctx)

Get displays the device�s eBluetooth address function.

Parameters
ctxClick object.

@description The function get displays the Bluetooth address of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_get_extended_settings()

void rn4678_get_extended_settings ( rn4678_t * ctx)

Get displays the device�s extended settings function.

Parameters
ctxClick object.

@description The function get displays the device�s extended settings of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_get_firmware_version()

void rn4678_get_firmware_version ( rn4678_t * ctx)

Get firmware version function.

Parameters
ctxClick object.

@description The function get firmware version of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_get_help()

void rn4678_get_help ( rn4678_t * ctx)

Get displays a list of help command function.

Parameters
ctxClick object.

@description The function get displays a list of help command of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_get_signal_status()

void rn4678_get_signal_status ( rn4678_t * ctx)

Displays the remote side modem signal status function.

Parameters
ctxClick object.

@description The function displays the remote side modem signal status of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_hw_reset()

void rn4678_hw_reset ( rn4678_t * ctx)

Hardwere reset function.

Parameters
ctxClick object.

@description The function hardwere reset RN-4678 Bluetooth module on RN4678 Click board by cleared to '0' state of RST pin, weit 200 ms, set to '1' state of RST pin and weit 1 sec.

◆ rn4678_init()

RN4678_RETVAL rn4678_init ( rn4678_t * ctx,
rn4678_cfg_t * cfg )

Initialization function.

Parameters
rn4678Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ rn4678_reboot()

void rn4678_reboot ( rn4678_t * ctx)

Reboot the module function.

Parameters
ctxClick object.

@description The function set bonding disable of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_scans_device()

void rn4678_scans_device ( rn4678_t * ctx)

Scans for Bluetooth devices in pairing mode function.

Parameters
ctxClick object.

@description The function scans for Bluetooth devices in pairing mode of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_authentication()

void rn4678_set_authentication ( rn4678_t * ctx,
uint8_t auth_value )

Set the authentication function.

Parameters
ctxClick 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-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_baud_rate()

RN4678_RETVAL rn4678_set_baud_rate ( rn4678_t * ctx,
uint32_t baud_rate )

Set the baud rate function.

Parameters
ctxClick 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 ];
Return values
status0 - ERROR; 1 - OK;

@description The function set the baud rate value to the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_break()

void rn4678_set_break ( rn4678_t * ctx,
uint8_t break_signal )

Set the break function.

Parameters
ctxClick 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-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_cod()

RN4678_RETVAL rn4678_set_cod ( rn4678_t * ctx,
uint8_t * msw,
uint8_t * lsw )

Sets the class of device (COD) function.

Parameters
ctxClick object.
mswPointer to the memory location where the msw hex value be stored
lswPointer to the memory location where the lsw hex value be stored
Return values
status0 - ERROR; 1 - OK;

@description The function set the bthe class of device (COD) to the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_cts_pin()

void rn4678_set_cts_pin ( rn4678_t * ctx,
uint8_t state )

CTS Pin Setting function.

Parameters
ctxClick object.
state0 - Low, 1 (or other value different from 0) - High

@description This function sets the CTS pin to the desired state
( UART clear to send control signal ).

Note
Used only when hardware flow control is enabled. The HW flow control is enabled by default.

◆ rn4678_set_device_name()

void rn4678_set_device_name ( rn4678_t * ctx,
uint8_t * name )

Set the device name function.

Parameters
ctxClick object.
namePointer to the memory location where the name be stored

@description The function set the device name of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_discoverability()

void rn4678_set_discoverability ( rn4678_t * ctx,
uint8_t * d_hex_value )

Set enable an inquiry scan function.

Parameters
ctxClick object.
d_hex_valuePointer to the memory loc. where the discoverability hex value be stored

@description The function set enable an inquiry scan to the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_extended_status_string()

void rn4678_set_extended_status_string ( rn4678_t * ctx,
uint8_t * es_string )

Set extended status string function.

Parameters
ctxClick object.
es_stringPointer to the memory location where the extended status string be stored

@description The function set extended status string to the RN-4678 Bluetooth module on RN4678 Click board.

Note
es_string up to 8 alphanumeric characters

◆ rn4678_set_factory_defaults()

void rn4678_set_factory_defaults ( rn4678_t * ctx)

Set factory defaults settings function.

Parameters
ctxClick object.

@description The function set factory defaults settings to the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_operating_mode()

void rn4678_set_operating_mode ( rn4678_t * ctx,
uint8_t op_mode )

Set the operating mode function.

Parameters
ctxClick 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-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_profile()

RN4678_RETVAL rn4678_set_profile ( rn4678_t * ctx,
uint8_t profile )

Set the profile function.

Parameters
ctxClick 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
Return values
status0 - ERROR; 1 - OK;

@description The function set the profile of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_quiet_mode()

RN4678_RETVAL rn4678_set_quiet_mode ( rn4678_t * ctx,
uint8_t q_mode )

Set quiet mode function.

Parameters
ctxClick 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;
Return values
status0 - ERROR; 1 - OK;

@description The function set quiet mode of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_remote_address()

void rn4678_set_remote_address ( rn4678_t * ctx,
uint8_t * r_addr )

Set the remote Bluetooth address function.

Parameters
ctxClick object.
r_addrPointer to the memory location where the remote address string be stored

@description The function stores the remote Bluetooth address to the RN-4678 Bluetooth module on RN4678 Click board.

Note
r_addr is string of the 12 hexadecimal digits

◆ rn4678_set_security_pin_code()

RN4678_RETVAL rn4678_set_security_pin_code ( rn4678_t * ctx,
uint8_t * sp_code )

Set security pin code function.

Parameters
ctxClick object.
sp_codePointer to the memory location where the security pin code string be stored
Return values
status0 - ERROR; 1 - OK;

@description The function set security pin code string to the RN-4678 Bluetooth module on RN4678 Click board.

Note
sp_code up to 20 alphanumeric characters

◆ rn4678_set_special_config()

RN4678_RETVAL rn4678_set_special_config ( rn4678_t * ctx,
uint16_t special_config )

Set special configuration settings function.

Parameters
ctxClick 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;
Return values
status0 - ERROR; 1 - OK;

@description The function set special configuration settings to the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_uart_parity()

RN4678_RETVAL rn4678_set_uart_parity ( rn4678_t * ctx,
uint8_t character )

Set UART parity function.

Parameters
ctxClick object.
character
UART parity values:
- 'E' : Even;
- 'O' : Odd;
- 'N' : None;
Return values
status0 - ERROR; 1 - OK;

@description The function set UART parity to the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_set_undiscoverable()

void rn4678_set_undiscoverable ( rn4678_t * ctx)

Set undiscoverable mode function.

Parameters
ctxClick object.

@description The function set undiscoverable mode of the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_setConnectability()

void rn4678_setConnectability ( rn4678_t * ctx,
uint8_t * c_hex_value )

Set enable page scanning function.

Parameters
ctxClick object.
c_hex_valuePointer to the memory location where the connectability hex value be stored

@description The function set enable page scanning to the RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_toggle_echo()

void rn4678_toggle_echo ( rn4678_t * ctx)

Toggles echo function.

Parameters
ctxClick object.

@description The function toggles the local echo ON and OFF of RN-4678 Bluetooth module on RN4678 Click board.

◆ rn4678_write_command()

void rn4678_write_command ( rn4678_t * ctx,
char * data_buf,
uint16_t len )

Write command function.

Parameters
rn4678Click object.
data_bufData buffer for sends.
lenNumber of bytes for sends.