ble7 2.0.0.0
main.c File Reference

Ble7 Click example. More...

#include "board.h"
#include "log.h"
#include "ble7.h"
#include "string.h"

Macros

#define PROCESS_COUNTER   10
 
#define PROCESS_RX_BUFFER_SIZE   200
 
#define BLE7_ENABLE_ECHO   "set sy c e 1"
 
#define BLE7_CLEAR_BONDING   "clrb"
 
#define BLE7_ENABLE_BONDING   "set bl e b 1"
 
#define BLE7_ENABLE_PAIRING   "set bl e p any"
 
#define BLE7_SET_ADVERTISING_ON   "adv high"
 
#define BLE7_SET_ADVERTISING_HIGH_DURATION   "set bl v h d 120"
 
#define BLE7_SET_DEVICE_NAME   "set sy d n \"BLE7-DEVICE\""
 
#define BLE7_SAVE_CONFIGURATION   "save"
 
#define BLE7_SWITCH_TO_STREAM_MODE   "str"
 

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

Ble7 Click example.

Description

This example reads and processes data from BLE 7 clicks.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures the click board.

Application Task

Checks for the received data, reads it and replies with a certain message.

Additional Function

  • ble7_process ( ) - Logs all received messages on UART, and sends the certain message back to the connected device.
Note
We have used the BLE Scanner smartphone application for the test. A smartphone and the click board must be paired in order to exchange messages with each other. For more information about the BGX module commands, please refer to the following link: https://docs.silabs.com/gecko-os/1/bgx/latest/commands
Author
MikroE Team

Macro Definition Documentation

◆ BLE7_CLEAR_BONDING

#define BLE7_CLEAR_BONDING   "clrb"

◆ BLE7_ENABLE_BONDING

#define BLE7_ENABLE_BONDING   "set bl e b 1"

◆ BLE7_ENABLE_ECHO

#define BLE7_ENABLE_ECHO   "set sy c e 1"

◆ BLE7_ENABLE_PAIRING

#define BLE7_ENABLE_PAIRING   "set bl e p any"

◆ BLE7_SAVE_CONFIGURATION

#define BLE7_SAVE_CONFIGURATION   "save"

◆ BLE7_SET_ADVERTISING_HIGH_DURATION

#define BLE7_SET_ADVERTISING_HIGH_DURATION   "set bl v h d 120"

◆ BLE7_SET_ADVERTISING_ON

#define BLE7_SET_ADVERTISING_ON   "adv high"

◆ BLE7_SET_DEVICE_NAME

#define BLE7_SET_DEVICE_NAME   "set sy d n \"BLE7-DEVICE\""

◆ BLE7_SWITCH_TO_STREAM_MODE

#define BLE7_SWITCH_TO_STREAM_MODE   "str"

◆ PROCESS_COUNTER

#define PROCESS_COUNTER   10

◆ PROCESS_RX_BUFFER_SIZE

#define PROCESS_RX_BUFFER_SIZE   200

Function Documentation

◆ application_init()

void application_init ( void )

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )