GpsAccess

Struct GpsAccess 

Source
pub struct GpsAccess<'a> { /* private fields */ }
Expand description

Read-only access to the GPS configuration region.

Provides raw byte access and typed field accessors for the estimated GPS settings region. All offsets are estimates and need verification via differential memory dumps.

§Known settings (from menu analysis, offsets estimated)

  • Built-in GPS on/off
  • My Position (5 manual slots, each with lat/lon/alt)
  • Position ambiguity setting
  • GPS operating mode (standalone/SBAS)
  • PC output format (NMEA sentences enabled/disabled)
  • Track log settings (record method, interval, distance)
  • GPS data TX settings (auto TX, interval)

Implementations§

Source§

impl<'a> GpsAccess<'a>

Source

pub fn estimated_region(&self) -> Option<&[u8]>

Get the raw bytes at the estimated GPS region.

Returns the bytes at offset 0x19000 through 0x19FFF. These boundaries are estimates and may not perfectly align with the actual GPS configuration data.

Source

pub fn read_bytes(&self, offset: usize, len: usize) -> Option<&[u8]>

Read an arbitrary byte range from the image.

The offset is an absolute MCP byte address. Returns None if the range extends past the image.

Source

pub const fn estimated_region_size(&self) -> usize

Get the estimated size of the GPS region in bytes.

Source

pub fn gps_enabled(&self) -> bool

Read GPS enabled setting.

§Offset

Estimated at 0x19000 (first byte of the GPS region).

§Verification

Offset is estimated, not hardware-verified.

Source

pub fn pc_output(&self) -> bool

Read GPS PC output setting.

§Offset

Estimated at 0x19001.

§Verification

Offset is estimated, not hardware-verified.

Source

pub fn operating_mode(&self) -> GpsOperatingMode

Read GPS operating mode.

§Offset

Estimated at 0x19002.

§Verification

Offset is estimated, not hardware-verified.

Source

pub fn battery_saver(&self) -> bool

Read GPS battery saver setting.

§Offset

Estimated at 0x19003.

§Verification

Offset is estimated, not hardware-verified.

Source

pub fn position_ambiguity(&self) -> GpsPositionAmbiguity

Read GPS position ambiguity level.

§Offset

Estimated at 0x19004.

§Verification

Offset is estimated, not hardware-verified.

Source

pub fn nmea_sentence_flags(&self) -> u8

Read NMEA sentence output flags as a raw byte.

Bit field: bit 0 = GGA, bit 1 = GLL, bit 2 = GSA, bit 3 = GSV, bit 4 = RMC, bit 5 = VTG. Returns 0x3F (all enabled) if unreadable.

§Offset

Estimated at 0x19005.

§Verification

Offset is estimated, not hardware-verified.

Source

pub fn nmea_sentence_enabled(&self, bit: u8) -> bool

Check if a specific NMEA sentence is enabled.

bit selects the sentence: 0 = GGA, 1 = GLL, 2 = GSA, 3 = GSV, 4 = RMC, 5 = VTG.

§Offset

Estimated at 0x19005.

§Verification

Offset is estimated, not hardware-verified.

Source

pub fn channel_index_raw(&self) -> Option<&[u8]>

Get the raw GPS channel index (100 bytes at 0x4D000).

Each byte is either 0xFF (unused) or an index into the waypoint data area.

Returns None if the region extends past the image.

Source

pub fn channel_index(&self, slot: u8) -> Option<u8>

Get the GPS channel index value for a given slot (0-99).

Returns None if the slot is unused (0xFF) or out of range. Otherwise returns the waypoint data index.

Source

pub fn waypoint_count(&self) -> usize

Count the number of active (non-empty) GPS waypoint slots.

Iterates the 100-entry GPS channel index and counts entries that are not 0xFF.

Source

pub fn waypoint_raw(&self, slot: u8) -> Option<&[u8]>

Get the raw waypoint record for a given channel index slot (0-99).

Looks up the waypoint data index from the GPS channel index, then reads the 32-byte waypoint record at the calculated address: (index_value + 0x2608) * 0x20.

Returns None if the slot is unused, out of range, or the record extends past the image.

Source

pub fn waypoint_name(&self, slot: u8) -> String

Read the name field from a GPS waypoint record (up to 8 characters).

Returns an empty string if the slot is unused or the record cannot be read. The name is at offset 0x10 within the 32-byte record, 9 bytes (8 characters + null terminator). A first byte of 0xFE indicates an unused name.

Trait Implementations§

Source§

impl<'a> Debug for GpsAccess<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for GpsAccess<'a>

§

impl<'a> RefUnwindSafe for GpsAccess<'a>

§

impl<'a> Send for GpsAccess<'a>

§

impl<'a> Sync for GpsAccess<'a>

§

impl<'a> Unpin for GpsAccess<'a>

§

impl<'a> UnwindSafe for GpsAccess<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more