Currently I'm migrating project from ConnectSDK 1.4 to 1.5 Lite and encountered a problem:
Every time gyroscope data comes my code checks MouseControl availability and invokes move method:
public class App extends Application {
public static ConnectableDevice tv;
// return MouseControl
public static MouseControl getMouse() {
if (tv != null && tv.isConnected()) {
return tv.getCapability(MouseControl.class);
} else {
return null;
}
}
...
}
class MySensorsListener implements SensorEventListener {
// this method is invoked continuously every N millisecond
public void onSensorChanged(SensorEvent event) {
...
if (App.getMouse() != null) {
App.getMouse().move(dx, dy);
}
}
}
public class MainActivity extends AppCompatActivity {
...
// connected to device
public void onDeviceReady(ConnectableDevice device) {
if (App.getMouse() != null) {
App.getMouse().connectMouse();
}
}
}
With ConnectSDK 1.4.2 this code works great, but with ConnectSDK 1.5 mouse movements sometimes don't work.
It seems that mouseSocket is not ready and it's created every time move method invoked.
I'm working with Android app that translates Gyroscope data to TV cursor movements. You can find test source code at https://github.com/alexey-odintsov/MouseSocketTest (it's short).
Currently I'm migrating project from ConnectSDK 1.4 to 1.5 Lite and encountered a problem: Every time gyroscope data comes my code checks
MouseControl
availability and invokesmove
method:With ConnectSDK 1.4.2 this code works great, but with ConnectSDK 1.5 mouse movements sometimes don't work.
It seems that
mouseSocket
is not ready and it's created every timemove
method invoked.Normal working socket logs are:
Socket logs when mouse is not working:
I've found a workaround by exposing
isMouseConnected
API insideWebOSTVService
class and updatingMouseControl
interface method signature:And by adding checking to my code:
But I believe there is something must be done with MouseControl socket creation logic.