1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-1739 Extend SVINFO to 32 SVs. Make UBX parser handle > 256 bytes

payload.
This commit is contained in:
Erik Gustavsson 2015-02-28 10:48:26 +01:00
parent f5b4e4da37
commit baddff3639
2 changed files with 4 additions and 4 deletions

View File

@ -107,7 +107,7 @@ struct UBX_ACK_NAK ubxLastNak;
#define UBX_PVT_TIMEOUT (1000) #define UBX_PVT_TIMEOUT (1000)
// parse incoming character stream for messages in UBX binary format // parse incoming character stream for messages in UBX binary format
int parse_ubx_stream(uint8_t *rx, uint8_t len, char *gps_rx_buffer, GPSPositionSensorData *GpsData, struct GPS_RX_STATS *gpsRxStats) int parse_ubx_stream(uint8_t *rx, uint16_t len, char *gps_rx_buffer, GPSPositionSensorData *GpsData, struct GPS_RX_STATS *gpsRxStats)
{ {
int ret = PARSER_INCOMPLETE; // message not (yet) complete int ret = PARSER_INCOMPLETE; // message not (yet) complete
enum proto_states { enum proto_states {
@ -124,7 +124,7 @@ int parse_ubx_stream(uint8_t *rx, uint8_t len, char *gps_rx_buffer, GPSPositionS
}; };
uint8_t c; uint8_t c;
static enum proto_states proto_state = START; static enum proto_states proto_state = START;
static uint8_t rx_count = 0; static uint16_t rx_count = 0;
struct UBXPacket *ubx = (struct UBXPacket *)gps_rx_buffer; struct UBXPacket *ubx = (struct UBXPacket *)gps_rx_buffer;
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {

View File

@ -311,7 +311,7 @@ struct UBX_NAV_SVINFO_SV {
}; };
// SV information message // SV information message
#define MAX_SVS 16 #define MAX_SVS 32
struct UBX_NAV_SVINFO { struct UBX_NAV_SVINFO {
uint32_t iTOW; // GPS Millisecond Time of Week (ms) uint32_t iTOW; // GPS Millisecond Time of Week (ms)
@ -405,7 +405,7 @@ extern struct UBX_ACK_NAK ubxLastNak;
bool checksum_ubx_message(struct UBXPacket *); bool checksum_ubx_message(struct UBXPacket *);
uint32_t parse_ubx_message(struct UBXPacket *, GPSPositionSensorData *); uint32_t parse_ubx_message(struct UBXPacket *, GPSPositionSensorData *);
int parse_ubx_stream(uint8_t *rx, uint8_t len, char *, GPSPositionSensorData *, struct GPS_RX_STATS *); int parse_ubx_stream(uint8_t *rx, uint16_t len, char *, GPSPositionSensorData *, struct GPS_RX_STATS *);
void load_mag_settings(); void load_mag_settings();
#endif /* UBX_H */ #endif /* UBX_H */