Component: Bluetooth (ESP32 SPP) (Wireless): Difference between revisions
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| Line 44: | Line 44: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CheckConnectionStatus''' | ||
|- | |- | ||
| colspan="2" | Checks to see if the Bluetooth device is connected. Returns 1 if connected. | | colspan="2" | Checks to see if the Bluetooth device is connected. Returns 1 if connected. | ||
| Line 58: | Line 58: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | Starts up the Bluetooth communications SPP service. | | colspan="2" | Starts up the Bluetooth communications SPP service. | ||
| Line 72: | Line 72: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveArray''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive an array of bytes from the bluetooth serial port. Returns the number of bytes received. | | colspan="2" | Attempts to receive an array of bytes from the bluetooth serial port. Returns the number of bytes received. | ||
| Line 101: | Line 101: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveByte''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured | | colspan="2" | Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured | ||
| Line 120: | Line 120: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveCount''' | ||
|- | |- | ||
| colspan="2" | Collects the number of bytes currently stored in the receive buffer. | | colspan="2" | Collects the number of bytes currently stored in the receive buffer. | ||
| Line 134: | Line 134: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveINTArray''' | ||
|- | |- | ||
| colspan="2" | Receives an array of 16-bit INT/UINT values and returns the number of values received. | | colspan="2" | Receives an array of 16-bit INT/UINT values and returns the number of values received. | ||
| Line 168: | Line 168: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveString''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 192: | Line 192: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendArray''' | ||
|- | |- | ||
| colspan="2" | Sends a byte to the Bluetooth serial connection | | colspan="2" | Sends a byte to the Bluetooth serial connection | ||
| Line 216: | Line 216: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendByte''' | ||
|- | |- | ||
| colspan="2" | Sends a byte to the Bluetooth serial connection | | colspan="2" | Sends a byte to the Bluetooth serial connection | ||
| Line 235: | Line 235: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendINTArray''' | ||
|- | |- | ||
| colspan="2" | Transmits an array of 16-bit INT/UINT values via the Bluetooth peripheral | | colspan="2" | Transmits an array of 16-bit INT/UINT values via the Bluetooth peripheral | ||
| Line 264: | Line 264: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendString''' | ||
|- | |- | ||
| colspan="2" | Sends a string to the Bluetooth serial connection | | colspan="2" | Sends a string to the Bluetooth serial connection | ||
| Line 283: | Line 283: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetBTName''' | ||
|- | |- | ||
| colspan="2" | Overrides the current friendly name | | colspan="2" | Overrides the current friendly name | ||
| Line 302: | Line 302: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Uninitialise''' | ||
|- | |- | ||
| colspan="2" | Shots down the Bluetooth communications SPP service. | | colspan="2" | Shots down the Bluetooth communications SPP service. | ||
| Line 317: | Line 317: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
Revision as of 14:22, 13 July 2026
| 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.
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
CheckConnectionStatus
| CheckConnectionStatus | |
| Checks to see if the Bluetooth device is connected. Returns 1 if connected. | |
| Return | |
Initialise
| Initialise | |
| Starts up the Bluetooth communications SPP service. | |
| Return | |
ReceiveArray
ReceiveByte
| ReceiveByte | |
| Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured | |
| Timeout | |
| Number of ms to wait for incoming data | |
| Return | |
ReceiveCount
| ReceiveCount | |
| Collects the number of bytes currently stored in the receive buffer. | |
| Return | |
ReceiveINTArray
ReceiveString
| ReceiveString | |
| MaxBytes | |
| Max number of bytes to try and read within the time | |
| Timeout | |
| Number of ms to wait for incoming data | |
| Return | |
SendArray
| SendArray | |
| Sends a byte to the Bluetooth serial connection | |
| Data | |
| Data Array to send | |
| NumBytes | |
| Number of bytes to send | |
| Return | |
SendByte
| SendByte | |
| Sends a byte to the Bluetooth serial connection | |
| Data | |
| Return | |
SendINTArray
SendString
| SendString | |
| Sends a string to the Bluetooth serial connection | |
| Data | |
| Data Array to send | |
| Return | |
SetBTName
| SetBTName | |
| Overrides the current friendly name | |
| Name | |
| Name you want to use | |
| Return | |
Uninitialise
| Uninitialise | |
| Shots down the Bluetooth communications SPP service. | |
| Return | |