Difference between revisions of "Component: Bluetooth (EB024, Generic AT) (Wireless)"
| Line 15: | Line 15: | ||
| Low level routines for controlling a standard AT Bluetooth interface. Also available in the form of the EB024 Bluetooth E-block. | Low level routines for controlling a standard AT Bluetooth interface. Also available in the form of the EB024 Bluetooth E-block. | ||
| − | ==Component  | + | ==Component Source Code== | 
| − | + | Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_Bluetooth.fcfx FC_Comp_Source_Bluetooth.fcfx] | |
| ==Detailed description== | ==Detailed description== | ||
| + | |||
| + | |||
| Line 66: | Line 68: | ||
| ==Examples== | ==Examples== | ||
| + | |||
| + | |||
| Line 337: | Line 341: | ||
| | colspan="2" | Data to send for script 0, each command should be terminated with a carriage return  | | colspan="2" | Data to send for script 0, each command should be terminated with a carriage return  | ||
| |- | |- | ||
| − | | width="10%" align="center" style="background-color:# | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | 
| − | | width="90%" style="background-color:# | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections | 
| |- | |- | ||
| |- | |- | ||
| Line 371: | Line 375: | ||
| | colspan="2" |   | | colspan="2" |   | ||
| |- | |- | ||
| − | | width="10%" align="center" style="background-color:# | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | 
| − | | width="90%" style="background-color:# | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation | 
| |- | |- | ||
| |- | |- | ||
Revision as of 17:44, 9 November 2022
| 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 for the component source code: 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".
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
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.
Bluetooth Connect
The device MAC address is specified using the "CreateCommandString" and "SendCommand" macros.
Downloadable macro reference
|   | StringReceive | 
| Checks for a response string. Returns the length of the response string if one is present otherwise returns 0. | |
|  - BYTE | Return | 
|   | Send_byte | 
|  - BYTE | ByteVal | 
|  - VOID | Return | 
|   | Initialise | 
| Required to be used whenever the Bluetooth component is used in a program. Initialises the Bluetooth component ready for use. | |
|  - VOID | Return | 











