Author
|
Matrix TSL
|
Version
|
1.0
|
Category
|
Wireless
|
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.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Bluetooth_ESP32_SPP.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Bluetooth_ESP32_SPP.fcfx
Detailed description
No detailed description exists yet for this component
Examples
A simple example file showing how to send and receive data using the ESP32 Bluetooth Serial Port Profile.
ESP_BT
The SPP legacy bluetooth mode must be enabled in the ESP32 config file to allow SSP to work. For details please see this forum topic.
For problems sending strings or missing data bytes, please see this forum topic.
Macro reference
|
ReceiveByte
|
Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured
|
- UINT
|
Timeout
|
Number of ms to wait for incoming data
|
- UINT
|
Return
|
|
SendString
|
Sends a string to the Bluetooth serial connection
|
- STRING
|
Data
|
Data Array to send
|
- VOID
|
Return
|
|
ReceiveINTArray
|
Receives an array of 16-bit INT/UINT values and returns the number of values received.
|
- UINT
|
Data
|
Array to store the incoming data
|
- BYTE
|
NumValues
|
Maximum number of values to try and receive
|
- BOOL
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- BYTE
|
Return
|
|
SendINTArray
|
Transmits an array of 16-bit INT/UINT values via the Bluetooth peripheral
|
- UINT
|
Data
|
Data Array to send
|
- BYTE
|
NumValues
|
Number of 16-bit values to send from the array
|
- BOOL
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- VOID
|
Return
|
|
CheckConnectionStatus
|
Checks to see if the Bluetooth device is connected. Returns 1 if connected.
|
- BOOL
|
Return
|
|
ReceiveCount
|
Collects the number of bytes currently stored in the receive buffer.
|
- UINT
|
Return
|
|
ReceiveArray
|
Attempts to receive an array of bytes from the bluetooth serial port. Returns the number of bytes received.
|
- 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
|
- UINT
|
Return
|
|
SendArray
|
Sends a byte to the Bluetooth serial connection
|
- BYTE
|
Data
|
Data Array to send
|
- UINT
|
NumBytes
|
Number of bytes to send
|
- VOID
|
Return
|
|
SendByte
|
Sends a byte to the Bluetooth serial connection
|
- BYTE
|
Data
|
|
- VOID
|
Return
|
|
ReceiveString
|
|
- UINT
|
MaxBytes
|
Max number of bytes to try and read within the time
|
- UINT
|
Timeout
|
Number of ms to wait for incoming data
|
- STRING
|
Return
|
|
Initialise
|
Starts up the Bluetooth communications SPP service.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Device Name
|
Sets the Bluetooth device friendly name
|
|
Receive Buffer
|
Configures the size of the receive buffer in bytes to store incoming data until we are ready to receive it.
|
|
Data Receive Interrupt
|
|
|
Verbose Debug
|
When enabled debug messages will be placed onto UART CH1 which is generally connected to via a Serial to USB IC to pipe messages back to the host PC.
|
|
Simulation
|
|
COM Port
|
Selects which port to communicate with, only lists ports which are currently available.
|
|
Refresh COM Ports
|
When set to yes the COM port list is rescanned for newly connected or available ports. Note that refreshing the ports list may take a few seconds depending on the number of connected ports.
|
|
Baud
|
Baud rate passed to the COM port to control the rate of data.
|
|
Console Data
|
|
==Macro reference==
|
ReceiveByte
|
Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured
|
- UINT
|
Timeout
|
Number of ms to wait for incoming data
|
- UINT
|
Return
|
|
SendString
|
Sends a string to the Bluetooth serial connection
|
- STRING
|
Data
|
Data Array to send
|
- VOID
|
Return
|
|
ReceiveINTArray
|
Receives an array of 16-bit INT/UINT values and returns the number of values received.
|
- UINT
|
Data
|
Array to store the incoming data
|
- BYTE
|
NumValues
|
Maximum number of values to try and receive
|
- BOOL
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- BYTE
|
Return
|
|
SendINTArray
|
Transmits an array of 16-bit INT/UINT values via the Bluetooth peripheral
|
- UINT
|
Data
|
Data Array to send
|
- BYTE
|
NumValues
|
Number of 16-bit values to send from the array
|
- BOOL
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- VOID
|
Return
|
|
CheckConnectionStatus
|
Checks to see if the Bluetooth device is connected. Returns 1 if connected.
|
- BOOL
|
Return
|
|
ReceiveCount
|
Collects the number of bytes currently stored in the receive buffer.
|
- UINT
|
Return
|
|
ReceiveArray
|
Attempts to receive an array of bytes from the bluetooth serial port. Returns the number of bytes received.
|
- 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
|
- UINT
|
Return
|
|
SendArray
|
Sends a byte to the Bluetooth serial connection
|
- BYTE
|
Data
|
Data Array to send
|
- UINT
|
NumBytes
|
Number of bytes to send
|
- VOID
|
Return
|
|
SendByte
|
Sends a byte to the Bluetooth serial connection
|
- BYTE
|
Data
|
|
- VOID
|
Return
|
|
ReceiveString
|
|
- UINT
|
MaxBytes
|
Max number of bytes to try and read within the time
|
- UINT
|
Timeout
|
Number of ms to wait for incoming data
|
- STRING
|
Return
|
|
Initialise
|
Starts up the Bluetooth communications SPP service.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Device Name
|
Sets the Bluetooth device friendly name
|
|
Receive Buffer
|
Configures the size of the receive buffer in bytes to store incoming data until we are ready to receive it.
|
|
Data Receive Interrupt
|
|
|
Verbose Debug
|
When enabled debug messages will be placed onto UART CH1 which is generally connected to via a Serial to USB IC to pipe messages back to the host PC.
|
|
Simulation
|
|
COM Port
|
Selects which port to communicate with, only lists ports which are currently available.
|
|
Refresh COM Ports
|
When set to yes the COM port list is rescanned for newly connected or available ports. Note that refreshing the ports list may take a few seconds depending on the number of connected ports.
|
|
Baud
|
Baud rate passed to the COM port to control the rate of data.
|
|
Console Data
|
|
==Macro reference==
|
ReceiveByte
|
Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured
|
- UINT
|
Timeout
|
Number of ms to wait for incoming data
|
- UINT
|
Return
|
|
SendString
|
Sends a string to the Bluetooth serial connection
|
- STRING
|
Data
|
Data Array to send
|
- VOID
|
Return
|
|
ReceiveINTArray
|
Receives an array of 16-bit INT/UINT values and returns the number of values received.
|
- UINT
|
Data
|
Array to store the incoming data
|
- BYTE
|
NumValues
|
Maximum number of values to try and receive
|
- BOOL
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- BYTE
|
Return
|
|
SendINTArray
|
Transmits an array of 16-bit INT/UINT values via the Bluetooth peripheral
|
- UINT
|
Data
|
Data Array to send
|
- BYTE
|
NumValues
|
Number of 16-bit values to send from the array
|
- BOOL
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- VOID
|
Return
|
|
CheckConnectionStatus
|
Checks to see if the Bluetooth device is connected. Returns 1 if connected.
|
- BOOL
|
Return
|
|
ReceiveCount
|
Collects the number of bytes currently stored in the receive buffer.
|
- UINT
|
Return
|
|
ReceiveArray
|
Attempts to receive an array of bytes from the bluetooth serial port. Returns the number of bytes received.
|
- 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
|
- UINT
|
Return
|
|
SendArray
|
Sends a byte to the Bluetooth serial connection
|
- BYTE
|
Data
|
Data Array to send
|
- UINT
|
NumBytes
|
Number of bytes to send
|
- VOID
|
Return
|
|
SendByte
|
Sends a byte to the Bluetooth serial connection
|
- BYTE
|
Data
|
|
- VOID
|
Return
|
|
ReceiveString
|
|
- UINT
|
MaxBytes
|
Max number of bytes to try and read within the time
|
- UINT
|
Timeout
|
Number of ms to wait for incoming data
|
- STRING
|
Return
|
|
Initialise
|
Starts up the Bluetooth communications SPP service.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Device Name
|
Sets the Bluetooth device friendly name
|
|
Receive Buffer
|
Configures the size of the receive buffer in bytes to store incoming data until we are ready to receive it.
|
|
Data Receive Interrupt
|
|
|
Verbose Debug
|
When enabled debug messages will be placed onto UART CH1 which is generally connected to via a Serial to USB IC to pipe messages back to the host PC.
|
|
Simulation
|
|
COM Port
|
Selects which port to communicate with, only lists ports which are currently available.
|
|
Refresh COM Ports
|
When set to yes the COM port list is rescanned for newly connected or available ports. Note that refreshing the ports list may take a few seconds depending on the number of connected ports.
|
|
Baud
|
Baud rate passed to the COM port to control the rate of data.
|
|
Console Data
|
|
==Macro reference==
|
ReceiveByte
|
Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured
|
- UINT
|
Timeout
|
Number of ms to wait for incoming data
|
- UINT
|
Return
|
|
SendString
|
Sends a string to the Bluetooth serial connection
|
- STRING
|
Data
|
Data Array to send
|
- VOID
|
Return
|
|
ReceiveINTArray
|
Receives an array of 16-bit INT/UINT values and returns the number of values received.
|
- UINT
|
Data
|
Array to store the incoming data
|
- BYTE
|
NumValues
|
Maximum number of values to try and receive
|
- BOOL
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- BYTE
|
Return
|
|
SendINTArray
|
Transmits an array of 16-bit INT/UINT values via the Bluetooth peripheral
|
- UINT
|
Data
|
Data Array to send
|
- BYTE
|
NumValues
|
Number of 16-bit values to send from the array
|
- BOOL
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- VOID
|
Return
|
|
CheckConnectionStatus
|
Checks to see if the Bluetooth device is connected. Returns 1 if connected.
|
- BOOL
|
Return
|
|
ReceiveCount
|
Collects the number of bytes currently stored in the receive buffer.
|
- UINT
|
Return
|
|
ReceiveArray
|
Attempts to receive an array of bytes from the bluetooth serial port. Returns the number of bytes received.
|
- 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
|
- UINT
|
Return
|
|
SendArray
|
Sends a byte to the Bluetooth serial connection
|
- BYTE
|
Data
|
Data Array to send
|
- UINT
|
NumBytes
|
Number of bytes to send
|
- VOID
|
Return
|
|
SendByte
|
Sends a byte to the Bluetooth serial connection
|
- BYTE
|
Data
|
|
- VOID
|
Return
|
|
ReceiveString
|
|
- UINT
|
MaxBytes
|
Max number of bytes to try and read within the time
|
- UINT
|
Timeout
|
Number of ms to wait for incoming data
|
- STRING
|
Return
|
|
Initialise
|
Starts up the Bluetooth communications SPP service.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Device Name
|
Sets the Bluetooth device friendly name
|
|
Receive Buffer
|
Configures the size of the receive buffer in bytes to store incoming data until we are ready to receive it.
|
|
Data Receive Interrupt
|
|
|
Verbose Debug
|
When enabled debug messages will be placed onto UART CH1 which is generally connected to via a Serial to USB IC to pipe messages back to the host PC.
|
|
Simulation
|
|
COM Port
|
Selects which port to communicate with, only lists ports which are currently available.
|
|
Refresh COM Ports
|
When set to yes the COM port list is rescanned for newly connected or available ports. Note that refreshing the ports list may take a few seconds depending on the number of connected ports.
|
|
Baud
|
Baud rate passed to the COM port to control the rate of data.
|
|
Console Data
|
|
==Macro reference==
|
ReceiveByte
|
Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured
|
- UINT
|
Timeout
|
Number of ms to wait for incoming data
|
- UINT
|
Return
|
|
SendString
|
Sends a string to the Bluetooth serial connection
|
- STRING
|
Data
|
Data Array to send
|
- VOID
|
Return
|
|
ReceiveINTArray
|
Receives an array of 16-bit INT/UINT values and returns the number of values received.
|
- UINT
|
Data
|
Array to store the incoming data
|
- BYTE
|
NumValues
|
Maximum number of values to try and receive
|
- BOOL
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- BYTE
|
Return
|
|
SendINTArray
|
Transmits an array of 16-bit INT/UINT values via the Bluetooth peripheral
|
- UINT
|
Data
|
Data Array to send
|
- BYTE
|
NumValues
|
Number of 16-bit values to send from the array
|
- BOOL
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- VOID
|
Return
|
|
CheckConnectionStatus
|
Checks to see if the Bluetooth device is connected. Returns 1 if connected.
|
- BOOL
|
Return
|
|
ReceiveCount
|
Collects the number of bytes currently stored in the receive buffer.
|
- UINT
|
Return
|
|
ReceiveArray
|
Attempts to receive an array of bytes from the bluetooth serial port. Returns the number of bytes received.
|
- 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
|
- UINT
|
Return
|
|
SendArray
|
Sends a byte to the Bluetooth serial connection
|
- BYTE
|
Data
|
Data Array to send
|
- UINT
|
NumBytes
|
Number of bytes to send
|
- VOID
|
Return
|
|
SendByte
|
Sends a byte to the Bluetooth serial connection
|
- BYTE
|
Data
|
|
- VOID
|
Return
|
|
ReceiveString
|
|
- UINT
|
MaxBytes
|
Max number of bytes to try and read within the time
|
- UINT
|
Timeout
|
Number of ms to wait for incoming data
|
- STRING
|
Return
|
|
Initialise
|
Starts up the Bluetooth communications SPP service.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Device Name
|
Sets the Bluetooth device friendly name
|
|
Receive Buffer
|
Configures the size of the receive buffer in bytes to store incoming data until we are ready to receive it.
|
|
Data Receive Interrupt
|
|
|
Verbose Debug
|
When enabled debug messages will be placed onto UART CH1 which is generally connected to via a Serial to USB IC to pipe messages back to the host PC.
|
|
Simulation
|
|
COM Port
|
Selects which port to communicate with, only lists ports which are currently available.
|
|
Refresh COM Ports
|
When set to yes the COM port list is rescanned for newly connected or available ports. Note that refreshing the ports list may take a few seconds depending on the number of connected ports.
|
|
Baud
|
Baud rate passed to the COM port to control the rate of data.
|
|
Console Data
|
|