Igtimi Yachtbot Firmware
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
utBluetoothAudio.c File Reference
#include "uTrack.h"
#include "utBluetoothAudio.h"
#include "utHAL.h"
#include <stdlib.h>

Data Structures

struct  BT_ModeHandler
 
struct  BTDeviceData
 

Macros

#define BLUETOOTH_AUDIO_RX_BUFFER_SIZE   128
 
#define RESPONSE_BUFFER_LENGTH   150
 
#define ABS_MAX_CHANNELS   1
 
#define MAX_WRITE_RETRIES   10
 
#define RETRY_RATE_TIMER   15.0f * 60.0f
 
#define MAX_DEVICE_LISTING   6
 
#define INQUIRY_RESULTS_WAIT_MS   10000
 
#define MAX_INQUIRY_IDS   6
 

Enumerations

enum  BT_ModeType { MODE_OFF , MODE_PAIRING , MODE_RUNNING , MODE_MAX }
 
enum  BTState {
  BT_ON , LISTING , SINGLE_LINK , SINGLE_SCO ,
  DOUBLE_LINK , MULTI_SCO , RECORDING , ERROR ,
  BTSTATEMAX
}
 
enum  BTConnectionState {
  CLOSED = 0 , REQUEST_CLOSE , WAIT_CLOSE , REQUEST_OPEN ,
  WAIT_OPEN , OPEN , BTCON_MAX
}
 
enum  BTPairState {
  NOT_PAIRED , LOOKING , REQUEST_PROFILE , WAIT_PROFILE ,
  REQUEST_PAIR , WAIT_PAIR , PAIRED
}
 

Functions

bool utBluetoothAudio_isRecording (void)
 
void utBTAudio_UpdateTimestamp (UT_DateTime timestamp)
 
bool utBTAudio_Notify (UT_DeviceMessage state)
 
bool BT_Audio_On (void)
 
void utBTAudio_OnOff (bool isOn, bool stayOn)
 
void utBTAudio_BeginRecording (void)
 
void utBTAudio_EndRecording (void)
 

Variables

u32 startTimeBTA
 

Detailed Description

Is a profile for Audio via bluetooth (HFP-AG).

See also utI2S_3287.c

Authors
George Sealy
Oscar Key
Stephen Markham
Date
23/05/2011
Last Updated: 14/12/2015
Note
To use this module INCLUDE_BT_AUDIO_CODE must be defined along with NUM_AUDIO_BUFFERS=X where 8<X<14

Macro Definition Documentation

◆ ABS_MAX_CHANNELS

#define ABS_MAX_CHANNELS   1

The maximum number of audio channels the current implementation supports.

\TODO usrChannels #1104

◆ BLUETOOTH_AUDIO_RX_BUFFER_SIZE

#define BLUETOOTH_AUDIO_RX_BUFFER_SIZE   128

Receive buffer for the Bluetooth Audio module.

◆ RESPONSE_BUFFER_LENGTH

#define RESPONSE_BUFFER_LENGTH   150

The maximum length, in bytes, of the buffer handling command responses from the BT module.

The response buffer must be at least 131 bytes for the Jabra headsets, but other devices, such as the WT32, may hve a longer SDP response string.

Function Documentation

◆ BT_Audio_On()

bool BT_Audio_On ( void  )

Returns the on/off status of the module

Parameters
void
Returns
bool - ON (true) or OFF (false)
Note

◆ utBTAudio_BeginRecording()

void utBTAudio_BeginRecording ( void  )

Tell the state engine to start writing audio to file as soon as it has data

Parameters
void
Returns
void
Note

◆ utBTAudio_EndRecording()

void utBTAudio_EndRecording ( void  )

Tell the state engine to stop writing audio

Parameters
void
Returns
void
Note

◆ utBTAudio_Notify()

bool utBTAudio_Notify ( UT_DeviceMessage  state)

The Notify function passes a message to the software module, informing it of expected module state. It returns a value that is considered a response to a query about the specified state.

Parameters
stateA state message.
Returns
Whether or not this software module is in the desired state.

◆ utBTAudio_OnOff()

void utBTAudio_OnOff ( bool  isOn,
bool  stayOn 
)

OnOff turns this software module on or off.

Parameters
isOnWhether to turn on or off.
stayOnWhether to leave the software module on after the power is turned off.

◆ utBTAudio_UpdateTimestamp()

void utBTAudio_UpdateTimestamp ( UT_DateTime  timestamp)

Updates the timestamp that will be written in the current audio file metadata.

Parameters
timestampThe new timestamp.