|
 |
C# 2005 For discussion of Visual C# 2005. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|

March 8th, 2006, 06:50 AM
|
Authorized User
|
|
Join Date: Mar 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Tried it out ..still no luck ..can you send me your sample code pls ...my email id is rsrika@gmail.com
|

March 8th, 2006, 09:46 AM
|
Authorized User
|
|
Join Date: Mar 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I was able to get it working ....
How do i handle the AT Commands for international SMS ..say for example ..my mobile no is 9840705667..how would i add my country code before it ..say ...+919840705667...where "91" is the country code for india ....
|

March 8th, 2006, 08:46 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
Well done, I dont know about international, best to just try some trial and error
======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
|

March 9th, 2006, 01:36 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
Out of interest, what was wrong with your code.
======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
|

March 14th, 2006, 05:42 AM
|
Authorized User
|
|
Join Date: Mar 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I had to add the security permissions...
|

March 14th, 2006, 05:48 AM
|
Authorized User
|
|
Join Date: Mar 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
is there any way i can read the responses of the AT Commands.
|

March 14th, 2006, 06:14 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
You have to wire the event for it.
Code:
serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_DataReceived);
And then extract the data from the event by string manipulation.
This is my code to estract SMSInbox info, you may beed to tweek it for your needs.
No garentees as I just cut this straight out the page, but I sure you can get going from here
Code:
void serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
string line;
int i = 0;
SerialPort pt = (SerialPort)sender;
line = pt.ReadExisting();
//Extract the new message ID's from the returned data string.
////+CMGL: 290, "REC READ", "+614030****"
////TESTING 1,2,3
while (line.IndexOf("+CMGL:", i) > 0)
{
BubbleMessageEvent("New Message received", EventLogEntryType.Information);
//Get the line starting with +CMGL
int startIndex = line.IndexOf("+CMGL:", i);
//Find the next +GMGL after the last one
int endIndex = line.IndexOf("+CMGL:", startIndex + 1);
//if there isn't another +CMGL, then the end of the line is the end of the info
if (endIndex <= 0) { endIndex = line.Length; }
//The current message is from the first +CMGL to the next or eof
string msg = line.Substring(startIndex, endIndex - startIndex);
//Find the phone number componenet of the message
string [] msgComponents = msg.Split(',');
string msgNumber = msgComponents[2];
int endNumIndex = msgNumber.IndexOf("\r\n");
if (endNumIndex <= 0) { endNumIndex = msgNumber.Length; }
msgNumber = msgNumber.Substring(0,endNumIndex + 1);
//Find the message componenet of the sms receive notification
//The message part starts after a new line
int startMsgIndex = msg.IndexOf("\r\n");
//The end of the message is before the next new line
int endMsgIndex = msg.IndexOf("\r\n", startMsgIndex + 1);
//if there is not a new line then the end of the message is the end of the text
if (endMsgIndex <= 0) { endMsgIndex = msg.Length; }
string msgText = msg.Substring(startMsgIndex, endMsgIndex - startMsgIndex);
ProcessNewMessage(msgText, msgNumber);
i = startIndex + 1;
}
}
Good Luck
======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
|

March 14th, 2006, 06:26 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
All responses will come through this event.
======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
|

June 8th, 2006, 05:22 AM
|
Registered User
|
|
Join Date: Apr 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
My mobile cam only send SMS in PDU format, at+cgmf=0, how I can convert textbox with number and message to PDU ??
Thanks !
|

June 8th, 2006, 09:21 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
Hi Atila,
I have not had any experience with PDU unfortunately.
As this thread is getting quite long you may be better off starting this question as a new thread.
Good Luck,
Rod
======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |