Difference between revisions of "Component: Bluetooth (EB024, Generic AT) (Wireless)"
Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Bluetooth.fcfx FC_Comp_Source_Bluetooth.fcfx] |
− | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Bluetooth.fcfx FC_Comp_Source_Bluetooth.fcfx] |
==Detailed description== | ==Detailed description== | ||
Line 176: | Line 176: | ||
[[File:ConnectToMAC.jpg]] | [[File:ConnectToMAC.jpg]] | ||
+ | |||
+ | |||
Latest revision as of 13:08, 7 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
CreateCommand
CreateCommandString
Initialise
![]() |
Initialise |
Required to be used whenever the Bluetooth component is used in a program. Initialises the Bluetooth component ready for use. | |
![]() |
Return |
SendCommand
SendScript
Send_byte
![]() |
Send_byte |
![]() |
ByteVal |
![]() |
Return |
StringRead
StringReceive
![]() |
StringReceive |
Checks for a response string. Returns the length of the response string if one is present otherwise returns 0. | |
![]() |
Return |
WaitForResponse