Difference between revisions of "Component: Bluetooth (ESP32 SPP) (Wireless)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Wireless
 
| 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.
  
==[[File:Component Icon 8be2ce64_4860_468a_aa8a_eac443274da3.png|Image]] Bluetooth (ESP32 SPP) component==
+
==Detailed description==
Bluetooth slave component designed to run on a ESP32 providing legacy SPP functionality.
 
BT Legacy functionality must be switched on via the sdkconfig file.
 
  
 +
''No detailed description exists yet for this component''
  
 
==Examples==
 
==Examples==
 +
 +
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
  
Line 26: Line 27:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>ReceiveByte</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Attempts to receive a byte from the bluetooth serial port.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveByte'''
 +
|-
 +
| colspan="2" | Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Timeout
 +
|-
 +
| colspan="2" | Number of ms to wait for incoming data&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
0-255 = a valid received value
 
  
256 = a timeout has occured
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendString'''
 +
|-
 +
| colspan="2" | Sends a string to the Bluetooth serial connection&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data Array to send&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|UINT]] ''Timeout''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Number of ms to wait for incoming data
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckConnectionStatus'''
 +
|-
 +
| colspan="2" | Checks to see if the Bluetooth device is connected. Returns 1 if connected.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveCount'''
 +
|-
 +
| colspan="2" | Collects the number of bytes currently stored in the receive buffer.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|UINT]]
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveArray'''
 +
|-
 +
| colspan="2" | Attempts to receive an array of bytes from the bluetooth serial port. Returns the number of bytes received.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Buffer to place received data into&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | MaxBytes
 +
|-
 +
| colspan="2" | Max number of bytes to try and read within the time&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Timeout
 +
|-
 +
| colspan="2" | Number of ms to wait for incoming data&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>SendString</tt></u></span>===
 
Sends a string to the Bluetooth serial connection
 
  
'''Parameters'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendArray'''
 +
|-
 +
| colspan="2" | Sends a byte to the Bluetooth serial connection&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data Array to send&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | NumBytes
 +
|-
 +
| colspan="2" | Number of bytes to send&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|<- STRING]] ''Data''
 
::Data Array to send
 
::''This parameter may be returned back to the caller''
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendByte'''
 +
|-
 +
| colspan="2" | Sends a byte to the Bluetooth serial connection&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:''This call does not return a value''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveString'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | MaxBytes
 +
|-
 +
| colspan="2" | Max number of bytes to try and read within the time&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Timeout
 +
|-
 +
| colspan="2" | Number of ms to wait for incoming data&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>CheckConnectionStatus</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Checks to see if the Bluetooth device is connected.
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Returns 1 if connected.
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
+
|-
'''Parameters'''
+
| colspan="2" | Starts up the Bluetooth communications SPP service.&nbsp;
 
+
|-
:''This macro has no parameters''
+
|-
 
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
'''Return value'''
+
|}
 
 
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>ReceiveArray</tt></u></span>===
 
Attempts to receive an array of bytes from the bluetooth serial port.
 
 
 
Returns the number of bytes received.
 
 
 
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Data''
 
::Buffer to place received data into
 
  
:[[Variable Types|UINT]] ''MaxBytes''
 
::Max number of bytes to try and read within the time
 
 
:[[Variable Types|UINT]] ''Timeout''
 
::Number of ms to wait for incoming data
 
 
 
'''Return value'''
 
 
:[[Variable Types|UINT]]
 
 
 
===<span style="font-weight: normal;"><u><tt>SendArray</tt></u></span>===
 
Sends a byte to the Bluetooth serial connection
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''Data''
 
::Data Array to send
 
 
:[[Variable Types|UINT]] ''NumBytes''
 
::Number of bytes to send
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>SendByte</tt></u></span>===
 
Sends a byte to the Bluetooth serial connection
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''Data''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>ReceiveString</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
'''Parameters'''
 
 
:[[Variable Types|UINT]] ''MaxBytes''
 
::Max number of bytes to try and read within the time
 
 
:[[Variable Types|UINT]] ''Timeout''
 
::Number of ms to wait for incoming data
 
 
 
'''Return value'''
 
 
:[[Variable Types|STRING]]
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
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==
 
==Property reference==
<span style="font-weight: normal;"><u>Device Name</u></span>
 
  
This property is of type ''Line of text'' and can be referenced with the variable name ''DevName''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Sets the Bluetooth device friendly name
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>Receive Buffer</u></span>
+
|-
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''ReceiveBuffer''.
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Device Name
Configures the size of the receive buffer in bytes to store incoming data until we are ready to receive it.
+
|-
 +
| colspan="2" | Sets the Bluetooth device friendly name&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | Receive Buffer
 +
|-
 +
| colspan="2" | Configures the size of the receive buffer in bytes to store incoming data until we are ready to receive it.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Data Receive Interrupt
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Verbose Debug
 +
|-
 +
| colspan="2" | 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.&nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | COM Port
 +
|-
 +
| colspan="2" | Selects which port to communicate with, only lists ports which are currently available. &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Refresh COM Ports
 +
|-
 +
| colspan="2" | 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.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | Baud
 +
|-
 +
| colspan="2" | Baud rate passed to the COM port to control the rate of data.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Console Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|}

Revision as of 16:52, 16 November 2021

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.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Fc9-comp-macro.png ReceiveByte
Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured 
Fc9-u16-icon.png - UINT Timeout
Number of ms to wait for incoming data 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SendString
Sends a string to the Bluetooth serial connection 
Fc9-string-icon.png - STRING Data
Data Array to send 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CheckConnectionStatus
Checks to see if the Bluetooth device is connected. Returns 1 if connected. 
[[File:]] - Return


Fc9-comp-macro.png ReceiveCount
Collects the number of bytes currently stored in the receive buffer. 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png ReceiveArray
Attempts to receive an array of bytes from the bluetooth serial port. Returns the number of bytes received. 
Fc9-u8-icon.png - BYTE Data
Buffer to place received data into 
Fc9-u16-icon.png - UINT MaxBytes
Max number of bytes to try and read within the time 
Fc9-u16-icon.png - UINT Timeout
Number of ms to wait for incoming data 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SendArray
Sends a byte to the Bluetooth serial connection 
Fc9-u8-icon.png - BYTE Data
Data Array to send 
Fc9-u16-icon.png - UINT NumBytes
Number of bytes to send 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendByte
Sends a byte to the Bluetooth serial connection 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReceiveString
 
Fc9-u16-icon.png - UINT MaxBytes
Max number of bytes to try and read within the time 
Fc9-u16-icon.png - UINT Timeout
Number of ms to wait for incoming data 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png Initialise
Starts up the Bluetooth communications SPP service. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-10-icon.png Device Name
Sets the Bluetooth device friendly name 
Fc9-type-21-icon.png Receive Buffer
Configures the size of the receive buffer in bytes to store incoming data until we are ready to receive it. 
Fc9-type-7-icon.png Data Receive Interrupt
 
Fc9-type-16-icon.png 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. 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations
Fc9-type-16-icon.png COM Port
Selects which port to communicate with, only lists ports which are currently available.  
Fc9-type-7-icon.png 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. 
Fc9-type-14-icon.png Baud
Baud rate passed to the COM port to control the rate of data. 
Fc9-type-7-icon.png Console Data