BLE TX click
BLE TX Click is a compact add-on board that contains a low-energy Bluetooth transmitter. This board features the AK1595, a Bluetooth 5.2 transmitter with incorporated proprietary algorithm software from AKM Semiconductor. The AK1595 transmitter simplifies wireless connectivity to a system with no need to develop complicated, proprietary microcontroller code. Bluetooth Low Energy compliant advertising transmission can be achieved by simply configuring the transmission power, data, and transmission start-trigger via the UART or I2C interface.
click Product page
Click library
- Author : Nenad Filipovic
- Date : Mar 2021.
- Type : I2C type
Software Support
We provide a library for the BleTx Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.
Library Description
This library contains API for BleTx Click driver.
Standard key functions :
bletx_cfg_setup
Config Object Initialization function.
void bletx_cfg_setup(bletx_cfg_t *cfg)
BLE TX configuration object setup function.
BLE TX Click configuration object.
Definition bletx.h:321
bletx_init
Initialization function.
err_t bletx_init(bletx_t *ctx, bletx_cfg_t *cfg)
BLE TX initialization function.
BLE TX Click context object.
Definition bletx.h:301
bletx_default_cfg
Click Default Configuration function.
err_t bletx_default_cfg(bletx_t *ctx)
BLE TX default configuration function.
Example key functions :
bletx_start_advertising
BLE TX start advertising function.
err_t bletx_start_advertising(bletx_t *ctx)
BLE TX start advertising function.
bletx_set_configuration
BLE TX configuration setting function
err_t bletx_set_configuration(bletx_t *ctx, bletx_adv_cfg_t adv_cfg)
BLE TX configuration setting function.
bletx_adv_cfg_t adv_cfg
Definition main.c:53
BLE TX Click advertising settings object.
Definition bletx.h:340
bletx_create_eddystone_uri
BLE TX create Eddystone™ URI data packet function.
err_t bletx_create_eddystone_uri(bletx_t *ctx, bletx_eddystone_data_t adv_data)
BLE TX create Eddystone™ URI data packet function.
bletx_eddystone_data_t adv_data
Definition main.c:54
BLE TX Click Eddystone™ data packet.
Definition bletx.h:377
Example Description
This library contains API for the Ble TX Click driver. This example processes data from Ble TX Click, Ble TX Click Bluetooth® Low Energy compliant advertising transmission can be achieved by simply configuring the transmission power, data, and transmission - start trigger.
The demo application is composed of two sections :
Application Init
Initialization of I2C module and log UART. Initializes driver and set performs the default configuration. Configure Bluetooth Low Energy Beacons to transmit so-called advertising frames. Configuration of the Eddystone URI, UID, or TLM Bluetooth Low Energy Beacons profile task depends on uncommented code. Eddystone ( URI ) : broadcasts a URL of at most 15 characters that redirects to a website that is secured using SSL. Eddystone ( UID ) : broadcasts an identifying code that allows apps to retrieve information from app servers. Eddystone ( TLM ) : broadcasts information about the beacon, include battery level, sensor data, or other relevant information to beacon administrators.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( I2C_MASTER_ERROR ==
bletx_init( &bletx, &bletx_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
Delay_ms ( 1000 );
{
log_error( &logger, " Set configuration." );
for ( ; ; );
}
Delay_ms ( 100 );
#ifdef URI
#endif
#ifdef UID
#endif
#ifdef TLM
#endif
log_info( &logger, " Application Task " );
Delay_ms ( 100 );
}
@ TX_POWER_0_dBm
Definition bletx.h:425
@ BLETX_OK
Definition bletx.h:472
@ ADVCH1_37_Ch_2402_MHz
Definition bletx.h:404
@ ADVCH3_39_Ch_2480_MHz
Definition bletx.h:414
@ ADVCH2_38_Ch_2426_MHz
Definition bletx.h:409
#define BLETX_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition bletx.h:285
#define BLETX_WHITE_ENABLE
BLE TX white description setting.
Definition bletx.h:213
#define BLETX_CHARACTER_CODES_DOT_COM
BLE TX character codes description setting.
Definition bletx.h:220
#define BLETX_TX_POWER_LVL_MODE_LOW
Definition bletx.h:191
#define BLETX_EDDYSTONE_SERVICE_DATA_TYPE_VALUE
Definition bletx.h:244
#define BLETX_EDDYSTONE_FRAME_TYPE_TLM
Definition bletx.h:252
#define BLETX_EDDYSTONE_SERVICE_UUID
BLE TX Eddystone service UUID description setting.
Definition bletx.h:243
#define BLETX_TX_POWER_LVL_MODE_LOWEST
BLE TX TX power level description setting.
Definition bletx.h:190
#define BLETX_EDDYSTONE_SPEC_DATA_HTTPS_WWW
Definition bletx.h:233
#define BLETX_CRC_ENABLE
BLE TX CRC description setting.
Definition bletx.h:206
#define BLETX_EDDYSTONE_FRAME_TYPE_URL
Definition bletx.h:251
#define BLETX_EDDYSTONE_SPEC_DATA_TLM
Definition bletx.h:237
#define BLETX_EDDYSTONE_FRAME_TYPE_UID
BLE TX Eddystone frame type description setting.
Definition bletx.h:250
#define BLETX_ADV_DELAY_ENABLE
BLE TX advertising delay description setting.
Definition bletx.h:199
err_t bletx_create_eddystone_uid(bletx_t *ctx, bletx_eddystone_data_t adv_data)
BLE TX create Eddystone™ UID data packet function.
err_t bletx_create_eddystone_tlm(bletx_t *ctx, bletx_eddystone_data_t adv_data)
BLE TX create Eddystone™ TLM data packet function.
void application_init(void)
Definition main.c:56
uint8_t pdu_len
Definition bletx.h:352
uint16_t avdintvl_interval_ms
Definition bletx.h:349
uint8_t adv_ch_3_frequency
Definition bletx.h:343
uint8_t txdata_cw
Definition bletx.h:346
uint8_t uuid[6]
Definition bletx.h:353
uint8_t tx_output_power
Definition bletx.h:344
uint8_t adv_ch_2_frequency
Definition bletx.h:342
uint8_t adv_ch_1_frequency
Definition bletx.h:341
uint8_t eventnum
Definition bletx.h:347
uint8_t crc_enb
Definition bletx.h:350
uint8_t advdelay_enb
Definition bletx.h:348
uint8_t white_enb
Definition bletx.h:351
uint8_t txdata_loop
Definition bletx.h:345
uint8_t frame_type_url
Definition bletx.h:383
uint32_t pdu_count
Definition bletx.h:393
uint8_t advdata_url[32]
Definition bletx.h:386
uint8_t domain
Definition bletx.h:387
uint8_t instance_id[6]
Definition bletx.h:389
uint16_t battery_voltage
Definition bletx.h:391
uint8_t length_of_service_data
Definition bletx.h:381
uint16_t eddystone_id
Definition bletx.h:380
uint8_t tlm_version
Definition bletx.h:390
uint8_t param_service_list
Definition bletx.h:379
uint8_t spec_data
Definition bletx.h:385
uint8_t service_data
Definition bletx.h:382
uint8_t name_space_id[10]
Definition bletx.h:388
float beacon_temperature
Definition bletx.h:392
uint8_t power
Definition bletx.h:384
uint8_t length_of_service_list
Definition bletx.h:378
Application Task
This is an example that shows the use of a Ble TX click board™. In this example, the application turns the selected advertising frames ON and OFF for a period of 10 seconds.
{
log_printf( &logger, ">>>\tStart Advertising \r\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, ">>>\tStop Advertising \r\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
err_t bletx_stop_advertising(bletx_t *ctx)
BLE TX stop advertising function.
void application_task(void)
Definition main.c:184
Note
For scanning BLE TX click board™ BLE Scanner is a recommended Android application and you can find it at the link: https://play.google.com/store/apps/details?id=com.macdom.ble.blescanner
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.
Other mikroE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.BleTx
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. UART terminal is available in all Mikroelektronika compilers.