ytai / ioio

Software, firmware and hardware of the IOIO - I/O for Android
Apache License 2.0
747 stars 355 forks source link

Non ending reconnecting when using Android IOIO Application Framework. #92

Closed jan-pintr closed 10 years ago

jan-pintr commented 10 years ago

Hi,

I am trying to connect IOIO to phone by bluetooth. Led blinking works, but there is so much those LogCat messages:

2014-08-31 18 24 41

This happens when I use IOIOLib Application Framework to handle connections (code also same as IOIOSimpleApp example).

I also tried to write own connection handling implementation and it works properly.

Is there anything I am doing wrong?


Android 4.3 BT dongle: Miniature Bluetooth Dongle V2.0

App version: IOIO0504

IOIO Hardware: SPRK0020 IOIO Bootloader: IOIO0400 IOIO Firmware: IOIO0500

jan-pintr commented 10 years ago

Ok, I went deeper in the code and found this behavior is caused by IOException from ServerSocket constructor(SocketIOIOConnection.java:66). Which was not properly catched for Permission denied exception.

Actual exception was: socket failed: EACCES (Permission denied)

So after adding INTERNET permission everything worked well.

But I am not still sure that this behavior is requested. I would expect BluetoothIOIOConnection class implementation is used for bluetooth connections. Am I right?

ytai commented 10 years ago

The app framework will constantly listen for connections over all known media. Those will depend on which libraries actually got linked into the app. SocketIOIOConnection is always available, since it is part of IOIOLib itself.