Bluetooth is an easy way of transferring data and this wireless interface fully supports serial connection. This capability gives us the usage of bluetooth communcation for serial connection to a modem device. Modem devices can be controller via serial connection and they use AT Commands to be configured.
Mobile phones have their own modem chips on their motherboards. Also most of them is controllable via serial connection. This serial connection may be possible via usb cable emulating a serial connection or a bluetooth connection. Again it is controllable via AT Commands.

Most of smartphones’ modems are controllable via bluetooth. The easiest to control is Nokia Mobile Phones. They are perfectly capable of controllable via bluetooth.

First of all the first thing you need to do is, connect your mobile phone to your computer via bluetooth. See bluetooth serial connection service is active. After that, note that port number in device manager, then connect to that port via HyperTerminal or Putty Client. Send to your modem “AT” command, and see that “OK” response is came. If you see the OK it is OK and you can go on reading.

The screenshot above is my application that I’ve written to control my Nokia N97 Mobile Phone. But after I sold and buy an iPhone 4, it became a dream to control it via AT Commands.

Alghorithm is very easy at all.

There is a textbox at right and top. It contains the tel number to call. When you click the num pad buttons, its text property is being changed by numpad values and appends new numbers. (like textBox1.text+=”1″;)

When you click the “YES” button, begin call process command is sent to modem. (call the number written in textbox1)

serialPort1.Write(“ATD” + textBox1.Text + “;”  + Convert.ToChar(013));

When you click the “NO” button, hangup command is sent to modem. (AT+CHUP)

this.serialPort1.Write(“AT+CHUP” + Convert.ToChar(013));

“Clear” button just clear the text in written in textbox. (textBox1.text=””;)

To Answer a call is just a bit complicated. Because before you sent a answer command to modem, you have to check id there is an incoming call to answer or not. The way to do that is listen the modem periodically and wait for “RING +CLIP:TelNum”. This is the information that there is an incoming call and its caller id is TelNum. So When we see that information we can display that there is an incoming call on screen, and when “YES” button is clicked, we should send answer command to modem.

You can use standard microsoft’s bluetooth driver. You need to enable bluetooth serial port service.

3 commands that used in my code are;

  • ATD0telNum; It starts a voice call to a number “telNum”.
  • ATH+CHUP It ends the active call, all ignore the incoming call when it used.
  • ATA if you apply it when there is an incoming call, it answers the call.

There are lots of commands but most of them is not used at the moments. You can see the full command range for Nokia models. You can check it with the link below.

http://www.developer.nokia.com/Community/Wiki/AT_Commands