@@ -104,66 +104,7 @@ bool GPSHardware::Handle_GPSConfig(wippersnapper_gps_GPSConfig *gps_config) {
104104 }
105105 }
106106 } else if (_driver_type == GPS_DRV_UBLOX) {
107- WS_DEBUG_PRINTLN (" [gps] Handling GPSConfig for U-Blox driver..." );
108107 I2cReadDiscard ();
109- // Iterate through the command sentences and send them to the GPS module
110- for (size_t i = 0 ; i < gps_config->commands_ubxes_count ; i++) {
111- // TODO: Tuesday fix this frame decoder!
112- /* pb_bytes_array_t *ubx_frame = &gps_config->commands_ubxes[i];
113- // Validate minimum frame size
114- if (ubx_frame->size < 8) {
115- WS_DEBUG_PRINT("[gps] Invalid UBX frame size: ");
116- WS_DEBUG_PRINTLN(ubx_frame->size);
117- continue;
118- }
119-
120- // Validate sync bytes
121- if (ubx_frame->bytes[0] != 0xB5 || ubx_frame->bytes[1] != 0x62) {
122- WS_DEBUG_PRINTLN("[gps] Invalid UBX sync bytes");
123- continue;
124- }
125-
126- // Validate frame size
127- size_t expectedSize = 8 + payloadLength;
128- if (ubx_frame->size != expectedSize) {
129- WS_DEBUG_PRINT("[gps] Frame size mismatch. Expected: ");
130- WS_DEBUG_PRINT(expectedSize);
131- WS_DEBUG_PRINT(", Got: ");
132- WS_DEBUG_PRINTLN(ubx_frame->size);
133- continue;
134- }
135-
136- // Extract message components
137- uint8_t msgClass = ubx_frame->bytes[2];
138- uint8_t msgId = ubx_frame->bytes[3];
139- uint16_t payloadLength = ubx_frame->bytes[4] | (ubx_frame->bytes[5]
140- << 8);
141-
142- // Get payload
143- uint8_t *payload = NULL;
144- if (payloadLength > 0) {
145- payload = &ubx_frame->bytes[6];
146- }
147-
148- WS_DEBUG_PRINT("[gps] Sending UBX CMD #");
149- WS_DEBUG_PRINT(i);
150- WS_DEBUG_PRINT(" - Class: 0x");
151- WS_DEBUG_PRINT(msgClass, HEX);
152- WS_DEBUG_PRINT(", ID: 0x");
153- WS_DEBUG_PRINT(msgId, HEX);
154- WS_DEBUG_PRINT(", Payload len: ");
155- WS_DEBUG_PRINTLN(payloadLength);
156-
157- // Send the message
158- UBXSendStatus status = _ubx_gps->sendMessageWithAck(msgClass, msgId,
159- payload, payloadLength);
160-
161- if (status != UBXSendStatus::UBX_SEND_SUCCESS) {
162- WS_DEBUG_PRINTLN("[gps] Failed to send UBX message");
163- } else {
164- WS_DEBUG_PRINTLN("[gps] OK");
165- } */
166- }
167108 } else {
168109 WS_DEBUG_PRINTLN (" [gps] ERROR: Unsupported GPS driver type!" );
169110 return false ;
0 commit comments