Configuring the Server Set he Bluetooth module to Command mode and execute the following commands in hyper terminal AT
Ok Ok Ok
//Test the UART communication channel to the Bluetooth module
AT+BTCMODE=1 //Module can be contacted by other Bluetooth devices AT+BTPMODE=1 AT+BTdmode=1
Ok
Ok Ok Ok ok // Accept paring request from remote device
//module can be discovered by other Bluetooth modules //requests authentication //Module dosent require encryption //Setting pin code to the local module //Setting name to the local module //Setting Bluetooth class ID
AT+BTSECMODE=1 AT+BTENCMODE=0
AT+BTPINMODE=1234 AT+BTNAME=spp server AT+BTCLASS=52020C
Ok Ok
AT+BTREGPORT=SPP PORT //Representing the name of the local SPP port
Change the Bluetooth module into Data mode, and connect it to 8051 microcontroller through DB9 pin Configuring the CLIENT AT
Ok
//Test the UART communication channel to the Bluetooth module
AT+BTCMODE=0 ok AT+BTPMODE=1
Ok
AT+BTdmode=0
Ok
Ok Ok ok
AT+BTSECMODE=1 AT+BTENCMODE=0
//requests authentication //Module dosent require encryption
AT+BTNAME=SPP CLIENT AT+BTCLASS=52020C
Ok
//Setting Bluetooth class ID
AT+BTINQ=10 //start an inquiry provedure for 10 sec +BTINQRES: 00800010AA02,SPP SERVER
ok
AT+BTRPORTS= 00800010AA02 +BTRPORT:SPP PORT,1
ok
AT+BTCONNECT=00800010AA02,1,1234,1,0
Ok
//BdAddress,PortNo,pin,NoRetry,TimeRetry
Change the Bluetooth module into Data mode, The modules are ready to transfer
ORG MAIN: MOV MOV MOV SETB
0000H TMOD,#20H TH1,#-3 SCON,#50H TR1
OVER: MOV DPTR,#MSG FN: CLR A MOVC A,@A+DPTR JZ OVER ACALL SENDCOM INC DPTR SJMP FN SENDCOM: MOV SBUF,A HERE: JNB TI,HERE CLR TI RET MSG: DBMESSAGE IS SENT BY BLUETOOTH,0 END