We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-11-26
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: BT/BLE
Downloaded: 2423 times
Not followed.
License: MIT license
BT Click is a compact add-on board targeted for applications that require both Bluetooth Smart and Classic connectivity.
Do you want to subscribe in order to receive notifications regarding "BT click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "BT click" changes.
Do you want to report abuse regarding "BT click".
Library Description
The library covers all the necessary functions to control BT Click board™. Library performs a standard UART interface communication.
Key functions:
void bt_send_data ( uint8_t *tx_data, uint8_t len )
- Send data functionuint16_t bt_get_data ( uint8_t *rx_data )
- Get response data function.void bt_hw_reset ( void )
- HW reset function.Examples description
The application is composed of three sections :
void application_task ( )
{
if ( bt_get_data_status( ) == BT_NEW_DATA_AVAILABLE )
{
rsp_data_num = bt_get_data( &rsp_data_buf[ 0 ] );
if ( rsp_data_num != 0 )
{
len = rsp_data_buf[ 5 ];
len += 5;
if ( rsp_data_buf[ 2 ] == BT_NEW_EVT_RX_DISCONN_DATA )
{
display_evt_bt_conn_close( );
display_evt_endpoint_data( );
}
if ( rsp_data_buf[ 2 ] == BT_NEW_EVT_CONNECTED )
{
display_evt_bt_conn_opened( );
}
}
}
}
void intro_device_start ( )
- Start the module.void display_response ( )
- Display response.void display_evt_bt_conn_opened ( )
- Display event new connection was opened.void display_evt_bt_conn_close ( )
- Display event new connection was closed.void display_evt_endpoint_data ( )
- Display event endpoint data.Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.