Difference between revisions of "Bot test"
(16 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
==Bluetooth (EB024, Generic AT) component== | ==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. | Low level routines for controlling a standard AT Bluetooth interface. Also available in the form of the EB024 Bluetooth E-block. | ||
+ | |||
+ | ==Detailed description== | ||
+ | |||
+ | ''No detailed description exists yet for this component'' | ||
==Examples== | ==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. | ||
+ | {{Fcfile|BluetoothDiscover.fcfx|Bluetooth Discover}} | ||
+ | Script 1 contains the AT commands to setup the Bluetooth device to be discoverable with pair key "1234". | ||
+ | |||
+ | [[File:DiscoverableScript.jpg]] | ||
+ | |||
+ | |||
+ | ===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. | ||
+ | {{Fcfile|BluetoothInquire.fcfx|Bluetooth Inquiry}} | ||
+ | ===Connecting to a device=== | ||
+ | Example program to connect to a specific Bluetooth device address and send data to the device. | ||
+ | {{Fcfile|BluetoothConnect.fcfx|Bluetooth Connect}} | ||
+ | The device MAC address is specified using the "CreateCommandString" and "SendCommand" macros. | ||
+ | [[File:ConnectToMAC.jpg]] | ||
Latest revision as of 13:33, 31 August 2021
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.
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.
Downloadable macro reference
![]() |
StringReceive |
Checks for a response string. Returns the length of the response string if one is present otherwise returns 0. | |
![]() |
Return |
![]() |
Send_byte |
![]() |
ByteVal |
![]() |
Return |
![]() |
Initialise |
Required to be used whenever the Bluetooth component is used in a program. Initialises the Bluetooth component ready for use. | |
![]() |
Return |