Solved

Read Messages From 6210 Nokia Mobile

Posted on 2004-08-14
1
296 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now