-1

first of all thanks alot for the big help you have been in my past. I looked for alot of problems since i began android programming, but now I have a problem, i cannot find an answer.

I wrote a little program where are a number of CountDownTimers, which are correctable(adding or subtracting seconds and minutes), they can be paused and resetted to a time i setted in SharedPreferences.

Now my boss want to expand this.

he wants this app to connect via W-Lan (intranet, not internet), to a wlan-to-rs232 converter, to set states like "pause" and "end" to a machine, which displays the time.

Now my Problem:

I do not even know how to begin with that ^_^

I dont know, how to connect to the converter,

I dont know, how to send the needed bits/datas/whatevers to the converter,

I, if i can manage it to connect to the converter anytime, dont know how to tell the converter which commands/bits/whatevers he has to send to the machine.

Second:

the machine also send bits to the converter, which has to be received by my app, same thing as above, but inverted.

Maybe someone is here who can help me?

Just a little introduction to this will be helpful, i got the beginnings of programming by "Try-and-Error", but to do that, i need a point where i can begin.

Thanks alot

Mina

Minako Aino
  • 60
  • 2
  • 7

1 Answers1

1

Nobody can really help you with this, as you didn't mention which RS-232 host you have. There is no standard... they all work a bit differently.

That being said, most of them will send/receive data over a regular TCP connection.

  1. Configure your converter with an IP address.
  2. Connect it to whatever RS-232 device you are using.
  3. Make a TCP connection to your converter via its configured IP address and port.
  4. Send/receive data over this TCP connection as if you were sending/receiving over RS-232.

Other converters implement their own protocol to facilitate emulating the port status lines, such as carrier detect and clear-to-send. For those, you will have to read the protocol documentation provided by the manufacturer.

Brad
  • 159,648
  • 54
  • 349
  • 530
  • Yes, and additionally beware of potentially long interaction delays compared to direct serial communication. – Chris Stratton Dec 05 '12 at 16:20
  • okay, so i can do this only by knowing how my rs232 works... but one problem is still left.. i dont know, how to connect android via wlan to another device (PC, converter, or sth else) @Chris thx, i will ^^ – Minako Aino Dec 05 '12 at 16:24
  • http://www.roman10.net/android-tcp-client-and-server-communication-programmingillustrated-with-example/ – Brad Dec 05 '12 at 16:43
  • For all those, who have problems with programming a server-client thing... https://www.youtube.com/watch?v=XlryaovT_3k this helped me out ^^ – Minako Aino Dec 06 '12 at 15:20