Help for serial communication.
-
Hello dear programmers, I am developing a project which require xml transfer from pc tp pda and vice versa over seial port. i have no idea how to do it.can any body send me sample code of serial communication between the two. i'll be very greatful to you. Regards Ahsan Ullah
-
Hello dear programmers, I am developing a project which require xml transfer from pc tp pda and vice versa over seial port. i have no idea how to do it.can any body send me sample code of serial communication between the two. i'll be very greatful to you. Regards Ahsan Ullah
RS232 Communication can be accomplished using System.IO.Ports.SerialPort (.NET 2). As to the actual transferring of the file you'll need to be more specific as to the requirements / protocols involved. If you're writing your own protocols then it is very simple, if you're using standard protocols then it is simple also (depending on the complexity of the protocol). Most important question, do you have control over the PDA side or is that already built-in?
You know you're a Land Rover owner when the best route from point A to point B is through the mud. Ed
-
RS232 Communication can be accomplished using System.IO.Ports.SerialPort (.NET 2). As to the actual transferring of the file you'll need to be more specific as to the requirements / protocols involved. If you're writing your own protocols then it is very simple, if you're using standard protocols then it is simple also (depending on the complexity of the protocol). Most important question, do you have control over the PDA side or is that already built-in?
You know you're a Land Rover owner when the best route from point A to point B is through the mud. Ed
I know about the ports namespace you have mentioned.I have the control over thePDA side as well.Because i am writing the application for that side as well.I have no idea about which protocol to use.Can you kindly send me just a simple code so that i might be able to work on it. Thanks a lot for your reply. Ahsan Ullah
-
I know about the ports namespace you have mentioned.I have the control over thePDA side as well.Because i am writing the application for that side as well.I have no idea about which protocol to use.Can you kindly send me just a simple code so that i might be able to work on it. Thanks a lot for your reply. Ahsan Ullah
-
I know about the ports namespace you have mentioned.I have the control over thePDA side as well.Because i am writing the application for that side as well.I have no idea about which protocol to use.Can you kindly send me just a simple code so that i might be able to work on it. Thanks a lot for your reply. Ahsan Ullah
Ahsan-AhsanS wrote:
I have no idea about which protocol to use.Can you kindly send me just a simple code so that i might be able to work on it.
Regarding the protocol it doesn't really matter since you control both sides you can do what you want. It all depends on what your requirements are, e.g. if you're just sending a file then all you could potentially do is open the port, send a query string, e.g. "OK?", if the PDA returns "OK" back then simply send the entire file with a checksum at the end. If the checksum matches all well and good, if not then resend. That would be the simplest solution (although I suggest sending it in blocks of say 0x100 bytes and checksum each of these blocks so you don't have to resend the whole file. If the serial port is being used for other stuff as well then you'd have to make it a bit more complicatated, (e.g. replace the "OK?" with "SendFile?", if it can be sent then it responds with an Ack ("OK") and you perform the previous steps). As for the simple code, I'm sorry I don't have time, I have my first (final) A-Level module tomorrow.
You know you're a Land Rover owner when the best route from point A to point B is through the mud. Ed