コード例 #1
0
ファイル: Descriptor.cpp プロジェクト: kwtskran/XCSoar
bool
DeviceDescriptor::Declare(const struct Declaration &declaration,
                          const Waypoint *home,
                          OperationEnvironment &env)
{
  assert(borrowed);
  assert(port != nullptr);
  assert(driver != nullptr);
  assert(device != nullptr);

  // explicitly set passthrough device? Use it...
  if (driver->HasPassThrough() && second_device != nullptr) {
    // set the primary device to passthrough
    device->EnablePassThrough(env);
    return second_device != nullptr &&
      second_device->Declare(declaration, home, env);
  } else {
    /* enable the "muxed FLARM" hack? */
    const bool flarm = device_blackboard->IsFLARM(index) &&
      !IsDriver(_T("FLARM"));

    return DoDeclare(declaration, *port, *driver, device, flarm,
                     home, env);
  }
}
コード例 #2
0
ファイル: Descriptor.cpp プロジェクト: M-Scholli/XCSoar
bool
DeviceDescriptor::Declare(const struct Declaration &declaration,
                          const Waypoint *home,
                          OperationEnvironment &env)
{
  assert(borrowed);
  assert(port != nullptr);
  assert(driver != nullptr);
  assert(device != nullptr);

  /* enable the "muxed FLARM" hack? */
  const bool flarm = device_blackboard->IsFLARM(index) &&
    !IsDriver(_T("FLARM"));

  return DoDeclare(declaration, *port, *driver, device, flarm,
                   home, env);
}