ble8 2.0.0.0
Public function

Functions

void ble8_cfg_setup (ble8_cfg_t *cfg)
 Config Object Initialization function.
 
BLE8_RETVAL ble8_init (ble8_t *ctx, ble8_cfg_t *cfg)
 Initialization function.
 
void ble8_reset (ble8_t *ctx)
 Reset function.
 
void ble8_generic_write (ble8_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t ble8_generic_read (ble8_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
uint8_t ble8_response_ready (ble8_t *ctx)
 Response Ready function.
 
void ble8_send_command (ble8_t *ctx, char *command, uint8_t term_char)
 Transmit function.
 
void ble8_fact_rst_cmd (ble8_t *ctx)
 Factory Reset command.
 
void ble8_store_cnfg_cmd (ble8_t *ctx)
 Store Current Configuration command.
 
void ble8_get_local_addr_cmd (ble8_t *ctx)
 Get Local Address command.
 
void ble8_set_start_mode_cmd (ble8_t *ctx, uint8_t start_mode)
 Module Start Mode Setting command.
 
void ble8_get_start_mode_cmd (ble8_t *ctx)
 Get Module Start Mode command.
 
void ble8_enter_mode_cmd (ble8_t *ctx, uint8_t mode)
 Enter Data Mode command.
 
void ble8_set_echo_cmd (ble8_t *ctx, uint8_t echo_en)
 Echo On/Off command.
 
void ble8_get_echo_cmd (ble8_t *ctx)
 Get Echo Setting command.
 
void ble8_set_local_name_cmd (ble8_t *ctx, char *local_name)
 Local Name Setting command.
 
void ble8_get_local_name_cmd (ble8_t *ctx)
 Get Local Name command.
 
void ble8_set_low_energy_role_cmd (ble8_t *ctx, uint8_t le_role)
 Bluetooth Low Energy Role Setting command.
 
void ble8_get_low_energy_role_cmd (ble8_t *ctx)
 Get Bluetooth Low Energy Role command.
 
void ble8_get_list_peers_cmd (ble8_t *ctx)
 Get Peer List command.
 
void ble8_get_server_cnfg_cmd (ble8_t *ctx)
 Get Server Configuration command.
 
void ble8_set_default_cmd (ble8_t *ctx)
 Default Configuration command.
 
void ble8_set_sec_mode_cmd (ble8_t *ctx, uint8_t sec_mode)
 Security Mode Setting command.
 
void ble8_get_sec_mode_cmd (ble8_t *ctx)
 Get Security Mode command.
 
void ble8_pairing_en_cmd (ble8_t *ctx, uint8_t pairing_mode)
 Pairing Mode Setting command.
 
void ble8_check_pairing_cmd (ble8_t *ctx)
 Get Pairing Mode command.
 
void ble8_connectability_en_cmd (ble8_t *ctx, uint8_t conn_mode)
 Connectability Mode Setting command.
 
void ble8_check_connectability_cmd (ble8_t *ctx)
 Get Connectability Mode command.
 
void ble8_discoverability_en_cmd (ble8_t *ctx, uint8_t discover_mode)
 Discoverability Mode Setting command.
 
void ble8_check_discoverability_cmd (ble8_t *ctx)
 Get Discoverability Mode command.
 
void ble8_get_info (ble8_t *ctx)
 Get Info command.
 
uint8_t ble8_sps_central_pairing (ble8_t *ctx, uint8_t *local_addr)
 SPS Pairing As Central Device command.
 
void ble8_sps_peripheral_pairing (ble8_t *ctx)
 SPS Pairing As Peripheral Device command.
 
void ble8_set_cts_pin (ble8_t *ctx, uint8_t state)
 CTS Pin Setting function.
 
void ble8_set_dsr_pin (ble8_t *ctx, uint8_t state)
 Set DSR Pin function.
 
uint8_t ble8_get_dtr_pin (ble8_t *ctx)
 Check DTR Pin function.
 
uint8_t ble8_get_rts_pin (ble8_t *ctx)
 Check RTS Pin function.
 

Detailed Description

Function Documentation

◆ ble8_cfg_setup()

void ble8_cfg_setup ( ble8_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.

◆ ble8_check_connectability_cmd()

void ble8_check_connectability_cmd ( ble8_t * ctx)

Get Connectability Mode command.

Parameters
ctxClick object.

@description This command reads the GAP connectability mode.

◆ ble8_check_discoverability_cmd()

void ble8_check_discoverability_cmd ( ble8_t * ctx)

Get Discoverability Mode command.

Parameters
ctxClick object.

@description This command reads the GAP discoverability mode.

◆ ble8_check_pairing_cmd()

void ble8_check_pairing_cmd ( ble8_t * ctx)

Get Pairing Mode command.

Parameters
ctxClick object.

@description This command reads the pairing mode.

◆ ble8_connectability_en_cmd()

void ble8_connectability_en_cmd ( ble8_t * ctx,
uint8_t conn_mode )

Connectability Mode Setting command.

Parameters
ctxClick object.
conn_mode1 - GAP non-connectable mode; 2 - GAP connectable mode ( default )

@description This command sets the GAP connectability mode.

◆ ble8_discoverability_en_cmd()

void ble8_discoverability_en_cmd ( ble8_t * ctx,
uint8_t discover_mode )

Discoverability Mode Setting command.

Parameters
ctxClick object.
discover_mode
 
       1 - GAP non-discoverable mode
       2 - GAP limited discoverable mode
       3 - GAP general discoverable mode ( default )

@description This command sets the GAP discoverability mode.

Note
For ANNA-B1, the device will stay in the limited discoverable mode for 180 seconds.

◆ ble8_enter_mode_cmd()

void ble8_enter_mode_cmd ( ble8_t * ctx,
uint8_t mode )

Enter Data Mode command.

Parameters
ctxClick object.
mode0 - Command mode ( default ) 1 - Data mode 2 - Extended data mode 3 - PPP mode

@description This command requests the module to move to the new mode.

Note
After executing the data mode command or the extended data mode command, a delay of 50 ms is required before start of data transmission.

◆ ble8_fact_rst_cmd()

void ble8_fact_rst_cmd ( ble8_t * ctx)

Factory Reset command.

Parameters
ctxClick object.

@description This command reset a module to factory defined defaults.

Note
A reboot will be executed to update the new settings.

◆ ble8_generic_read()

int32_t ble8_generic_read ( ble8_t * ctx,
char * data_buf,
uint16_t max_len )

Generic read function.

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

◆ ble8_generic_write()

void ble8_generic_write ( ble8_t * ctx,
char * data_buf,
uint16_t len )

Generic write function.

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

◆ ble8_get_dtr_pin()

uint8_t ble8_get_dtr_pin ( ble8_t * ctx)

Check DTR Pin function.

Parameters
ctxClick object.
Returns
0 or 1

@description This function returns the state of the DTR pin ( UART data terminal ready signal).

Note
Used to indicate system status by default.

◆ ble8_get_echo_cmd()

void ble8_get_echo_cmd ( ble8_t * ctx)

Get Echo Setting command.

Parameters
ctxClick object.

@description This command reads current echo setting.

◆ ble8_get_info()

void ble8_get_info ( ble8_t * ctx)

Get Info command.

Parameters
ctxClick object.

@description This command reads the all device and serial interface informations.

◆ ble8_get_list_peers_cmd()

void ble8_get_list_peers_cmd ( ble8_t * ctx)

Get Peer List command.

Parameters
ctxClick object.

@description This command reads the connected peers (peer handle).

Note
The module will return a peer handle that identifies the connection, protocol of the connection, local address and remote address if available.

◆ ble8_get_local_addr_cmd()

void ble8_get_local_addr_cmd ( ble8_t * ctx)

Get Local Address command.

@description This command reads the local address of the bluetooth module.

◆ ble8_get_local_name_cmd()

void ble8_get_local_name_cmd ( ble8_t * ctx)

Get Local Name command.

Parameters
ctxClick object.

@description This command reads the local Bluetooth device name.

◆ ble8_get_low_energy_role_cmd()

void ble8_get_low_energy_role_cmd ( ble8_t * ctx)

Get Bluetooth Low Energy Role command.

Parameters
ctxClick object.

@description This command reads the Bluetooth low energy role.

◆ ble8_get_rts_pin()

uint8_t ble8_get_rts_pin ( ble8_t * ctx)

Check RTS Pin function.

Returns
0 or 1

@description This function returns the state of the RTS pin ( UART ready to send control signal ).

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

◆ ble8_get_sec_mode_cmd()

void ble8_get_sec_mode_cmd ( ble8_t * ctx)

Get Security Mode command.

Parameters
ctxClick object.

@description This command reads the security mode.

◆ ble8_get_server_cnfg_cmd()

void ble8_get_server_cnfg_cmd ( ble8_t * ctx)

Get Server Configuration command.

Parameters
ctxClick object.

@description This command reads server configuration.

Note
The module will return a type of server:
      0 - Disabled, 1 - TCP, 2 - UDP, 3 - SPP, 4 - DUN, 5 - UUID, 
      6 - SPS (supported by ANNA-B1), 7 - Reserved, 8 - ATP.

◆ ble8_get_start_mode_cmd()

void ble8_get_start_mode_cmd ( ble8_t * ctx)

Get Module Start Mode command.

Parameters
ctxClick object.

@description This command reads the module start mode.

◆ ble8_init()

BLE8_RETVAL ble8_init ( ble8_t * ctx,
ble8_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ ble8_pairing_en_cmd()

void ble8_pairing_en_cmd ( ble8_t * ctx,
uint8_t pairing_mode )

Pairing Mode Setting command.

Parameters
ctxClick object.
pairing_mode1 - GAP non-pairing mode; 2 - GAP pairing mode ( default )

@description This command sets the pairing mode.

◆ ble8_reset()

void ble8_reset ( ble8_t * ctx)

Reset function.

Parameters
ctxClick object.

@description This function allows user to reset a module.

◆ ble8_response_ready()

uint8_t ble8_response_ready ( ble8_t * ctx)

Response Ready function.

Parameters
ctxClick object.
Returns
0 - response is not ready, 1 - response is ready

@description This function checks does response ready or not.

◆ ble8_send_command()

void ble8_send_command ( ble8_t * ctx,
char * command,
uint8_t term_char )

Transmit function.

Parameters
ctxClick object.
tx_dataData to be transmitted
term_charCommand termination character

@description This function allows user to transmit data and send commands to the module.

Note
This function will send a termination character ('\r' default) automatically at the end of the data transmitting.

◆ ble8_set_cts_pin()

void ble8_set_cts_pin ( ble8_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.

◆ ble8_set_default_cmd()

void ble8_set_default_cmd ( ble8_t * ctx)

Default Configuration command.

Parameters
ctxClick object.

@description This command resets the profile to the last stored configuration.

Note
Any settings committed with AT&W will be discarded. The restored settings will be used after a reboot, which this function also executes.

◆ ble8_set_dsr_pin()

void ble8_set_dsr_pin ( ble8_t * ctx,
uint8_t state )

Set DSR Pin function.

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

@description This function sets the DSR pin to the desired state ( UART data set ready signal ).

Note
Used to change system modes by default.

◆ ble8_set_echo_cmd()

void ble8_set_echo_cmd ( ble8_t * ctx,
uint8_t echo_en )

Echo On/Off command.

Parameters
ctxClick object.
echo_en0 - Unit does not echo the characters in Command Mode 1 - Unit echoes the characters in Command Mode ( default )

@description This command configures whether or not the unit echoes the characters received from the DTE in Command Mode.

◆ ble8_set_local_name_cmd()

void ble8_set_local_name_cmd ( ble8_t * ctx,
char * local_name )

Local Name Setting command.

Parameters
ctxClick object.
local_nameLocal name string to be set (maximum 29 characters)

@description This command sets the local Bluetooth device name.

Note
If user was enter a empty string, the local device name will be set to "Bluetooth Device". For ANNA-B1, the default name is "ANNA-B1-XXXXXX", where XXXXXX is the last 6 characters from the Bluetooth address.

◆ ble8_set_low_energy_role_cmd()

void ble8_set_low_energy_role_cmd ( ble8_t * ctx,
uint8_t le_role )

Bluetooth Low Energy Role Setting command.

Parameters
ctxClick object.
le_role
 
       0 - Disabled
       1 - Bluetooth low energy Central
       2 - Bluetooth low energy Peripheral ( default )
       3 - Bluetooth low energy Simultaneous Peripheral and Central

@description This command sets the Bluetooth low energy role.

Note
For the settings to take effect on ANNA-B1, use the commands &W and +CPWROFF to store the configuration to start up database and reboot the module.

◆ ble8_set_sec_mode_cmd()

void ble8_set_sec_mode_cmd ( ble8_t * ctx,
uint8_t sec_mode )

Security Mode Setting command.

Parameters
ctxClick object.
sec_mode
       1 - Security Disabled ( default )
       2 - Security Enabled - Just Works
       3 - Security Enabled - Display Only
       4 - Security Enabled - Display Yes/No
       5 - Security Enabled - Keyboard Only
       6 - Security Enabled - Out of band

@description This command sets the security mode.

Note
 For the settings to take effect on ANNA-B1, use the commands &W and +CPWROFF to 
      store the configuration to start up database and reboot the module.
      ANNA-B1 does not support Out of band and will fall back to Just Works pairing.

◆ ble8_set_start_mode_cmd()

void ble8_set_start_mode_cmd ( ble8_t * ctx,
uint8_t start_mode )

Module Start Mode Setting command.

Parameters
ctxClick object.
start_mode0 - Command mode ( default ) 1 - Data mode 2 - Extended data mode 3 - PPP mode

@description This command sets the module start mode.

◆ ble8_sps_central_pairing()

uint8_t ble8_sps_central_pairing ( ble8_t * ctx,
uint8_t * local_addr )

SPS Pairing As Central Device command.

Parameters
ctxClick object.
local_addrLocal address string of the target Bluetooth device ( peer ) [ 12 characters ]

@description This command executes a SPS pairing as central device, sets data start mode and reboot a module.

Note
This configuration will be stored to start up database.

◆ ble8_sps_peripheral_pairing()

void ble8_sps_peripheral_pairing ( ble8_t * ctx)

SPS Pairing As Peripheral Device command.

Parameters
ctxClick object.

@description This command allows SPS pairing as peripheral device, sets data start mode and reboot a module.

Note
This configuration will be stored to start up database.

◆ ble8_store_cnfg_cmd()

void ble8_store_cnfg_cmd ( ble8_t * ctx)

Store Current Configuration command.

Parameters
ctxClick object.

@description This command commits all the settings to be stored in start up database.

Note
Executes +CPWROFF command to write the parameters to non-volatile memory.