Receive a heading from serial (rpi > fc)

This commit is contained in:
KonradIT
2025-01-15 23:07:49 +01:00
parent 825ee472e1
commit ff555c7a9a
2 changed files with 16 additions and 1 deletions

View File

@@ -392,6 +392,14 @@ Message *_parsePacket(String p)
return m;
}
if (cmd.equalsIgnoreCase("heading"))
{
Message *m = new Message();
m->type = MessageType::HEADING;
m->payload.heading.heading = _intParam(p, 0);
return m;
}
return NULL;
}

View File

@@ -26,7 +26,8 @@ enum MessageType
SCAN_RESULT,
SCAN_MAX_RESULT,
CONFIG_TASK,
_MAX_MESSAGE_TYPE = CONFIG_TASK
HEADING,
_MAX_MESSAGE_TYPE = HEADING
};
enum ConfigTaskType
@@ -65,6 +66,11 @@ struct ConfigTask
ConfigTaskType task_type;
};
struct Heading
{
int16_t heading;
};
struct Message
{
MessageType type;
@@ -74,6 +80,7 @@ struct Message
ConfigTask config;
ScanTask scan;
ScanTaskResult dump;
Heading heading;
} payload;
~Message();