pub struct FlashChannel {Show 29 fields
pub rx_frequency: Frequency,
pub tx_offset: Frequency,
pub step_size: StepSize,
pub byte08_low: u8,
pub mode: MemoryMode,
pub narrow: bool,
pub fine_mode: bool,
pub fine_step: FineStep,
pub byte09_bit7: bool,
pub tone_enabled: bool,
pub ctcss_enabled: bool,
pub dtcs_enabled: bool,
pub cross_tone: bool,
pub byte0a_bit3: bool,
pub split: bool,
pub duplex: FlashDuplex,
pub tone_code: ToneCode,
pub ctcss_code: ToneCode,
pub byte0c_high: u8,
pub dcs_code: DcsCode,
pub byte0d_bit7: bool,
pub cross_tone_type: CrossToneType,
pub digital_squelch: FlashDigitalSquelch,
pub byte0e_reserved: u8,
pub ur_call: DstarCallsign,
pub rpt1: DstarCallsign,
pub rpt2: DstarCallsign,
pub dv_code: u8,
pub byte27_bit7: bool,
}Expand description
40-byte flash memory channel structure.
Maps byte-for-byte to the MCP programming memory and .d75 file format.
Field layout derived from firmware analysis.
This struct represents the flash encoding, which differs from the
CAT wire format (ChannelMemory) in several ways:
- Mode (byte 0x09 bits [6:4]): 8 modes including HF (LSB/USB/CW) and DR, vs 4 modes in CAT.
- Tone/duplex (byte 0x0A): structured bit fields for tone, CTCSS, DTCS, cross-tone, split, and duplex direction.
- D-STAR callsigns (bytes 0x0F-0x26): three separate 8-byte fields (UR, RPT1, RPT2) instead of one 24-byte blob.
- Cross-tone / digital squelch (byte 0x0E): cross-tone type and per-channel digital squelch mode.
The per-field offsets documented on each struct member below are the complete byte map, correlated against MCP memory dumps from hardware.
Fields§
§rx_frequency: FrequencyRX frequency in Hz (offset 0x00, 4 bytes, little-endian).
tx_offset: FrequencyTX offset or split TX frequency in Hz (offset 0x04, 4 bytes, little-endian).
step_size: StepSizeFrequency step size (offset 0x08 bits [7:4]).
byte08_low: u8Raw low nibble of byte 0x08 (split tune step / unknown bit 0).
mode: MemoryModeOperating mode (offset 0x09 bits [6:4]).
narrow: boolNarrow FM flag (offset 0x09 bit 3).
fine_mode: boolFine tuning mode enabled (offset 0x09 bit 2).
fine_step: FineStepFine tuning step size (offset 0x09 bits [1:0]).
byte09_bit7: boolRaw bit 7 of byte 0x09 (unknown / reserved).
tone_enabled: boolTone encode enable (offset 0x0A bit 7).
ctcss_enabled: boolCTCSS encode+decode enable (offset 0x0A bit 6).
dtcs_enabled: boolDTCS (DCS) enable (offset 0x0A bit 5).
cross_tone: boolCross-tone mode enable (offset 0x0A bit 4).
byte0a_bit3: boolRaw bit 3 of byte 0x0A (unknown / reserved).
split: boolOdd split flag (offset 0x0A bit 2). When set, tx_offset is an
absolute TX frequency rather than a repeater offset.
duplex: FlashDuplexDuplex direction (offset 0x0A bits [1:0]).
tone_code: ToneCodeCTCSS TX tone index (offset 0x0B, 0-49).
ctcss_code: ToneCodeCTCSS RX tone index (offset 0x0C bits [5:0]).
byte0c_high: u8Raw high bits of byte 0x0C (bits [7:6], unknown).
dcs_code: DcsCodeDCS code index (offset 0x0D bits [6:0]).
byte0d_bit7: boolRaw bit 7 of byte 0x0D (unknown / reserved).
cross_tone_type: CrossToneTypeCross-tone type (offset 0x0E bits [5:4]).
digital_squelch: FlashDigitalSquelchDigital squelch mode (offset 0x0E bits [1:0]).
byte0e_reserved: u8Raw bits of byte 0x0E that are not cross-tone or digital squelch (bits [7:6] and [3:2]).
ur_call: DstarCallsignD-STAR UR callsign (offset 0x0F, 8 bytes, space-padded).
rpt1: DstarCallsignD-STAR RPT1 callsign (offset 0x17, 8 bytes, space-padded).
rpt2: DstarCallsignD-STAR RPT2 callsign (offset 0x1F, 8 bytes, space-padded).
dv_code: u8D-STAR DV code (offset 0x27 bits [6:0], 0-127).
byte27_bit7: boolRaw bit 7 of byte 0x27 (unknown / reserved).
Implementations§
Source§impl FlashChannel
impl FlashChannel
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, ProtocolError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ProtocolError>
Parses a flash channel from a byte slice (must be >= 40 bytes).
§Errors
Returns ProtocolError::FieldParse if any field contains an
invalid value, or if the slice is too short.
Trait Implementations§
Source§impl Clone for FlashChannel
impl Clone for FlashChannel
Source§fn clone(&self) -> FlashChannel
fn clone(&self) -> FlashChannel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more