The software module for handling the Bluetooth hardware module (WT32).
More...
#include <stdlib.h>
#include "uTrack.h"
#include "utHAL.h"
#include "utBluetoothAudio.h"
#include "utBluetoothRFCOMM.h"
Go to the source code of this file.
|
struct | BT_Profile |
| All the information that is requited when creating a new profile/mode. More...
|
|
struct | BT_Device |
| A device that is created when a Bluetooth device is connected to. More...
|
|
struct | BTCommand |
| All the information about a command to send to the Bluetooth module. More...
|
|
|
enum | ModuleType { BT_MODULE_NONE = 0x00
, BT_MODULE_AUDIO = 0x01
, BT_MODULE_RFCOMM = 0x02
, BT_MODULE_ANY = 0x03
} |
| The fixed mode the BT module can connect to.
|
|
enum | BT_StateType {
STATE_OFF
, STATE_COMMAND
, STATE_SETUP
, STATE_PAIRING
,
STATE_RUNNING
} |
| The mode this module is running in.
|
|
enum | BT_SetupStage { BT_WAIT_BANNER
, BT_WAIT_COMMANDS
} |
| The states used internally when in SetupMode.
|
|
enum | BT_Auth_Mode { BT_AUTH_MODE_DISPLAY
, BT_AUTH_MODE_BUTTON
, BT_AUTH_MODE_KEYBOARD
, BT_AUTH_MODE_NONE
} |
| The states used internally when in SetupMode.
|
|
|
bool | bluemix |
|
bool | processingBTCommands |
|
char | bluemixAddress [17] |
|
The software module for handling the Bluetooth hardware module (WT32).
Holds commond methods for bluetooth connection. Profiles can be added so they can be connected to.
- Authors
- Stephen Markham
-
George Sealy
-
Oscar Key
- Date
- 24/11/2015
Last Updated: 20/11/2015
- Copyright
- 2015, Igtimi Ltd., all rights reserved.
- Note
- -Requires another module to work. This is the main Bluetooth layer which allows different bluetooth profiles (e.g audio, rfcomm) to work
- Todo:
- -Multiple RFCOMM Devices using TDMA?
◆ BLUETOOTH_RX_BUFFER_SIZE
#define BLUETOOTH_RX_BUFFER_SIZE 256 |
The buffer for receiving data.
◆ BLUETOOTH_TX_BUFFER_SIZE
#define BLUETOOTH_TX_BUFFER_SIZE 1024 |
◆ BT_MAX_COMMAND_LENGTH
#define BT_MAX_COMMAND_LENGTH 64 |
Max command length for the BT module.
◆ BT_MAX_NUM_MODES
#define BT_MAX_NUM_MODES 2 |
Maximum number of allowable profile (e.g Audio, RFCOMM)
◆ BT_MAX_NUM_SETUP_COMMANDS
#define BT_MAX_NUM_SETUP_COMMANDS 32 |
The maximum number of allowable setup commands for the BT module.
◆ BT_RESPONSE_BUFFER_LENGTH
#define BT_RESPONSE_BUFFER_LENGTH 256 |
The buffer for the response.
◆ BTaddMode()
Allows other 'profiles' to add themselves to the bluetooth 'layer'
- Parameters
-
- Returns
- bool - True or false depending on whether it was successfull or not.
- Note
◆ BTaddSetupCommand()
bool BTaddSetupCommand |
( |
char * |
com | ) |
|
A method for adding in setup commands from different profiles.
- Parameters
-
char* | - The setup command. |
- Returns
- bool - True or false depending on whether it was successfull or not.
- Note
- - This should be called before the bt module has been turned on (e.g at start) or in the setup commands callback
◆ BTLoggerHasSpace()
int BTLoggerHasSpace |
( |
void |
| ) |
|
Returns the amount of space in the buffer for the logger
- Parameters
-
- Returns
- int - space
- Note
◆ utBT_Notify()
bool utBT_Notify |
( |
UT_DeviceMessage |
state | ) |
|
Main Loop calls back to here
- Parameters
-
UT_DeviceMessage | state - Current state of the loop |
- Returns
- bool
- Note
◆ utBT_SendCommand()
void utBT_SendCommand |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Send a command
- Parameters
-
- Returns
- void
- Note
◆ utBT_SendData()
int utBT_SendData |
( |
const u8 * |
data, |
|
|
u32 |
size |
|
) |
| |
Sends a specified amount of data via the Bluetooth UART
- Parameters
-
const | u8* - the data to send |
u32 | size - the amount of data to send |
- Returns
- int - the amount sent
- Note