Detect when PDA (Windows Mobile) is in flight mode - vb.net

I need to produce an error display message when the Windows Mobile PDA is in flight mode. The user will need to pull and push data from a SQL Server server; however when in flight mode this is not doable and a message needs to be displayed. Currently the message that is displayed is:
a requeste to send information the the computer using IIS has failed.
For more results please see HRESULT
I am programming using VB.Net and I am fairly new to it. I have searched for the past week on the Internet and come across information suggesting that I use TAPI, however i do not know what to import, or where the "flight mode detection" code would go in my application.

Use the State and Notification Broker. Use the SystemState class to read and/or monitor the value of something like SystemProperty.PhoneRadioOff. Here's an example of using the SNB (in C#, but simple enough to convert).

Related

GSM Modem not able to receive SMS

i doing a simple application that able to integrate with GSM Modem to send and receive the SMS. i had completed the send SMS part, but i not able to receive the SMS. i get error message said that my SIM card memory is full when trying to send the SMS with other mobile device to my SIM card in the GSM Modem. i tried to use the AT command "AT+CMGL" to remove all the messages, but still same. May i know there are any method to store the message in my computer memory so that i able to receive the SMS with my GSM Modem. I using the sample code from here
http://www.codeproject.com/Articles/38705/Send-and-Read-SMS-through-a-GSM-Modem-using-AT-Com
The AT+CMGL command is for listing messages, not deleting them. Deleting messages is done with the AT+CMGD command. Do yourself a favour and download a copy of the 3GPP 27.005 standard, it defines all the standard sms AT commands (most other mobile phone AT commands are defined in 27.007), and by all means get a copy of the ITU standard V.250 which defines the basic command syntax, structure and behaviour for AT commands - an absolute must read for anyone that issues AT commands (read all of chapter 5 at least). These documents are more valuable than any random internet web site, including stackoverflow.
Speaking of random websites, the web page you linked as source seems to be of dubious value. It gives an example function DeleteMsg which issues AT+CMGF=1 but this command does in no way delete anything, it selects text or PDU mode for the various sms related commands.
It does have response handling that is better than the horrible send-sleep-read mistake that unfortunately is not as uncommon as it ought to be, but it is only half decent and not robust at all.
After sending an AT command to a modem you should continuously read and parse response lines from the modem (over and over again) until you receive a final result code (and not just once). See this answer for details.
All of the the message commands operate on the storage location set by AT+CPMS. And notice that you should always set <mem1> and <mem2> at the same time, e.g.
AT+CPMS="SM","SM"
It both makes little sense to only change one of mem1/mem2, and some phones do not like attempts to set only one of them.

WAN/GAN IM application in VB.net

Hi I have started a project which connects to a database and creates/logs in a user at the moment i have a LAN messenger that works very well, and a FTP chat which is not exactly what i was hoping for.
my idea now is to create two tables in the database message 1 and message 2 both of which display the user who is sending and the message sent. and the program uses threading to connect and download the messages.
My question is, is there a better way of completing this task (if so could you send a link or two this way? or express your opinion).
and or any problems you guys/girls think i would run into. Cheers :D
If you require to see some code just ask and i'll edit the post thanks
Although its easy on paper to do a chat application that uses a 'DB' as a backend/comms layer .. its not really the best approach. It will work... but with load, it may not be a very good approach.
Most chat clients uses a peer to peer connection, or even client server with the coding and implementation of a server that handles what happens with messages going/destined where ever.
If you really want to get low down and dirty, google for 'TCP chat application' examples. If you want to operate a bit higher (not handle the really gritty low down mechanics), then look for some 'wcf chat' examples.

Edit Incoming Packets On a Specific Port

I know there are various programs that sniff packets like WireShark, but I'm pretty sure you can only view the data. I want to know if it's possible to edit incoming packets. I'm not sure if packets are the right term. I just want to edit incoming data that is recieved through the internet and who's destination is a specific application. Let's say I am playing an online game. As it loads my computer, it is recieving information like "This person has 10 coins in their money pouch". Obviously not exactly like that but you get the point. I would like to be able to change the data so it is say 100 instead of 10. I know something like this would be possible if you were to do this: Imagine my computer is connected to the internet with an ethernet cord. There is a device attached to the ethernet cord which recieves the data and changes it and then lets it continue to my computer. I would just like to know if this is possible, and how it could be accomplished.
Thanks!
The way I do it, is one of 2 ways:
1.
If your application supports it set up a HTTP Proxy on your machine and you could software like burp / Fiddler to mess with the data
If not (the protocol is not HTTP) you could use either one of 2 options i'v tried [Both based on Hooking the API calls from the application to the OS]:
EchoMirage software that allow messing around with the packets
[Bit more advanced: ] There is a debugger named OllyDbg which has a plugin named Universal Hooker; it enables to hook any window API function and execute a python script on demend. the uHooker contains examples for how to hook WSASend and WSARecive (which are the API functions used in windows sockets).

WiFi communication to embedded display

I'm trying to create an embedded outdoor display of bus arrival times at my university. I'd like the device to utilize my school's secured WiFi network to show arrival time updates determined from a server script I have running.
I was hoping to get some advice on the high-level operation of this thing -- would it be better for the display board to poll a hosted database via the WiFi network or should I have a script try to communicate with the board directly over 802.11? (Push or Pull?)
I was planning to use a Wifly or WIZnet ethernet board in combination with a wireless access hub. Mostly inspired by this project: http://www.circuitcellar.com/Wiznet/winners/001166.html Would anyone recommend something else over one of the WIZnet boards? I saw SPI/UART options and thought these boards could work with an AVR platform.
And out of curiosity -- if you were to 'cold start' this device (ie, request a bus arrival time by pushing the display's on button) you might expect it to take 10-20 seconds to get assigned an IP and successfully connect to the database, does that sound right?
I'd go pull. In fact, I'd have outdoor display make http or https requests of the server. That way the server could tell it how long to show a given set of data before polling for a new one using standard http page expiration.
I think pull would make it easier to have multiple displays, and to test your server as well. I've also got a gut feeling that this would make your display more secure. Someone would have to hack your server to hijack your display.
There's a very cool looking Arduino-targetted product called the WiShield. Seems super easy to use and he provides some source code. It uses SPI for host communication. If you're not interested in going the Arduino route, I'm sure the source code wouldn't be too hard to port to something like avr-gcc. Check it out, might save you some time and headaches for $55. Worth checking out anyway.

How to Read SMS/MMS in UIQ

How to Read SMS/MMS in UIQ ?
I am going to assume that you want information about how to write some C++ source code that will allow an application to receive SMS/MMS and read the content of the messages it receives.
On Symbian OS, the message store can store SMS, MMS, EMAIL...
The API of the message store is generic.
In order to write and read data to/from the message store, you'll need to familiarise yourself with the following classes : TMsvId, CMsvSession, CClientMtmRegistry, TMsvEntry and CMsvEntry.
I am obviously biased but I would advise reading the messaging chapter of http://www.quickrecipesonsymbianos.com in order to get an explanation of how the messaging store works and the sample code to use it easily.
Receiving messages, on the other hand, is more complicated.
Listening for and receiving SMS is done using the generic networking API. That's RSocketServ and RSocket. Mostly, you need to use to the right IOCTL parameters on the socket.
You can specify a specific port in order to only receive SMS that are intended for your application. Trying to receive all SMS could be an issue as the native message viewer engine and the embedded Java virtual machine PushRegistry module could both be listening for all SMS already.
You will find useful classes and constants in the following header files in your SDK:
gsmuset.h smsuaddr.h smsustrm.h gsmubuf.h gsmumsg.h.
TSmsAddr, KSMSDatagramProtocol, KSMSAddrFamily, TSmsUserDataSettings, CSmsBufferBase, CSmsPDU, RSmsSocketReadStream, RSmsSocketWriteStream and CSmsMessage are of particular interest. Asynchronously receiving an SMS is actually done using RSocket.Ioctl().
There are SMS-specific error codes whose names start with "KSmsErr"
Receiving MMS on UIQ is done through a UQI-specific API. One that you won't find on Series60 phones. This is the reason why you won't find much talk of a Symbian-generic MMS API in the litterature. You are better off going directly to the UIQ or Sony-Ericsson development communities when you have more detailled questions.
Your application shouldn't have to use RSocket to receive MMS.
Careful, once again, both the Embedded Java virtual machine PushRegistry module and the native message viewer application engine are probably already listening for all incoming MMS messages.
The interesting header files are mmsclient.h, MmsSettingsStore.h, mmsentry.h, MmsApiExtensions.h
Of particular interest are CMmsClientMtm, MmsApiExtensions, MMsvSessionObserver and MMMSMessageHandler.
Good luck.