I have attached a HUAWEI Gprs Modem to my computer. I want to receive sms messages sent to this device via my delphi application.
I have no ideea how can i do this can somebody point me to the right direction
Use a ComPort or a similar library to connect to the modem, then use these extended Hayes commands:
To enter a PIN code:
AT+CPIN=<pin_code>
To use text mode instead of PDU
AT+CMGF=1
To start receiving SMS's in live without polling and saving to SIM card:
AT+CNMI=1,2,0,1,1
To send an SMS:
AT+CMGS="<recipient>"
Message body.<char #27>
This is probably enough to get you started, if you want more features you should really learn the PDU syntax, it is mighty powerful.
You can also refer to a simple SMS gateway that I wrote a couple of years ago: SmsManager.pas
I wrote a full blown commercial sms gateway 10 years ago now. So I think I can help you :)
You need to get familiar with the PDU encoding of the sms messages as this will give you the most flexibility. To better understand the PDU encoding I suggest you go visit this site. It is also very useful to read the about the AT command set that your modem supports, start with the modem manual. Most commands are universal though and are supported by all modem brands.
Here are some commands to get you started:
AT+CMGS : to send an sms
AT+CMGR : to read an sms
AT+CMGD : to delete an sms from the mobile
If you want information how to communicate with the modem, decode/encode messages, convert character sets, etc., I suggest to check out the source code from the (kannel sms gateway). (hint: search for file smsc_at.c under folder gw\smsc). The code is written in c but it shouldn't be too hard to understand (a bit of C knowledge is welcome though).