diff --git a/src/marshconnector.cpp b/src/marshconnector.cpp index 03cecbd..f11e62e 100644 --- a/src/marshconnector.cpp +++ b/src/marshconnector.cpp @@ -56,6 +56,11 @@ void MarshConnector::_process(double delta) { if (!socket->is_socket_connected()) { 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); + } } } diff --git a/src/marshconnector.h b/src/marshconnector.h index 6e73112..fff1971 100644 --- a/src/marshconnector.h +++ b/src/marshconnector.h @@ -68,7 +68,7 @@ private: LOCAL_FRAME_LON, 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] = { // "FOG_DENSITY", "NAV_OFS_HDG", "NAV_OFS_X", "NAV_OFS_Y",