Beispiel #1
0
bool
DeviceDescriptor::Declare(const struct Declaration &declaration,
                          const Waypoint *home,
                          OperationEnvironment &env)
{
  if (port == NULL)
    return false;

  SetBusy(true);

  StaticString<60> text;
  text.Format(_T("%s: %s."), _("Sending declaration"), driver->display_name);
  env.SetText(text);

  port->StopRxThread();

  bool result = device != NULL && device->Declare(declaration, home, env);

  if (device_blackboard->IsFLARM(index) && !IsDriver(_T("FLARM"))) {
    text.Format(_T("%s: FLARM."), _("Sending declaration"));
    env.SetText(text);
    FlarmDevice flarm(*port);
    result = flarm.Declare(declaration, home, env) || result;
  }

  port->StartRxThread();

  SetBusy(false);
  return result;
}
Beispiel #2
0
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);
  }
}
Beispiel #3
0
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);
}
Beispiel #4
0
 bool IsVega() const {
     return IsDriver(_T("Vega"));
 }
Beispiel #5
0
 bool IsCondor() const {
   return IsDriver(_T("Condor"));
 }