btaudio3 2.0.0.0
main.c File Reference

BT Audio 3 Click Example. More...

#include "board.h"
#include "log.h"
#include "btaudio3.h"

Macros

#define DEVICE_NAME   "BT Audio 3 click"
 
#define COMMAND_PLAY   "play"
 
#define COMMAND_PAUSE   "pause"
 
#define COMMAND_STOP   "stop"
 
#define COMMAND_NEXT   "next"
 
#define COMMAND_PREVIOUS   "prev"
 
#define COMMAND_VOLUME_UP   "up"
 
#define COMMAND_VOLUME_DOWN   "down"
 
#define COMMAND_UNMUTE   "unmute"
 
#define COMMAND_MUTE   "mute"
 
#define COMMAND_MODE_UP   "mode"
 
#define COMMAND_CALL   "call"
 
#define COMMAND_VOICE   "voice"
 

Functions

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

Detailed Description

BT Audio 3 Click Example.

Description

This example demonstrates the use of BT Audio 3 click board by reading the commands received from remote device and performing adequate actions accordingly.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures the click board.

Application Task

Reads all the received events and parses them.

Additional Function

  • static err_t btaudio3_event_handler ( btaudio3_t *ctx ) - This function handles SPP data event and several BTM state events added in. The other events will just be displayed on the USB UART in hex format.
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. So make sure to pair your device with the click board and connect it to using the Serial Bluetooth Terminal application, then you will be able to send commands listed below.
Author
Stefan Filipovic

Macro Definition Documentation

◆ COMMAND_CALL

#define COMMAND_CALL   "call"

◆ COMMAND_MODE_UP

#define COMMAND_MODE_UP   "mode"

◆ COMMAND_MUTE

#define COMMAND_MUTE   "mute"

◆ COMMAND_NEXT

#define COMMAND_NEXT   "next"

◆ COMMAND_PAUSE

#define COMMAND_PAUSE   "pause"

◆ COMMAND_PLAY

#define COMMAND_PLAY   "play"

◆ COMMAND_PREVIOUS

#define COMMAND_PREVIOUS   "prev"

◆ COMMAND_STOP

#define COMMAND_STOP   "stop"

◆ COMMAND_UNMUTE

#define COMMAND_UNMUTE   "unmute"

◆ COMMAND_VOICE

#define COMMAND_VOICE   "voice"

◆ COMMAND_VOLUME_DOWN

#define COMMAND_VOLUME_DOWN   "down"

◆ COMMAND_VOLUME_UP

#define COMMAND_VOLUME_UP   "up"

◆ DEVICE_NAME

#define DEVICE_NAME   "BT Audio 3 click"

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 )