Difference between revisions of "Component: Bluetooth v2 (EB024, Generic AT) (Wireless)"
Line 22: | Line 22: | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 46: | Line 48: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 90: | Line 94: | ||
==Macro reference== | ==Macro reference== | ||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPairKey''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the 4 digit Bluetooth pair key based on a string of numbers. e.g. "1234" Returns 0 to indicate success | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | PairKey | ||
+ | |- | ||
+ | | colspan="2" | Key to use as the Pair key, e.g. "1234" or "0000" | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveByte''' | ||
+ | |- | ||
+ | | colspan="2" | Receives a single data byte from the Bluetooth module. 0xFF signifies no data available. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Amount of time to wait in milliseconds 0=Wait forever | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendString''' | ||
+ | |- | ||
+ | | colspan="2" | Sends a string to the Bluetooth module. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | Command | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | SendCR | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendScript''' | ||
+ | |- | ||
+ | | colspan="2" | Send an AT command script. Returns 0 for fail, 1 for success and 255 for unrecognised script idx. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | idx | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendCommand''' | ||
+ | |- | ||
+ | | colspan="2" | Sends a command string to the Bluetooth module. 0 = Command sent ok, 255 = No Reply | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | Command | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | SendCR | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DiscardReply | ||
+ | |- | ||
+ | | colspan="2" | 0=Do not touch the reply, 1=Wait for reply and remove from buffer | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadString''' | ||
+ | |- | ||
+ | | colspan="2" | Copies the incoming data from the data string array to a local string variable. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | NumBytes | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SaveSettings''' | ||
+ | |- | ||
+ | | colspan="2" | Saves the current settings to firmware using the AT&W command followed by the ATZ command. Returns 0 to indicate success | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendByte''' | ||
+ | |- | ||
+ | | colspan="2" | Sends a single data byte out to the Bluetooth module. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMode''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the bluetooth mode to be discoverable and or connectable. Returns 0 for success. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Discoverable | ||
+ | |- | ||
+ | | colspan="2" | 0 = Not Discoverable, 1 = Discoverable | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Connectable | ||
+ | |- | ||
+ | | colspan="2" | 0 = Not Connectable, 1 = Connectable | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RestoreFactorySettings''' | ||
+ | |- | ||
+ | | colspan="2" | Restores the factory settings to firmware using the AT&F* command. Returns 0 to indicate success | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | ||
+ | |- | ||
+ | | colspan="2" | Sets up the Bluetooth module. Returns 0 for OK, 255 for no reply and 254 for command fail. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Property reference== | ||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Bluetooth Settings | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
+ | | width="90%" | String Array Size | ||
+ | |- | ||
+ | | colspan="2" | Amount of RAM memory to dedicate to receiving responses from the BT module. Default 40 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Expect Echo | ||
+ | |- | ||
+ | | colspan="2" | Sets if we expect an echo of any data we send out to the GSM modem. Most AT type modems (e.g. GSM modules) will automatically echo back incoming data. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
+ | | width="90%" | Device Name | ||
+ | |- | ||
+ | | colspan="2" | Sets the friendly name of the Bluetooth device. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
+ | | width="90%" | Pair Key | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Restore Defaults | ||
+ | |- | ||
+ | | colspan="2" | Is the Bluetooth module reset to factory settings at startup? | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Discoverable | ||
+ | |- | ||
+ | | colspan="2" | Is the Bluetooth module discoverable by default? | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Connectable | ||
+ | |- | ||
+ | | colspan="2" | Is the Bluetooth module connectable by default? | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Script Count | ||
+ | |- | ||
+ | | colspan="2" | Maximum number of scripts to store in the device's ROM | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-11-icon.png]] | ||
+ | | width="90%" | Script1 | ||
+ | |- | ||
+ | | colspan="2" | ASCII based AT command data stored in ROM and used when sending script 1 | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Baud Options | ||
+ | |- | ||
+ | | colspan="2" | Baud rate option selector | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
+ | | width="90%" | Baud Rate | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | TX | ||
+ | |- | ||
+ | | colspan="2" | Pin to be used for Transmit data | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | RX | ||
+ | |- | ||
+ | | colspan="2" | Pin to be used for Receive data | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Use Flow Control | ||
+ | |- | ||
+ | | colspan="2" | Flow Control (Handshake) enable or disable. On: Two I/O pins are used to control the flow of data in and out of the device. Off: Flow control is disabled. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | Reset Pin | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
+ | | width="90%" | Label | ||
+ | |- | ||
+ | | colspan="2" | Textual label shown on the component I/O flasher | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Scope Traces | ||
+ | |- | ||
+ | | colspan="2" | Selects if the scope traces are automatically added to the data recorder window or not. Simulation - draws an approximation of the UART data onto the scope trace. ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Console Data | ||
+ | |- | ||
+ | | colspan="2" | Selects if the console data is automatically generated or not | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Console Columns | ||
+ | |- | ||
+ | | colspan="2" | Number of characters that can be displayed on a single line of the console. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Data Source | ||
+ | |- | ||
+ | | colspan="2" | Simulation data source used to allow the component to connect to various remote devices Nothing - Simulation data is ignored COM port - Routes the communication data to and from a physical or virtual COM port Injector - Routes the communication data via a data injector component on the Panel. | ||
+ | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
Revision as of 09:55, 27 January 2023
Author | Matrix Ltd. |
Version | 2.1 |
Category | Wireless |
Contents
Bluetooth v2 (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. Uses an interrupt to receive characters from the UART and improve reliability, Must be used with a hardware channel.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Bluetooth_V2.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Bluetooth_V2.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
SetPairKey | |
Sets the 4 digit Bluetooth pair key based on a string of numbers. e.g. "1234" Returns 0 to indicate success | |
- STRING | PairKey |
Key to use as the Pair key, e.g. "1234" or "0000" | |
- BYTE | Return |
ReceiveByte | |
Receives a single data byte from the Bluetooth module. 0xFF signifies no data available. | |
- BYTE | Timeout |
Amount of time to wait in milliseconds 0=Wait forever | |
- BYTE | Return |
SendString | |
Sends a string to the Bluetooth module. | |
- STRING | Command |
- BYTE | SendCR |
- VOID | Return |
SendScript | |
Send an AT command script. Returns 0 for fail, 1 for success and 255 for unrecognised script idx. | |
- BYTE | idx |
- BYTE | Return |
ReadString | |
Copies the incoming data from the data string array to a local string variable. | |
- BYTE | NumBytes |
- STRING | Return |
SaveSettings | |
Saves the current settings to firmware using the AT&W command followed by the ATZ command. Returns 0 to indicate success | |
- BYTE | Return |
SendByte | |
Sends a single data byte out to the Bluetooth module. | |
- BYTE | Data |
- VOID | Return |
RestoreFactorySettings | |
Restores the factory settings to firmware using the AT&F* command. Returns 0 to indicate success | |
- BYTE | Return |
Initialise | |
Sets up the Bluetooth module. Returns 0 for OK, 255 for no reply and 254 for command fail. | |
- BYTE | Return |
Property reference
==Macro reference==
SetPairKey | |
Sets the 4 digit Bluetooth pair key based on a string of numbers. e.g. "1234" Returns 0 to indicate success | |
- STRING | PairKey |
Key to use as the Pair key, e.g. "1234" or "0000" | |
- BYTE | Return |
ReceiveByte | |
Receives a single data byte from the Bluetooth module. 0xFF signifies no data available. | |
- BYTE | Timeout |
Amount of time to wait in milliseconds 0=Wait forever | |
- BYTE | Return |
SendString | |
Sends a string to the Bluetooth module. | |
- STRING | Command |
- BYTE | SendCR |
- VOID | Return |
SendScript | |
Send an AT command script. Returns 0 for fail, 1 for success and 255 for unrecognised script idx. | |
- BYTE | idx |
- BYTE | Return |
ReadString | |
Copies the incoming data from the data string array to a local string variable. | |
- BYTE | NumBytes |
- STRING | Return |
SaveSettings | |
Saves the current settings to firmware using the AT&W command followed by the ATZ command. Returns 0 to indicate success | |
- BYTE | Return |
SendByte | |
Sends a single data byte out to the Bluetooth module. | |
- BYTE | Data |
- VOID | Return |
RestoreFactorySettings | |
Restores the factory settings to firmware using the AT&F* command. Returns 0 to indicate success | |
- BYTE | Return |
Initialise | |
Sets up the Bluetooth module. Returns 0 for OK, 255 for no reply and 254 for command fail. | |
- BYTE | Return |
Property reference
==Macro reference==
SetPairKey | |
Sets the 4 digit Bluetooth pair key based on a string of numbers. e.g. "1234" Returns 0 to indicate success | |
- STRING | PairKey |
Key to use as the Pair key, e.g. "1234" or "0000" | |
- BYTE | Return |
ReceiveByte | |
Receives a single data byte from the Bluetooth module. 0xFF signifies no data available. | |
- BYTE | Timeout |
Amount of time to wait in milliseconds 0=Wait forever | |
- BYTE | Return |
SendString | |
Sends a string to the Bluetooth module. | |
- STRING | Command |
- BYTE | SendCR |
- VOID | Return |
SendScript | |
Send an AT command script. Returns 0 for fail, 1 for success and 255 for unrecognised script idx. | |
- BYTE | idx |
- BYTE | Return |
ReadString | |
Copies the incoming data from the data string array to a local string variable. | |
- BYTE | NumBytes |
- STRING | Return |
SaveSettings | |
Saves the current settings to firmware using the AT&W command followed by the ATZ command. Returns 0 to indicate success | |
- BYTE | Return |
SendByte | |
Sends a single data byte out to the Bluetooth module. | |
- BYTE | Data |
- VOID | Return |
RestoreFactorySettings | |
Restores the factory settings to firmware using the AT&F* command. Returns 0 to indicate success | |
- BYTE | Return |
Initialise | |
Sets up the Bluetooth module. Returns 0 for OK, 255 for no reply and 254 for command fail. | |
- BYTE | Return |
Property reference
==Macro reference==
SetPairKey | |
Sets the 4 digit Bluetooth pair key based on a string of numbers. e.g. "1234" Returns 0 to indicate success | |
- STRING | PairKey |
Key to use as the Pair key, e.g. "1234" or "0000" | |
- BYTE | Return |
ReceiveByte | |
Receives a single data byte from the Bluetooth module. 0xFF signifies no data available. | |
- BYTE | Timeout |
Amount of time to wait in milliseconds 0=Wait forever | |
- BYTE | Return |
SendString | |
Sends a string to the Bluetooth module. | |
- STRING | Command |
- BYTE | SendCR |
- VOID | Return |
SendScript | |
Send an AT command script. Returns 0 for fail, 1 for success and 255 for unrecognised script idx. | |
- BYTE | idx |
- BYTE | Return |
ReadString | |
Copies the incoming data from the data string array to a local string variable. | |
- BYTE | NumBytes |
- STRING | Return |
SaveSettings | |
Saves the current settings to firmware using the AT&W command followed by the ATZ command. Returns 0 to indicate success | |
- BYTE | Return |
SendByte | |
Sends a single data byte out to the Bluetooth module. | |
- BYTE | Data |
- VOID | Return |
RestoreFactorySettings | |
Restores the factory settings to firmware using the AT&F* command. Returns 0 to indicate success | |
- BYTE | Return |
Initialise | |
Sets up the Bluetooth module. Returns 0 for OK, 255 for no reply and 254 for command fail. | |
- BYTE | Return |
Property reference
==Macro reference==
SetPairKey | |
Sets the 4 digit Bluetooth pair key based on a string of numbers. e.g. "1234" Returns 0 to indicate success | |
- STRING | PairKey |
Key to use as the Pair key, e.g. "1234" or "0000" | |
- BYTE | Return |
ReceiveByte | |
Receives a single data byte from the Bluetooth module. 0xFF signifies no data available. | |
- BYTE | Timeout |
Amount of time to wait in milliseconds 0=Wait forever | |
- BYTE | Return |
SendString | |
Sends a string to the Bluetooth module. | |
- STRING | Command |
- BYTE | SendCR |
- VOID | Return |
SendScript | |
Send an AT command script. Returns 0 for fail, 1 for success and 255 for unrecognised script idx. | |
- BYTE | idx |
- BYTE | Return |
ReadString | |
Copies the incoming data from the data string array to a local string variable. | |
- BYTE | NumBytes |
- STRING | Return |
SaveSettings | |
Saves the current settings to firmware using the AT&W command followed by the ATZ command. Returns 0 to indicate success | |
- BYTE | Return |
SendByte | |
Sends a single data byte out to the Bluetooth module. | |
- BYTE | Data |
- VOID | Return |
RestoreFactorySettings | |
Restores the factory settings to firmware using the AT&F* command. Returns 0 to indicate success | |
- BYTE | Return |
Initialise | |
Sets up the Bluetooth module. Returns 0 for OK, 255 for no reply and 254 for command fail. | |
- BYTE | Return |