use of org.firstinspires.ftc.robotcore.internal.network.WifiDirectPersistentGroupManager in project robotcode by OutoftheBoxFTC.
the class FtcEventLoopBase method handleCommandRequestRememberedGroups.
/**
* Serialize the list of remembered Wifi Direct groups and send it to the driver station
*/
protected void handleCommandRequestRememberedGroups() {
WifiDirectPersistentGroupManager manager = new WifiDirectPersistentGroupManager(WifiDirectAgent.getInstance());
String serialized = WifiDirectGroupName.serializeNames(manager.getPersistentGroups());
networkConnectionHandler.sendCommand(new Command(CommandList.CMD_REQUEST_REMEMBERED_GROUPS_RESP, serialized));
}
use of org.firstinspires.ftc.robotcore.internal.network.WifiDirectPersistentGroupManager in project robotcode by OutoftheBoxFTC.
the class FtcWifiDirectRememberedGroupsActivity method onCreate.
// ----------------------------------------------------------------------------------------------
// Life Cycle
// ----------------------------------------------------------------------------------------------
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ftc_wifi_remembered_groups);
if (!remoteConfigure) {
persistentGroupManager = new WifiDirectPersistentGroupManager(WifiDirectAgent.getInstance());
} else {
networkConnectionHandler.pushReceiveLoopCallback(recvLoopCallback);
}
}
use of org.firstinspires.ftc.robotcore.internal.network.WifiDirectPersistentGroupManager in project robotcode by OutoftheBoxFTC.
the class FtcEventLoopBase method handleCommandClearRememberedGroups.
/**
* Clear the list of remembered groups
*/
protected void handleCommandClearRememberedGroups() {
WifiDirectPersistentGroupManager manager = new WifiDirectPersistentGroupManager(WifiDirectAgent.getInstance());
manager.deleteAllPersistentGroups();
AppUtil.getInstance().showToast(UILocation.BOTH, AppUtil.getDefContext().getString(R.string.toastWifiP2pRememberedGroupsCleared));
}
Aggregations