uTrack
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
utBluetoothRFCOMM.c File Reference

Is a profile for Serial via bluetooth (SPP/RFCOMM). More...

#include "uTrack.h"
#include "utBluetoothRFCOMM.h"
#include "utBluetooth.h"
#include "utNmeaOutput.h"

Macros

#define BT_ENCODE_BUFFER_SIZE   BLUETOOTH_TX_BUFFER_SIZE
 
#define MAX_CONNECTIONS   1
 
#define BT_INTERFACE_NAME   "BT"
 

Enumerations

enum  BT_OUTPUT_PROTOCOL { PROTOCOL_NMEA , PROTOCOL_PROTOBUF }
 

Functions

bool utBTRFCOMM_Notify (UT_DeviceMessage state)
 
bool BT_RFCOMM_On (void)
 
bool utBT_RFCOMMSendData (const u8 *data, u32 size)
 
int utBT_RFCOMM_Disconnect (bool reconnect)
 
bool utBT_RFCOMM_SendPayload (const UT_Sendable_Payload *payload, PayloadEncoder encode, com_igtimi_TypeOfService typeOfService)
 
ConnectionInterfaceState utBT_RFCOMM_GetState (void)
 
u8 utBT_RFCOMM_GetConnectionId (void)
 
bool utBT_RFCOMMisConnected (void)
 

Detailed Description

Is a profile for Serial via bluetooth (SPP/RFCOMM).

Uses the utBluetooth module to provide serial transfer over bluetooth. Can be used to either send commands to the device via bluetooth, or to send data out (e.g NMEA data).

Author
Stephen Markham
Date
24/11/2015
Last Updated: 08/05/2019
Note
ALLOW_BTSERIAL_COMMANDS should be defined to allow bluetooth to be used for debugging
REMOVE_RFCOMM can be defined to remove the module at compile time.
Todo:
An elegant way of disconnecting rather than typing 'no carrier' into a terminal

Function Documentation

◆ BT_RFCOMM_On()

bool BT_RFCOMM_On ( void  )

Returns the on/off status of the module

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

◆ utBT_RFCOMMisConnected()

bool utBT_RFCOMMisConnected ( void  )

Returns the connected status of the module

Parameters
void
Returns
bool - status
Note

◆ utBT_RFCOMMSendData()

static bool utBT_RFCOMMSendData ( const u8 *  data,
u32  size 
)

Send serial data via the bluetooth module

Parameters
constu8* - The data to send
u32- The size of the data to send
Returns
bool - If the device is connected or not
Note

◆ utBTRFCOMM_Notify()

bool utBTRFCOMM_Notify ( UT_DeviceMessage  state)

Main Loop calls back to here

Parameters
UT_DeviceMessagestate - Current state of the loop
Returns
bool
Note