Merge pull request #127 from Genaker/receive-heading-from-serial

Receive a heading from serial (rpi > fc)
This commit is contained in:
Yegor Shytikov
2025-01-16 19:54:53 -08:00
committed by GitHub
2 changed files with 16 additions and 1 deletions
+8
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;
}
+8 -1
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();