Skip to content

Commit

Permalink
uncomment send mavlink
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzopb committed Nov 20, 2023
1 parent 133b870 commit ab49f9e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
13 changes: 12 additions & 1 deletion src/Settings/App.SettingsGroup.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,18 @@
"longDesc": "Ardupilot Support server to forward mavlink to. i.e: support.ardupilot.org:xxxx",
"type": "string",
"default": "support.ardupilot.org:xxxx"
},
{
"name": "loginAirLink",
"shortDesc": "AirLink User Name",
"type": "string",
"default": ""
},
{
"name": "passAirLink",
"shortDesc": "AirLink Password",
"type": "string",
"default": ""
}
]
>>>>>>> master
}
28 changes: 14 additions & 14 deletions src/comm/LinkManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1073,22 +1073,22 @@ void LinkManager::_updateAirLinkState(const QString &login, const QString &pass)

void LinkManager::sendLoginMsgToAirLink(LinkInterface* link, const QString &login)
{
// __mavlink_airlink_auth_t auth;
// uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
// mavlink_message_t mavmsg;
__mavlink_airlink_auth_t auth;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
mavlink_message_t mavmsg;

// const QString pass = qgcApp()->toolbox()->settingsManager()->appSettings()->passAirLink()->rawValueString();
const QString pass = qgcApp()->toolbox()->settingsManager()->appSettings()->passAirLink()->rawValueString();

// memset(&auth.login, 0, sizeof(auth.login));
// memset(&auth.password, 0, sizeof(auth.password));
// strcpy(auth.login, login.toUtf8().constData());
// strcpy(auth.password, pass.toUtf8().constData());
memset(&auth.login, 0, sizeof(auth.login));
memset(&auth.password, 0, sizeof(auth.password));
strcpy(auth.login, login.toUtf8().constData());
strcpy(auth.password, pass.toUtf8().constData());

// mavlink_msg_airlink_auth_pack(0, 0, &mavmsg, auth.login, auth.password);
// uint16_t len = mavlink_msg_to_send_buffer(buffer, &mavmsg);
// link->writeBytesThreadSafe((const char *)buffer, len);
mavlink_msg_airlink_auth_pack(0, 0, &mavmsg, auth.login, auth.password);
uint16_t len = mavlink_msg_to_send_buffer(buffer, &mavmsg);
link->writeBytesThreadSafe((const char *)buffer, len);

// qDebug() << (link->isConnected() ? "Connected" : "Not connected");
// qDebug() << login.toUtf8().constData();
// qDebug() << pass.toUtf8().constData();
qDebug() << (link->isConnected() ? "Connected" : "Not connected");
qDebug() << login.toUtf8().constData();
qDebug() << pass.toUtf8().constData();
}

0 comments on commit ab49f9e

Please sign in to comment.