Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_GPS/RTCM3_Parser.h
Views: 1798
/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/14/*15RTCMv3 parser, used to support moving baseline RTK mode between two16GPS modules17*/18#pragma once19#include <stdint.h>2021// maximum packet length with MAVLink GPS_RTCM_DATA is 4*180 as we22// handle up to 4 fragments23#define RTCM3_MAX_PACKET_LEN 7202425class RTCM3_Parser {26public:27// process one byte, return true if packet found28bool read(uint8_t b);2930// reset internal state31void reset(void);3233// clear previous packet34void clear_packet(void);3536// return length of found packet37uint16_t get_len(const uint8_t *&bytes) const;3839// return ID of found packet40uint16_t get_id(void) const;4142private:43const uint8_t RTCMv3_PREAMBLE = 0xD3;4445// raw packet, we shouldn't need over 600 bytes for the MB configs we use46uint8_t pkt[RTCM3_MAX_PACKET_LEN];4748// number of bytes in pkt[]49uint16_t pkt_bytes;5051// length from header52uint16_t pkt_len;5354// length of found packet55uint16_t found_len;5657bool parse(void);58void resync(void);59};60616263