Hi Guys, thanks very much for answers, but no results.
Perharps my question was not clear enough. Forget a possible final "well done" implementation and focus on a bare manual send/receive procedure, which must be done only once in life. Just press a Button and send a String and just receive an answer. In my unlucky experience with communication over serial ports, I had always to suffer. No exception now.. That's why I begin my study in such an "unusual" way. First of all I must understand whether this "parameterless" Serial works, in my case. (I am used with BaudRates etc.) (I have no doubts that may work in general). By the way I observe that, on the other side, there is a strongly parameter oriented device (Use something different from its settings, an nothing works. Hope it doesn't matter with Android. This is a first doubt: Serial works with baudrate oriented devices?). The string I send must be Ascii and followed by CrLf. That's why I used the TextWriter.WriteLine. This, if I don't miss something, should send over the Serial port my ascii command followed by CrLf. (Or not? This a second doubt: if I do, instead, as suggested, String s="A" and convert "s" to bytes, what will be sent over the Serial port?). On the other side, the instrument, if receives a correct command (which is the famous "A"+CrLf) answers "Something"+CrLf. So, if the instrument answers, also the TextReader.ReadLine should not hang up, because the CrLf is present. After my experiments, I am almost sure that the problem is that the command is not correctly sent, and no answer follows. So the reception is not guilty. Moreover the program fails on TextReader.Ready, which is never set, so no byte appears on the other side. Another empirical proof is that the instrument doesn't do any action that follows to commands to which it must not answer, but do something, like moving, for example. In other words, if I send a command "Move"+CrLf, it doesn't move. I also already experienced that, with an external Gps, like you did, the program works and gets data. But this case is different: the Gps (at least mine) sends data continuously, without any request from the phone. This seem to confirm that the problem is on sending. Sorry, I was long, but all may be resumed in:
Which may be the cause that prevents the command to be sent? Could be the Serial mechanism not well suited for this case? Does the TextWriter.WriteLine actually send the Ascii text with CrLf or perhaprs converts it to "something else" that will not be understood by the instrument?
By the way I know that some people working with Java and Android were able to drive same type of instrument.
Thanks a lot for your patience and if you have some other hints, I will be grateful.
Best regards
Giovanni