pub struct ChannelName(/* private fields */);Expand description
D-STAR URCALL callsign (up to 8 characters, stored in 24 bytes).
The TH-D75 stores this field in a 24-byte region to accommodate multi-byte character encodings such as Shift-JIS (Japanese Industrial Standards) on Japanese-market models. This type validates ASCII-only content with a maximum of 8 characters.
Despite being labeled “Channel Name” in some documentation, this field stores the D-STAR “UR” (your) callsign, defaulting to “CQCQCQ” for general CQ calls. User-assigned channel display names are stored separately in flash and are only accessible via the MCP programming interface.
Implementations§
Source§impl ChannelName
impl ChannelName
Sourcepub fn new(name: &str) -> Result<Self, ValidationError>
pub fn new(name: &str) -> Result<Self, ValidationError>
Creates a new ChannelName from a string slice.
§Errors
Returns ValidationError::ChannelNameTooLong if the callsign
exceeds 8 characters.
Sourcepub fn to_bytes(&self) -> [u8; 24]
pub fn to_bytes(&self) -> [u8; 24]
Encodes the URCALL callsign as a 24-byte null-padded ASCII array.
Sourcepub fn from_bytes(bytes: &[u8; 24]) -> Self
pub fn from_bytes(bytes: &[u8; 24]) -> Self
Decodes a URCALL callsign from a 24-byte null-padded array.
Scans for the first null byte and takes ASCII characters up to that point. If no null byte is found, takes up to 8 characters.
Trait Implementations§
Source§impl Clone for ChannelName
impl Clone for ChannelName
Source§fn clone(&self) -> ChannelName
fn clone(&self) -> ChannelName
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more