Search in sources :

Example 1 with WifiDirectPersistentGroupManager

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));
}
Also used : Command(com.qualcomm.robotcore.robocol.Command) WifiDirectPersistentGroupManager(org.firstinspires.ftc.robotcore.internal.network.WifiDirectPersistentGroupManager)

Example 2 with WifiDirectPersistentGroupManager

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);
    }
}
Also used : WifiDirectPersistentGroupManager(org.firstinspires.ftc.robotcore.internal.network.WifiDirectPersistentGroupManager)

Example 3 with WifiDirectPersistentGroupManager

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));
}
Also used : WifiDirectPersistentGroupManager(org.firstinspires.ftc.robotcore.internal.network.WifiDirectPersistentGroupManager)

Aggregations

WifiDirectPersistentGroupManager (org.firstinspires.ftc.robotcore.internal.network.WifiDirectPersistentGroupManager)3 Command (com.qualcomm.robotcore.robocol.Command)1