Also implement Service IPC to action request.
Signed-off-by: Mike Beattie <mike@ethernal.org>
android:icon="@android:drawable/ic_menu_search"
android:title="@string/connect_device" />
<item android:id="@+id/select_freq"
android:icon="@android:drawable/ic_menu_search"
android:title="@string/connect_device" />
<item android:id="@+id/select_freq"
- android:icon="@android:drawable/ic_menu_search"
+ android:icon="@android:drawable/ic_menu_preferences"
android:title="@string/select_freq" />
</menu>
android:title="@string/select_freq" />
</menu>
}
void setFrequency(double freq) {
}
void setFrequency(double freq) {
+ try {
+ mService.send(Message.obtain(null, TelemetryService.MSG_SETFREQUENCY, freq));
+ } catch (RemoteException e) {
+ }
}
void setFrequency(String freq) {
}
void setFrequency(String freq) {
}
});
AlertDialog alert = builder.create();
}
});
AlertDialog alert = builder.create();
return true;
}
return false;
return true;
}
return false;
static final int MSG_CONNECT_FAILED = 5;
static final int MSG_DISCONNECTED = 6;
static final int MSG_TELEMETRY = 7;
static final int MSG_CONNECT_FAILED = 5;
static final int MSG_DISCONNECTED = 6;
static final int MSG_TELEMETRY = 7;
+ static final int MSG_SETFREQUENCY = 8;
public static final int STATE_NONE = 0;
public static final int STATE_READY = 1;
public static final int STATE_NONE = 0;
public static final int STATE_READY = 1;
case MSG_TELEMETRY:
s.sendMessageToClients(Message.obtain(null, AltosDroid.MSG_TELEMETRY, msg.obj));
break;
case MSG_TELEMETRY:
s.sendMessageToClients(Message.obtain(null, AltosDroid.MSG_TELEMETRY, msg.obj));
break;
+ case MSG_SETFREQUENCY:
+ if (s.state == STATE_CONNECTED) {
+ try {
+ s.mAltosBluetooth.set_radio_frequency((Double) msg.obj);
+ } catch (InterruptedException e) {
+ } catch (TimeoutException e) {
+ }
+ }
+ break;
default:
super.handleMessage(msg);
}
default:
super.handleMessage(msg);
}