Skip to content

Commit

Permalink
fix(atsu): Fixes for NXApi-Freetext and CPDLC Logon-issues (#7174)
Browse files Browse the repository at this point in the history
* fix the NXApi-Telex bug

* show FBW if Hoppie is disabled

* add UM0 as a possible reject

* fix review finding
  • Loading branch information
svengcz authored and aguther committed May 9, 2022
1 parent 388a0a4 commit 6859812
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class CDUAocFreeText {
static ShowPage(mcdu, store = { "msg_to": "", "reqID": 0, "msg_line1": "", "msg_line2": "", "msg_line3": "", "msg_line4": "", "sendStatus": ""}) {
static ShowPage(mcdu, store = { "msg_to": "", "reqID": SimVar.GetSimVarValue('L:A32NX_HOPPIE_ACTIVE', 'number') !== 0 ? 0 : 1, "msg_line1": "", "msg_line2": "", "msg_line3": "", "msg_line4": "", "sendStatus": ""}) {
mcdu.clearDisplay();
mcdu.page.Current = mcdu.page.AOCFreeText;
const networkTypes = [
Expand Down
2 changes: 1 addition & 1 deletion src/atsu/src/ATC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export class Atc {
}

// logon rejected
if (response.Content?.TypeId === 'UM9996') {
if (response.Content?.TypeId === 'UM9996' || response.Content?.TypeId === 'UM0') {
response.DcduRelevantMessage = false;
this.dcduLink.setAtcLogonMessage('');
this.currentAtc = '';
Expand Down
27 changes: 14 additions & 13 deletions src/atsu/src/com/webinterfaces/NXApiConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,20 @@ export class NXApiConnector {
}

// Fetch new messages
Telex.fetchMessages()
.then((data) => {
for (const msg of data) {
const message = new FreetextMessage();
message.Network = AtsuMessageNetwork.FBW;
message.Direction = AtsuMessageDirection.Uplink;
message.Station = msg.from.flight;
message.Message = msg.message.replace(/;/i, ' ');

retval.push(message);
}
})
.catch(() => [AtsuStatusCodes.ComFailed, retval]);
try {
const data = await Telex.fetchMessages();
for (const msg of data) {
const message = new FreetextMessage();
message.Network = AtsuMessageNetwork.FBW;
message.Direction = AtsuMessageDirection.Uplink;
message.Station = msg.from.flight;
message.Message = msg.message.replace(/;/i, ' ');

retval.push(message);
}
} catch (_e) {
return [AtsuStatusCodes.ComFailed, retval];
}
}

return [AtsuStatusCodes.Ok, retval];
Expand Down

0 comments on commit 6859812

Please sign in to comment.