Openvario / sensord

Daemon to poll air data from Openvario sensorboard
6 stars 11 forks source link

is it OK to send NMEA sentences with invalid data? #7

Open bomilkar opened 4 years ago

bomilkar commented 4 years ago

Looking into main.c the return values from the Compose_...() functions are ignored when it comes to send.

Unless it is the intention to send (what Compose considers) invalid data it should be like this

                                result = Compose_Pressure_POV_fast(&s[0], vario);

                                // NMEA sentence valid ?? Otherwise print some error !!
                                if (result != 1)
                                {
                                        printf("POV fast NMEA Result = %d\n",result);
                                } else

                                // Send NMEA string via socket to XCSoar
                                if ((sock_err = send(sock, s, strlen(s)+1, 0)) < 0)
                                {
                                        fprintf(stderr, "send POV_E failed\n");
                                        break;
                                }

The difference is in } else .

Obviously the other 2 send() should be conditional, too. Same thing.

Here again: review the nmea log files from XCSoar to see the difference.