Component: Bluetooth v2 (EB024, Generic AT) (Wireless)

From Flowcode Help
Revision as of 17:59, 18 March 2016 by BenR (talk | contribs) (XML import)
Jump to navigationJump to search


Author Matrix Ltd.
Version 1.4 (Release)
Category Wireless


Image 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.

Examples

No additional examples


Downloadable macro reference

SetPairKey

Sets the 4 digit Bluetooth pair key based on a string of numbers.

e.g. "1234"

Returns 0 to indicate success

Parameters

<- STRING PairKey
Key to use as the Pair key, e.g. "1234" or "0000"
This parameter may be returned back to the caller


Return value

BYTE


ReceiveByte

Receives a single data byte from the Bluetooth module.

0xFF signifies no data available.

Parameters

BYTE Timeout
Amount of time to wait in milliseconds 0=Wait forever


Return value

BYTE


SendScript

Send an AT command script.

Returns 0 for fail, 1 for success and 255 for unrecognised script idx.

Parameters

BYTE idx


Return value

BYTE


SendCommand

Sends a command string to the GSM module.

0 = Command sent ok, 255 = No Reply

Parameters

<- STRING Command
This parameter may be returned back to the caller
BYTE SendCR


Return value

BYTE


ReadString

Copies the incoming data from the data string array to a local string variable.

Parameters

BYTE NumBytes


Return value

STRING


SaveSettings

Saves the current settings to firmware using the AT&W command followed by the ATZ command.

Returns 0 to indicate success

Parameters

This macro has no parameters


Return value

BYTE


SendByte

Sends a single data byte out to the Bluetooth module.

Parameters

BYTE Data


Return value

This call does not return a value


SetMode

Sets the bluetooth mode to be discoverable and or connectable.

Returns 0 for success.

Parameters

BYTE Discoverable
0 = Not Discoverable, 1 = Discoverable
BYTE Connectable
0 = Not Connectable, 1 = Connectable


Return value

BYTE


RestoreFactorySettings

Restores the factory settings to firmware using the AT&F* command.

Returns 0 to indicate success

Parameters

This macro has no parameters


Return value

BYTE


Initialise

Sets up the GSM module.

Returns 0 for OK, 255 for no reply and 254 for command fail.

Parameters

This macro has no parameters


Return value

BYTE


Simulation macro reference

This component does not contain any simulation macros


Property reference

Device Name

This property is of type Line of text and can be referenced with the variable name DeviceName.

Sets the friendly name of the Bluetooth device.

Pair Key

This property is of type Line of text and can be referenced with the variable name PairKey.

No additional information


Restore Defaults

This property is of type True or false and can be referenced with the variable name InitDefs.

Is the Bluetooth module reset to factory settings at startup?

Discoverable

This property is of type True or false and can be referenced with the variable name InitDisc.

Is the Bluetooth module discoverable by default?

Connectable

This property is of type True or false and can be referenced with the variable name InitConn.

Is the Bluetooth module connectable by default?

Script Count

This property is of type Fixed list of ints and can be referenced with the variable name script_count.

Maximum number of scripts to store in the device's ROM

Script1

This property is of type Multiple lines of text and can be referenced with the variable name script1.

ASCII based AT command data stored in ROM and used when sending script 1

String Array Size

This property is of type Signed integer and can be referenced with the variable name string_size.

Amount of RAM memory to dedicate to receiving responses from the BT module.

Default 40

Baud Rate

This property is of type Fixed list of ints and can be referenced with the variable name baud.

Theoretical number of digital bits that can be send or received a second.

Theoretical because it is unlikely you will be constantly sending or receiving data 100% of the time.

Flow Control

This property is of type True or false and can be referenced with the variable name flow_control.

When enabled adds two extra pins to help control the flow of data between the device and the remote device.

Expect Echo

This property is of type True or false and can be referenced with the variable name expect_echo.

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.

Channel

This property is of type Fixed list of ints and can be referenced with the variable name channel.

Onboard UART peripheral to use to perform serial commands.

Software mode not available as code currently requires hardware receive interrupt in order to work correctly.

TX Pin

This property is of type Single digital pin and can be referenced with the variable name tx_pin.

UART Transmit Pin

RX Pin

This property is of type Single digital pin and can be referenced with the variable name rx_pin.

UART Receive Pin

RTS Pin

This property is of type Single digital pin and can be referenced with the variable name rts_pin.

Request To Send Flow Control Pin

CTS Pin

This property is of type Single digital pin and can be referenced with the variable name cts_pin.

Clear To Send Flow Control Pin

Reset Pin

This property is of type Single digital pin and can be referenced with the variable name Reset.

No additional information


Label

This property is of type Line of text and can be referenced with the variable name label.

Textual label shown on the component I/O flasher

Injector

This property is of type Fixed list of ints and can be referenced with the variable name Injector.

No additional information