Ejemplo n.º 1
0
static bool
ReadPortType(const ProfileMap &map, unsigned n, DeviceConfig::PortType &type)
{
  char name[64];

  MakeDeviceSettingName(name, "Port", n, "Type");

  const char *value = map.Get(name);
  return value != NULL && StringToPortType(value, type);
}
Ejemplo n.º 2
0
static enum DeviceConfig::port_type
ReadPortType(unsigned n)
{
  TCHAR name[64], value[64];

  MakeDeviceSettingName(name, CONF("Port"), n, _T("Type"));
  if (!Profile::Get(name, value, sizeof(value) / sizeof(value[0])))
    return DeviceConfig::SERIAL;

  return StringToPortType(value);
}
Ejemplo n.º 3
0
static DeviceConfig::PortType
ReadPortType(unsigned n)
{
    TCHAR name[64], value[64];

    MakeDeviceSettingName(name, _T("Port"), n, _T("Type"));
    if (!Profile::Get(name, value, ARRAY_SIZE(value)))
        return n == 0
               ? (IsAndroid()
                  ? DeviceConfig::PortType::INTERNAL
                  : DeviceConfig::PortType::SERIAL)
               : DeviceConfig::PortType::DISABLED;

    return StringToPortType(value);
}