uTrack
|
Is a profile for Audio via bluetooth (HFP-AG). More...
#include "uTrack.h"
#include "utBluetoothAudio.h"
#include "utHAL.h"
#include <stdlib.h>
Data Structures | |
struct | BT_ModeHandler |
Handler type for running modes. More... | |
struct | BTDeviceData |
Information about a Bluetooth device. More... | |
Macros | |
#define | BLUETOOTH_AUDIO_RX_BUFFER_SIZE 128 |
Receive buffer for the Bluetooth Audio module. | |
#define | RESPONSE_BUFFER_LENGTH 150 |
The maximum length, in bytes, of the buffer handling command responses from the BT module. | |
#define | ABS_MAX_CHANNELS 1 |
The maximum number of audio channels the current implementation supports. | |
#define | MAX_WRITE_RETRIES 10 |
The maximum number of times to retry recording to file within the time period specified by RETRY_RATE_TIMER . | |
#define | RETRY_RATE_TIMER 15.0f * 60.0f |
The time, in seconds, that the retry rate should be measured over. | |
#define | MAX_DEVICE_LISTING 6 |
The maximum number of devices to store IDs for when listing stored pairings with the SET command. | |
#define | INQUIRY_RESULTS_WAIT_MS 10000 |
The time to wait before cancelling an INQUIRY command because it has taken too long. | |
#define | MAX_INQUIRY_IDS 6 |
The maximum number of devices to store IDs for when listing visible devices with an INQUIRY command. | |
Enumerations | |
enum | BT_ModeType { MODE_OFF , MODE_PAIRING , MODE_RUNNING , MODE_MAX } |
The mode this module is running in. | |
enum | BTState { BT_ON , LISTING , SINGLE_LINK , SINGLE_SCO , DOUBLE_LINK , MULTI_SCO , RECORDING , ERROR , BTSTATEMAX } |
The state this module is in, primarily used in Running Mode. BTSTATEMAX is a sentinel value. | |
enum | BTConnectionState { CLOSED = 0 , REQUEST_CLOSE , WAIT_CLOSE , REQUEST_OPEN , WAIT_OPEN , OPEN , BTCON_MAX } |
The states a connection between two Bluetooth devices can be in, as handled here. BTCON_MAX is a sentinel value. | |
enum | BTPairState { NOT_PAIRED , LOOKING , REQUEST_PROFILE , WAIT_PROFILE , REQUEST_PAIR , WAIT_PAIR , PAIRED } |
The states used internally when in Pairing Mode. | |
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 |
Is a profile for Audio via bluetooth (HFP-AG).
See also utI2S_3287.c
#define ABS_MAX_CHANNELS 1 |
The maximum number of audio channels the current implementation supports.
\TODO usrChannels #1104
#define BLUETOOTH_AUDIO_RX_BUFFER_SIZE 128 |
Receive buffer for the Bluetooth Audio module.
#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.
bool BT_Audio_On | ( | void | ) |
Returns the on/off status of the module
void |
void utBTAudio_BeginRecording | ( | void | ) |
Tell the state engine to start writing audio to file as soon as it has data
void |
void utBTAudio_EndRecording | ( | void | ) |
Tell the state engine to stop writing audio
void |
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.
state | A state message. |
void utBTAudio_OnOff | ( | bool | isOn, |
bool | stayOn | ||
) |
OnOff turns this software module on or off.
isOn | Whether to turn on or off. |
stayOn | Whether to leave the software module on after the power is turned off. |
void utBTAudio_UpdateTimestamp | ( | UT_DateTime | timestamp | ) |
Updates the timestamp that will be written in the current audio file metadata.
timestamp | The new timestamp. |