Exemplo n.º 1
0
bool
LXDevice::ReadFlightList(RecordedFlightList &flight_list,
                         OperationEnvironment &env)
{
    if (IsNano()) {
        if (!EnableNanoNMEA(env))
            return false;

        assert(!busy);
        busy = true;

        bool success = Nano::ReadFlightList(port, flight_list, env);
        busy = false;
        return success;
    }

    if (!EnableCommandMode(env))
        return false;

    assert(!busy);
    busy = true;

    bool success = ReadFlightListInner(port, flight_list, env);

    LX::CommandModeQuick(port, env);

    busy = false;

    return success;
}
Exemplo n.º 2
0
bool
LXDevice::Declare(const Declaration &declaration,
                  gcc_unused const Waypoint *home,
                  OperationEnvironment &env)
{
  if (declaration.Size() < 2 || declaration.Size() > 12)
    return false;

  if (IsNano())
    return Nano::Declare(port, declaration, env);

  if (!EnableCommandMode(env))
    return false;

  bool success = DeclareInner(port, declaration, env);

  LX::CommandModeQuick(port, env);

  return success;
}