mirror of
https://github.com/Genaker/LoraSA.git
synced 2026-03-28 17:42:59 +01:00
Receive a heading from serial (rpi > fc)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user