Difference between revisions of "Component: Bluetooth (EB024, Generic AT) (Wireless)"
Line 176: | Line 176: | ||
[[File:ConnectToMAC.jpg]] | [[File:ConnectToMAC.jpg]] | ||
+ | |||
+ | |||
Line 181: | Line 183: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===StringRead=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 199: | Line 202: | ||
+ | ===SendScript=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 217: | Line 221: | ||
+ | ===SendCommand=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 240: | Line 245: | ||
+ | ===CreateCommandString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 258: | Line 264: | ||
+ | ===StringReceive=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 271: | Line 278: | ||
+ | ===CreateCommand=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 289: | Line 297: | ||
+ | ===Send_byte=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 307: | Line 316: | ||
+ | ===WaitForResponse=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 330: | Line 340: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:48, 3 February 2023
Author | Matrix Ltd. |
Version | 2.0 |
Category | Wireless |
Contents
Bluetooth (EB024, Generic AT) component
Low level routines for controlling a standard AT Bluetooth interface. Also available in the form of the EB024 Bluetooth E-block.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Bluetooth.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Bluetooth.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Making a device discoverable
Example program to set up the Bluetooth module to be discoverable with a pair key. Any data received is then output onto the LCD component. You can connect to the Bluetooth device using a PC with Bluetooth connection and using software such as Flowcode 6, RealTerm or HyperTerminal. Alternatively you can connect using a smart phone running a terminal emulator app or via another embedded Bluetooth board.
Bluetooth Discover
Script 1 contains the AT commands to setup the Bluetooth device to be discoverable with pair key "1234".
Searching for a device
Example program to scan for local discoverable Bluetooth devices. For each device found the MAC address is displayed on to the LCD.
Bluetooth Inquiry
Connecting to a device
Example program to connect to a specific Bluetooth device address and send data to the device.
Bluetooth Connect
The device MAC address is specified using the "CreateCommandString" and "SendCommand" macros.
Macro reference
StringRead
SendScript
SendCommand
CreateCommandString
StringReceive
![]() |
StringReceive |
Checks for a response string. Returns the length of the response string if one is present otherwise returns 0. | |
![]() |
Return |
CreateCommand
Send_byte
![]() |
Send_byte |
![]() |
ByteVal |
![]() |
Return |
WaitForResponse
Initialise
![]() |
Initialise |
Required to be used whenever the Bluetooth component is used in a program. Initialises the Bluetooth component ready for use. | |
![]() |
Return |