Struct probe_rs_cli_util::rtt::RttActiveChannel
source · pub struct RttActiveChannel {
pub up_channel: Option<UpChannel>,
pub down_channel: Option<DownChannel>,
pub channel_name: String,
pub data_format: DataFormat,
/* private fields */
}Expand description
This is the primary interface through which RTT channel data is read and written. Every actual RTT channel has a configuration and buffer that is used for this purpose.
Fields§
§up_channel: Option<UpChannel>§down_channel: Option<DownChannel>§channel_name: String§data_format: DataFormatImplementations§
source§impl RttActiveChannel
impl RttActiveChannel
A fully configured RttActiveChannel. The configuration will always try to ‘default’ based on information read from the RTT control block in the binary. Where insufficient information is available, it will use the supplied configuration, with final hardcoded defaults where no other information was available.
pub fn new(
up_channel: Option<UpChannel>,
down_channel: Option<DownChannel>,
channel_config: Option<RttChannelConfig>,
timestamp_offset: UtcOffset
) -> Self
sourcepub fn poll_rtt(&mut self, core: &mut Core<'_>) -> Option<usize>
pub fn poll_rtt(&mut self, core: &mut Core<'_>) -> Option<usize>
Polls the RTT target for new data on the channel represented by self.
Processes all the new data into the channel internal buffer and returns the number of bytes that was read.
sourcepub fn get_rtt_data(
&mut self,
core: &mut Core<'_>,
defmt_state: Option<&(Table, Option<Locations>)>
) -> Result<Option<(String, String)>, Error>
pub fn get_rtt_data(
&mut self,
core: &mut Core<'_>,
defmt_state: Option<&(Table, Option<Locations>)>
) -> Result<Option<(String, String)>, Error>
Retrieves available data from the channel and if available, returns Some(channel_number:String, formatted_data:String).
If no data is available, or we encounter a recoverable error, it returns None value fore formatted_data.
Non-recoverable errors are propagated to the caller.