21 #define ALLOW_DOUBLE_MATH_FUNCTIONS 30 #define SBF_DEBUGGING 0 33 # define Debug(fmt, args ...) \ 35 hal.console->printf("%s:%d: " fmt "\n", \ 36 __FUNCTION__, __LINE__, \ 38 hal.scheduler->delay(1); \ 41 # define Debug(fmt, args ...) 44 #define SBF_EXCESS_COMMAND_BYTES 5 // 2 start bytes + validity byte + space byte + endline byte 46 #define RX_ERROR_MASK (CONGESTION | \ 70 for (uint32_t i = 0; i < available_bytes; i++) {
83 Debug(
"SBF Sending port enable");
87 Debug(
"SBF sending init string: %s", init_str);
88 port->
write((
const uint8_t*)init_str, strlen(init_str));
125 }
else if (temp ==
'R') {
126 Debug(
"SBF got a response\n");
271 Debug(
"BlockID %d", blockid);
282 if (temp.
WNc != 65535) {
290 if (temp.
Vn > -200000) {
317 if (temp.
NrSV != 255) {
321 Debug(
"temp.Mode=0x%02x\n", (
unsigned)temp.
Mode);
322 switch (temp.
Mode & 15) {
352 if ((temp.
Mode & 64) > 0) {
354 }
else if ((temp.
Mode & 128) > 0) {
418 const char* command =
"emd, DSK1, Mount\n";
419 Debug(
"Mounting disk");
420 port->
write((
const uint8_t*)command, strlen(command));
424 const char* command =
"emd, DSK1, Unmount\n";
425 Debug(
"Unmounting disk");
426 port->
write((
const uint8_t*)command, strlen(command));
430 bool is_logging =
true;
bool get_soft_armed() const
uint32_t time_week_ms
GPS time (milliseconds from start of GPS week)
const char * _initialisation_blob[5]
uint32_t last_gps_time_ms
the system time we got the last GPS timestamp, milliseconds
float safe_sqrt(const T v)
const char * _port_enable
GPS_Status status
driver fix status
struct AP_GPS_SBF::sbf_msg_parser_t sbf_msg
Interface definition for the various Ground Control System.
bool have_vertical_velocity
does GPS give vertical velocity? Set to true only once available.
Vector3f velocity
3D velocity in m/s, in NED format
void WriteBlock(const void *pBuffer, uint16_t size)
bool is_positive(const T fVal1)
#define SBF_DISK_ACTIVITY
int32_t lat
param 3 - Latitude * 10**7
static auto MAX(const A &one, const B &two) -> decltype(one > two ? one :two)
Receiving valid messages and 3D RTK Fixed.
void log_ExtEventPVTGeodetic(const msg4007 &temp)
uint32_t crc_error_counter
void mount_disk(void) const
AP_GPS & gps
access to frontend (for parameters)
float wrap_360(const T angle, float unit_mod)
int32_t alt
param 2 - Altitude in centimeters (meters * 100) see LOCATION_ALT_MAX_M
Receiving valid messages and 3D lock with differential improvements.
Receiving valid messages and 3D RTK Float.
virtual size_t write(uint8_t)=0
#define Debug(fmt, args ...)
AP_GPS_SBF(AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDriver *_port)
enum AP_GPS_SBF::sbf_msg_parser_t::@32 sbf_state
static DataFlash_Class * instance(void)
void unmount_disk(void) const
uint16_t time_week
GPS week number.
Receiving valid messages and 2D lock.
uint32_t rtk_age_ms
GPS age of last baseline correction in milliseconds (0 when no corrections, 0xFFFFFFFF indicates over...
AP_GPS::GPS_State & state
public state for this instance
void send_text(MAV_SEVERITY severity, const char *fmt,...)
bool should_df_log() const
uint16_t vdop
vertical dilution of precision in cm
virtual uint32_t available()=0
Location location
last fix location
int32_t lng
param 4 - Longitude * 10**7
Receiving valid GPS messages but no lock.
bool is_configured(void) override
static const uint8_t SBF_PREAMBLE1
#define SBF_EXCESS_COMMAND_BYTES
bool have_vertical_accuracy
does GPS give vertical position accuracy? Set to true only once available.
float speed_accuracy
3D velocity RMS accuracy estimate in m/s
AP_HAL::UARTDriver * port
UART we are attached to.
bool have_horizontal_accuracy
does GPS give horizontal position accuracy? Set to true only once available.
float horizontal_accuracy
horizontal RMS accuracy estimate in m
void broadcast_configuration_failure_reason(void) const override
float ground_speed
ground speed in m/sec
static const uint8_t SBF_PREAMBLE2
Receiving valid messages and 3D lock.
float vertical_accuracy
vertical RMS accuracy estimate in m
uint32_t _config_last_ack_time
uint16_t hdop
horizontal dilution of precision in cm
#define LOG_PACKET_HEADER_INIT(id)
bool prepare_for_arming(void) override
uint16_t crc16_ccitt(const uint8_t *buf, uint32_t len, uint16_t crc)
uint8_t num_sats
Number of visible satellites.
bool have_speed_accuracy
does GPS give speed accuracy? Set to true only once available.
float ground_course
ground course in degrees
bool is_healthy(void) const override