Jump to content

Component: Bluetooth ( Comms): Difference between revisions

From Flowcode Help
Made the filters section more readable
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(5 intermediate revisions by 2 users not shown)
Line 47: Line 47:
==Examples==
==Examples==


Example takes an inpt from a slider and outputs the number to a seven segment display. The display prints Err if the number is out of range.
''<span style="color:red;">No additional examples</span>''
 
{{Fcfile|7segtest.fcsx|Web 7 Segment Display Example}}
 
[https://www.flowcode.co.uk/wiki/WebDevExamples/7segtest.html Web 7 Segment Display Example]


==Macro reference==
==Macro reference==


===Disconnect===
===Disconnect===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Disconnect'''
| width="90%" class="mtx-class-macrohead" | '''Disconnect'''
|-
|-
| colspan="2" | Disconnects from the remote BLE device&nbsp;
| colspan="2" | Disconnects from the remote BLE device&nbsp;
Line 70: Line 66:


===RequestDevice===
===RequestDevice===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RequestDevice'''
| width="90%" class="mtx-class-macrohead" | '''RequestDevice'''
|-
|-
| colspan="2" | Attempts to connect with a Bluetooth BLE device.&nbsp;
| colspan="2" | Attempts to connect with a Bluetooth BLE device.&nbsp;
Line 84: Line 80:


===WriteString===
===WriteString===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteString'''
| width="90%" class="mtx-class-macrohead" | '''WriteString'''
|-
|-
| colspan="2" | Writes a string value to GATT Characteristic on a connected BLE device&nbsp;
| colspan="2" | Writes a string value to GATT Characteristic on a connected BLE device&nbsp;
Line 104: Line 100:
==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 113: Line 109:
| width="90%" | Filters
| width="90%" | Filters
|-
|-
| colspan="2" | Limits the list of available Bluetooth devices, for example:
| colspan="2" | Limits the list of available Bluetooth devices, for example:     filters: [ { services: [0x1802, 0x1803] } ]     filters: [ { name: "My Cool Device" } ]     filters: [ { namePrefix: "Mtx" } ]     filters: [ { services: ["heart_rate"] } ],     optionalServices: ["battery_service"] (leave blank for all devices) &nbsp;
* filters: [ { services: [0x1802, 0x1803] } ]
* filters: [ { name: "My Cool Device" } ]
* filters: [ { namePrefix: "Mtx" } ]
* filters: [ { services: ["heart_rate"] } ], optionalServices: ["battery_service"]
* (leave blank for all devices) &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-type-24-icon.png]]
| width="10%" align="center" | [[File:Fc9-type-24-icon.png]]

Latest revision as of 14:22, 13 July 2026

Author MatrixTSL
Version 0.1
Category Comms


Bluetooth component

Allows connection to a bluetooth device from the browser.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Macro reference

Disconnect

Disconnect
Disconnects from the remote BLE device 
- VOID Return


RequestDevice

RequestDevice
Attempts to connect with a Bluetooth BLE device. 
- STRING Return


WriteString

WriteString
Writes a string value to GATT Characteristic on a connected BLE device 
- STRING sText
 
- VOID Return


Property reference

Properties
Filters
Limits the list of available Bluetooth devices, for example: filters: [ { services: [0x1802, 0x1803] } ] filters: [ { name: "My Cool Device" } ] filters: [ { namePrefix: "Mtx" } ] filters: [ { services: ["heart_rate"] } ], optionalServices: ["battery_service"] (leave blank for all devices)  
OnDisconnect
Called when the Bluetooth device is disconnected 
OnValueChanged
Called when the Bluetooth characteristic value changes 
Service
The Primary Service of the Bluetooth GATT Server 
Characteristic
The Bluetooth GATT Characteristic 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_WEBEXP_Bluetooth.fcweb

Please click here to view the component source code (Beta): FC_Comp_Source_WEBEXP_Bluetooth.fcweb