Go Down

Topic: ArduinoNG + Bluegiga eval board + Mobile Phone (Read 312 times) previous topic - next topic

xa4

Greetings !

I have connected my Arduino board to the bluegiga evaluation board (which holds the same bluetooth component as the ArduinoBT) through a serial connection in order to connect to my mobile phone and light up a led whenever somebody is calling me...

So.. I have managed to send messages to the phone, read the answer and test it. But I can't read/detect the "RING" message that my mobile phone is sending to the arduino board when it receives a phone call.

Here is the source code of my application, maybe someone who did the same kind of experiments can help me ?!

Thank you very much in advance,
xavier

Code: [Select]

char serInString[10];
bool connected = false;
bool phoneConnected = false;

void readSerialString (char *strArray) {
   int i = 0;
   if(Serial.available()) {    
      while (serialAvailable()){            
         strArray[i] = Serial.read();
         i++;
      }
   }      
}

void setup() {
 Serial.begin(9600);
 Serial.println();
 Serial.println("AT");
}

void loop () {
 readSerialString(serInString);
 
 if (!connected && serInString[0] == 79 && serInString[1] == 75){  //answer = OK? (O=79, K=75)
   connected = true;
 }
 
 if (connected && !phoneConnected){
   Serial.println("CALL 00:19:63:1e:0a:01 1103 RFCOMM");
   phoneConnected = true;
 }
 
 if (connected && phoneConnected){
   readSerialString(serInString);
   if (serInString[0] == 82) digitalWrite(13,HIGH); //check if phone is ringing ?
 }
 
 delay(2000);
}


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy