bt 2.0.0.0
main.c File Reference

BT Click Example. More...

#include "board.h"
#include "log.h"
#include "bt.h"

Functions

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

Detailed Description

BT Click Example.

Description

This example demonstrates the use of BT click board.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures the click board.

Application Task

Handles most of the events required for this example, the packages of events not supported in this example will be just displayed on the USB UART. The event handler will display all messages sent from the remote device on the USB UART and send back the predefined response message "DONE". There are two specific commands which can be sent from the remote device: "led blink" - calls bt_led_blink function for a 5 seconds time period. "check buttons" - calls bt_check_buttons function.

Additional Function

  • static void bt_event_handler ( bt_t *ctx )
  • static void bt_led_blink ( bt_t *ctx )
  • static void bt_check_buttons ( bt_t *ctx )
Note
We have used the Serial Bluetooth Terminal smartphone application for the test. A smartphone and the click board must be paired in order to exchange messages with each other.
Author
Stefan Filipovic

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

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 )