Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/gdl90/ahrs_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:avaremp/pfd_painter.dart';

import 'message.dart';

bool isStratux = false; // share state with message_factory.dart

class AhrsMessage extends Message {

double? aoa;
Expand Down Expand Up @@ -119,7 +121,8 @@ class AhrsMessage extends Message {
double num;
num = _combineBytesForFloat(m0, m1);
if (num != 0x7FFF) {
roll = num / 10;
// roll = num / 10;
roll = (isStratux == true) ? -(num / 10) : (num / 10); // reverse roll orientation
}
num = _combineBytesForFloat(m2, m3);
if (num != 0x7FFF) {
Expand Down Expand Up @@ -156,4 +159,4 @@ class AhrsMessage extends Message {
}
}
}
}
}
4 changes: 4 additions & 0 deletions lib/gdl90/message_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class MessageFactory
switch (type) {
case MessageType.heartBeat:
break;
case MessageType.heartBeatStratux:
isStratux = true;
break;
case MessageType.uplink:
m = UplinkMessage(type);
case MessageType.ownShip:
Expand Down Expand Up @@ -96,6 +99,7 @@ class MessageFactory

class MessageType {
static const int heartBeat = 0x00;
static const int heartBeatStratux = 0xCC; // per https://github.com/cyoung/stratux/blob/master/notes/app-vendor-integration.md
static const int uplink = 0x07;
static const int ownShip = 0x0A;
static const int ownShipGeometricAltitude = 0x0B;
Expand Down