本文整理汇总了C++中DevicePtr::Mac方法的典型用法代码示例。如果您正苦于以下问题:C++ DevicePtr::Mac方法的具体用法?C++ DevicePtr::Mac怎么用?C++ DevicePtr::Mac使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevicePtr
的用法示例。
在下文中一共展示了DevicePtr::Mac方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Add
//added by Cristian.Guef
int NodesRepository::Add(const DevicePtr& node)
{
if (!nodesByMAC.insert(NodesByMACT::value_type(node->Mac(), node)).second)
{
LOG_WARN("Same MAC:" << node->Mac().ToString() << "was detected (will be ignored)!");
return 0;
}
return 1;
}
示例2: Create
AbstractAppCommandPtr AppCommandsFactory::Create(DBCommand& command, DevicesManager& devices)
{
LOG_DEBUG_APP("[AppCommand]: create for db command:" << command);
switch ( command.commandCode )
{
case DBCommand::ccGetTopology:
CheckUsrCmdInputVal(devices).TestUsrParams_ccGetTopology(command);
return AbstractAppCommandPtr(new AppTopologyCommand());
case DBCommand::ccNotifSubscribe:
{
DevicePtr dev;
CheckUsrCmdInputVal(devices).TestUsrParams_ccNotifSubscribe(command, dev);
return AbstractAppCommandPtr(new AppSetBurstNotificationCmd(dev->GetPublisherInfo().channelList,
dev->GetPublisherInfo().burstMessageList, dev->GetPublisherInfo().triggersList));
}
case DBCommand::ccNotifUnSubscribe:
CheckUsrCmdInputVal(devices).TestUsrParams_ccNotifUnSubscribe(command);
return AbstractAppCommandPtr(new AppUnsetBurstNotificationCmd());
case DBCommand::ccTopologyNotify:
CheckUsrCmdInputVal(devices).TestUsrParams_ccTopologyNotify(command);
return AbstractAppCommandPtr(new AppSetTopoNotificationCmd());
case DBCommand::ccGeneralCmd:
{
int retValueCmdNo; /* cmdNo */
std::string retValueDataBytes; /* dataBytes */
bool bypassIOCache;
CheckUsrCmdInputVal(devices).TestUsrParams_ccGeneralCmd(command, retValueCmdNo, retValueDataBytes, bypassIOCache);
return AbstractAppCommandPtr(new AppGeneralCommand(retValueCmdNo, retValueDataBytes, command.commandID, command.deviceID, bypassIOCache));
}
case DBCommand::ccReadValue:
{
/*compute the channel list for the req cmd*/
PublishChannel channel;
bool bypassIOCache;
CheckUsrCmdInputVal(devices).TestUsrParams_ccReadValue(command, channel, bypassIOCache);
PublishChannelSetT channelsSet;
channelsSet.insert(channel);
return AbstractAppCommandPtr(new AppReadValueCmd( channel.cmdNo, command.deviceID, DeviceReading::ReadValue, channelsSet, bypassIOCache));
}
case DBCommand::ccRoutesReport:
return AbstractAppCommandPtr(new AppRoutesReportCmd(devices.RegisteredDevicesNo()));
case DBCommand::ccServicesReport:
return AbstractAppCommandPtr(new AppServicesReportCmd(devices.RegisteredDevicesNo()));
case DBCommand::ccDeviceHealthReport:
{
std::list<std::pair<int, MAC> > devicesList;
CheckUsrCmdInputVal(devices).TestUsrParams_ccDevHealthReport(command, devicesList);
return AbstractAppCommandPtr(new AppDeviceHealthReportCmd(devicesList));
}
case DBCommand::ccSuperframesReport:
return AbstractAppCommandPtr(new AppSuperframesReportCmd(devices.RegisteredDevicesNo()));
case DBCommand::ccDeviceScheduleLinkReport:
{
std::list<std::pair<int,MAC> > devicesList;
CheckUsrCmdInputVal(devices).TestUsrParams_ccDeviceScheduleLinkReport(command, devicesList);
return AbstractAppCommandPtr(new AppDeviceScheduleLinksReportCmd(devicesList));
}
case DBCommand::ccNeighborHealthReport:
{
std::list<std::pair<int, MAC> > devicesList;
CheckUsrCmdInputVal(devices).TestUsrParams_ccNeighborHealthReport(command, devicesList);
return AbstractAppCommandPtr(new AppNeighborHealthReportCmd(devicesList));
}
case DBCommand::ccAutodetectBurstsConfig:
{
DevicePtr dev;
std::string pubConfFileName;
CheckUsrCmdInputVal(devices).TestUsrParams_ccBurstConfiguration(command, dev, pubConfFileName);
//for cancelling command
dev->configBurstDBCmdID = command.commandID;
return AbstractAppCommandPtr(new AppSetBurstConfigurationCmd(pubConfFileName, dev));
}
case DBCommand::ccReadBurstConfig:
{
DevicePtr dev;
CheckUsrCmdInputVal(devices).TestUsrParams_ccReadBurstConfig(command, dev);
MAC mac = dev->Mac();
return AbstractAppCommandPtr(new AppDiscoveryBurstConfigCmd(mac));
}
default:
break;
}
LOG_ERROR_APP("[AppCommand]: create with Unknown CommandCode=" << command.commandCode);
THROW_EXCEPTION1(InvalidCommandException, "unknown command");
}