Solved

Read Messages From 6210 Nokia Mobile

Posted on 2004-08-14
1
299 Views
Last Modified: 2010-04-05
Hi,

I want to read messages from my mobile and do some calculation on this messages, then save it on my PC.

Note: I used for this connection (Nokia PC Suite 4).
0
Comment
Question by:Mugahied
1 Comment
 
LVL 10

Accepted Solution

by:
_Katka_ earned 250 total points
ID: 11803469
Hi,

1) download this component: http://17slon.com/gp/gp/twircommsocket.htm
2) install it to Delphi as package
3) add the TWIrCommSocket component to your project
4) modify your code like this:

uses WSocket,WIrCOMMSocket;

var
  DeviceList: TIrdaDevicesInfo; // global list of IR enabled devices (e.g. your cell phone)
  RecievedText: AnsiString; // string holder for all recieved data

procedure TForm1.Button1Click(Sender:TObject); // where connection to IR enabled device is done
var
  I:Integer;
begin
   IRConnect1.Close; // as a prevention close possible connection to device
   FreeAndNil(DeviceList); // clears list of devices
   DeviceList := IRConnect1.GetConnectedDevices; // list of all IR enabled devices (in your case Nokia 6210)
   IRConnect1.DeviceID := DeviceList[0].irdaDeviceID; // in case you'll have just one cell phone in range
   IRConnect1.Connect;
end;
   
procedure TForm1.Button2Click(Sender:TObject); // where SMS messages are listed
begin
   IRConnect1.SendStr('AT+CMGL'#13#10); // list of SMSs
// alternatively you can use
   IRConnect1.SendStr('AT+CMGR=?'#13#10); // determine count of SMSs
   IRConnect1.SendStr('AT+CMGR=0'#13#10); // reads first SMS
end;

procedure TForm1.IRConnect1DataAvailable(Sender: TObject;  Error: Word); // (this is IRConnect1 event) where results of previously sended commands are caught
begin
  RecievedText := RecievedText + IRConnect1.RecieveStr;
// alternatively you can use TMemo to view the messages
  Memo1.Text := RecievedText;
end;

Legend:

Form1 = your form name
Memo1 = your memo name for cell phone output
Button1 = your button name for connection attempt
Button2 = your button name for retrieving SMS
IRConnect1 = your TWIrCommSocket name

because all recieved data are in textual format, you'll have to recognize them from RecievedText variable,
but that's not that hard. Just look in Memo1 and you'll know what's going on.

regards,
Kate
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 68
Delphi IDE crash without error message ... 7 99
Base1 Encode/Decode 3 81
Slow Restore if incremental backups using RDiff.exe 4 29
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question