Component: Bluetooth (ESP32 SPP) (Wireless)
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | Wireless |
Contents
Bluetooth (ESP32 SPP) component
Bluetooth slave component designed to run on a ESP32 providing legacy SPP functionality. BT Legacy functionality must be switched on via the sdkconfig file.
Examples
No additional examples
Downloadable macro reference
ReceiveByte
Attempts to receive a byte from the bluetooth serial port.
0-255 = a valid received value
256 = a timeout has occured
Parameters
- UINT Timeout
- Number of ms to wait for incoming data
Return value
SendString
Sends a string to the Bluetooth serial connection
Parameters
- <- STRING Data
- Data Array to send
- This parameter may be returned back to the caller
Return value
- This call does not return a value
CheckConnectionStatus
Checks to see if the Bluetooth device is connected.
Returns 1 if connected.
Parameters
- This macro has no parameters
Return value
- BOOL : Returns true if the operation is a success, else false
ReceiveArray
Attempts to receive an array of bytes from the bluetooth serial port.
Returns the number of bytes received.
Parameters
- BYTE Data
- Buffer to place received data into
- UINT MaxBytes
- Max number of bytes to try and read within the time
- UINT Timeout
- Number of ms to wait for incoming data
Return value
SendArray
Sends a byte to the Bluetooth serial connection
Parameters
- BYTE Data
- Data Array to send
- UINT NumBytes
- Number of bytes to send
Return value
- This call does not return a value
SendByte
Sends a byte to the Bluetooth serial connection
Parameters
- BYTE Data
Return value
- This call does not return a value
ReceiveString
No additional information
Parameters
- UINT MaxBytes
- Max number of bytes to try and read within the time
- UINT Timeout
- Number of ms to wait for incoming data
Return value
Initialise
Starts up the Bluetooth communications SPP service.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Device Name
This property is of type Line of text and can be referenced with the variable name DevName.
Sets the Bluetooth device friendly name
Receive Buffer
This property is of type Unsigned integer and can be referenced with the variable name ReceiveBuffer.
Configures the size of the receive buffer in bytes to store incoming data until we are ready to receive it.