Fix receiving packets

This commit is contained in:
Marek S. Łukasiewicz 2025-01-31 11:51:20 +01:00
parent 372468b5a1
commit 231b639901
2 changed files with 6 additions and 1 deletions

View file

@ -56,6 +56,11 @@ void MarshConnector::_process(double delta) {
if (!socket->is_socket_connected()) { if (!socket->is_socket_connected()) {
socket->connect_to_host("127.0.0.1", 24400); socket->connect_to_host("127.0.0.1", 24400);
} else {
while (socket->get_available_packet_count() > 0) {
const PackedByteArray data = socket->get_packet();
receive_data(data);
}
} }
} }

View file

@ -68,7 +68,7 @@ private:
LOCAL_FRAME_LON, LOCAL_FRAME_LON,
PARAM_COUNT, PARAM_COUNT,
}; };
float parameters[PARAM_COUNT]; float parameters[PARAM_COUNT] = {0.0, 0.0, 0.0, 0.0, 0.0};
const String parameter_names[PARAM_COUNT] = { const String parameter_names[PARAM_COUNT] = {
// "FOG_DENSITY", // "FOG_DENSITY",
"NAV_OFS_HDG", "NAV_OFS_X", "NAV_OFS_Y", "NAV_OFS_HDG", "NAV_OFS_X", "NAV_OFS_Y",