User's Manual Part 1

GSBT2416C2DB.xxx
rev. 1.0 18-Jun-07 11/13
MACRO INSTRUCTIONS
With the version 1.2.1.8 of OBSTFW -101 has been introduced the MACRO concept with the commands
AT+BTMACROSTART , AT+BTMACROSTOP and AT+MACROCLEAR.
These commands work in such a way that all the commands written between AT+BTMACROSTART and
AT+BTMACROSTOP commands will be stored inside the internal flash memory and executed at each power up of the
module.
Take note that when you insert a command between MACROSTART and MACROSTOP you have not the immediate
execution of the command but only the storing in the flash memory, the module will answer with OK or ERROR from a
syntax point of view.; execution will be active at the next power on.
That means, after the writing of the commands between the two macro commands, the module could work in a stand
alone way without the need to program it at each power on.
MACROCLEAR command will erase all the commands stored.
As an example: suppose to have always the previous modules with final address 01 (client) and 02 ( server) and to
know already which connection to get .
Write the following sequence of commands in client and server module , after the MACROSTOP command it will be
stored into the internal memory of the correspondent module .
Client Server
AT+BTMACROSTART AT+BTMACROSTART
AT+BTCMODE=0 AT+BTCMODE=1
AT+BTPMODE=1 AT+BTPMODE=1
AT+BTDMODE=0 AT+BTDMODE=1
AT+BTSECMODE=1 AT+BTSECMODE=1
AT+BTENCMODE=0 AT+BTENCMODE=0
AT+BTNAME=”SPP Client” AT+BTPINCODE=”1234”
AT+BTCLASS=52020C AT+BTNAME=”SPP Server”
AT+BTCONNECT=0080E1000002,1,”1234”,10,5 AT+BTCLASS=52020C
AT+BTMACROSTOP AT+BTREGPORT=”SPP port”
AT+BTMACROSTOP
Note that :
- As the address module to connect is know , the inquiry command can be omitted
- In BTCONNECT command has been set 10 retry at 5 sec interval.
After the modules have been programmed, you can power off and power on again the modules themselves; you will
see that at a certain point the modules will be connected each other ( led on) without any intervention .
Is not important to power on before the server or the client ; the only rule to follow is ,once the client has been powered
on, getting the server powered in the time fixed by the 10 retry at 5 sec interval.
During the macro execution the module will answer with “OK or “ERROR” for each command executed; if this
feedback is not wished ,it can be avoided with the AT+ECHO=OFF command.
MODULE BT ADDRESS
Each module has its own address which identify the module itself in the network; for the above examples have been
always taken in consideration addresses 0080E1000001 and 0080E1000002.
Modules on GS-BT2416C1AT1 board could have different addresses ; before to start sending commands, the module
address can be found with the command AT+BTSETTINGS=? which will show the relevant information of the
module including the BT address.