本文整理汇总了C++中NetworkManager::findController方法的典型用法代码示例。如果您正苦于以下问题:C++ NetworkManager::findController方法的具体用法?C++ NetworkManager::findController怎么用?C++ NetworkManager::findController使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkManager
的用法示例。
在下文中一共展示了NetworkManager::findController方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
int CommandListener::WifiRemoveNetworkCmd::runCommand(SocketClient *cli,
int argc, char **argv) {
NetworkManager *nm = NetworkManager::Instance();
WifiController *wc = (WifiController *) nm->findController("WIFI");
if (wc->removeNetwork(atoi(argv[1])))
cli->sendMsg(ResponseCode::OperationFailed, "Failed to remove network", true);
else {
cli->sendMsg(ResponseCode::CommandOkay, "Network removed.", false);
}
return 0;
}
示例2: sprintf
int CommandListener::WifiCreateNetworkCmd::runCommand(SocketClient *cli,
int argc, char **argv) {
NetworkManager *nm = NetworkManager::Instance();
WifiController *wc = (WifiController *) nm->findController("WIFI");
WifiNetwork *wn;
if (!(wn = wc->createNetwork()))
cli->sendMsg(ResponseCode::OperationFailed, "Failed to create network", true);
else {
char tmp[128];
sprintf(tmp, "Created network id %d.", wn->getNetworkId());
cli->sendMsg(ResponseCode::CommandOkay, tmp, false);
}
return 0;
}