Hey I'm relatively new to Android programming (but not programming in general).
The Setup: HTC Wildfire (running Android 2.1) LM058 (RS232 Serial Cable Replacement) LM058 will later on be attached to a MCU but for now it's connected to my laptop (terminal)
The Goal: To connect Wildfire to LM058 to each other with a 'bidirectional-stream' (like: "Hello from Android", response: "Hey from LM058").
So far: I've managed to connect the two devices (paired), I can tell by the LEDs on the LM058.
Problem: I can't seem to send anything from my Wildfire to LM058, and can't write anything back. They are paired and Connected.
Code example:
String message = "Hello message from client to server.";
byte[] msgBuffer = message.getBytes();
try {
outStream.write(msgBuffer);
Log.e(TAG, "App was here!");
} catch (IOException e) {
Log.e(TAG, "ON RESUME: Exception during write.", e);
}
I have previously made a similar connection using a Windows Mobile succesfully, but Android seems to give me some trouble at this point.
If you can help me get passed this small hurdle I would be very gratefull!
Could it have anything to do with BaudRate, because when a link is established (paired and Connected) it should replace the two devices (as a simple RS232 cable), so my Terminal on the PC should be set to a certain BaudRate (since I can't seem to find Baud Rate in Android). But still I can't see anything, if Baudrate was wrong then I would be able to see something (even though it might be rubbish) or?