예제 #1
0
MM::Device* Hub::CreatePeripheralDevice(const char* adapterName)
{
    for(unsigned i = 0; i < GetNumberOfInstalledDevices(); i++)
    {
        MM::Device* d = GetInstalledDevice(i);
        char name[MM::MaxStrLength];
        d->GetName(name);
        if(strcmp(adapterName, name) == 0)
            return CreateDevice(adapterName);
    }
    return 0;
}
예제 #2
0
std::vector<MM::Device*>
HubInstance::GetInstalledPeripherals()
{
   DetectInstalledDevices();

   unsigned nPeripherals = GetNumberOfInstalledDevices();
   std::vector<MM::Device*> peripherals;
   peripherals.reserve(nPeripherals);

   for (unsigned i = 0; i < nPeripherals; ++i)
      peripherals.push_back(GetInstalledDevice(i));
   return peripherals;
}