2012/8/28 Justinas Gasparovičius <
baltaspopi...@gmail.com>:
> Hello again,
> Thanks for quick reply. Information was very helpful, but i'm still unable
> to connect. I renamed device to "maria" and after i press "scale" android
> notifies "connected to maria" but app is showing "Searching for the Smart
> Scale..." and nothing happens. I tried to connect in different ways: while
> sending only a 70, only b 70, sending both with 100 ms delays and while
> sending nothing. Nothing happens and app keeps showing "Searching for the
> Smart Scale..." in all these ways.
> My script is like yours:
> unsigned int weight=70;
> printf("a %d\n", weight);
> printf("b %d\n", weight);
> Tests on Hyper Terminal are showing that everything looks good (attached
> file). I also tested using android app SenaBTerm (android bluetooth
> terminal) and app was able to connect also showed that bt module is sending
> correct data (a 70 and b 70). Any ideas what to try next ?
Hey, great advance!!
Seems you are doing all correctly. I did very well to test with
terminal program and other Bluetooth app!
My bt module is
> settings are: baud rate - 19200 bps, Data bits 8, pairity - None, Stop bits
> - 1, Flow control - None. Module is working on Master mode. Maybe fault is
> in settings, can you describe yours ?
The settings of serial port of bt module should be only important for
communicating from microcontroller adn bt module. Since you were able
to correctly communicate over bt, your baud rate should be corretly.
Could you please tell what is your bt module? please share a picture also.
I belive the problem is now on Android app that is not able to "open"
your bluetooth module. I suggest you to use the Eclipse and debug the
code, by putting breakpoints on the code and find where the code
hangs.
My bet is that you need to put break points on "ScaleActivity.java"
file. "setContentView(R.layout.scale);" code should print the
"Searching for the Smart Scale...".
But I guess it hangs just after at:
// Get local Bluetooth adapter
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
// Start activity find and return the device bluetooth address
Intent intent = new Intent(this, FindDeviceActivity.class);
startActivityForResult(intent, RESULT_FIND_DEVICE);
Maybe the problem is the activiy "FindDeviceActivity". Please try to
"clear" the pairing of you bt module on Android and make again the
pairing.