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/GPS_detect_state.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*/1415/*16GPS detection state structures. These need to be in a separate17header to prevent a circular dependency between AP_GPS and the18backend drivers.1920These structures are allocated as a single block in AP_GPS during21driver detection, then freed once the detection is finished. Each22GPS driver needs to implement a static _detect() function which uses23this state information to detect if the attached GPS is of the24specific type that it handles.25*/2627#include "AP_GPS_config.h"2829#if AP_GPS_NMEA_ENABLED30struct NMEA_detect_state {31uint8_t step;32uint8_t ck;33};34#endif3536#if AP_GPS_SIRF_ENABLED37struct SIRF_detect_state {38uint16_t checksum;39uint8_t step, payload_length, payload_counter;40};41#endif4243#if AP_GPS_UBLOX_ENABLED44struct UBLOX_detect_state {45uint8_t payload_length, payload_counter;46uint8_t step;47uint8_t ck_a, ck_b;48};49#endif5051#if AP_GPS_ERB_ENABLED52struct ERB_detect_state {53uint8_t payload_length, payload_counter;54uint8_t step;55uint8_t ck_a, ck_b;56};57#endif5859#if AP_GPS_SBP_ENABLED60struct SBP_detect_state {61enum {62WAITING = 0,63GET_TYPE = 1,64GET_SENDER = 2,65GET_LEN = 3,66GET_MSG = 4,67GET_CRC = 568} state:8;69uint16_t msg_type;70uint8_t n_read;71uint8_t msg_len;72uint16_t crc_so_far;73uint16_t crc;74uint8_t heartbeat_buff[4];75};76#endif7778#if AP_GPS_SBP2_ENABLED79struct SBP2_detect_state {80enum {81WAITING = 0,82GET_TYPE = 1,83GET_SENDER = 2,84GET_LEN = 3,85GET_MSG = 4,86GET_CRC = 587} state:8;88uint16_t msg_type;89uint8_t n_read;90uint8_t msg_len;91uint16_t crc_so_far;92uint16_t crc;93uint8_t heartbeat_buff[4];94};95#endif969798