[−][src]Struct isis_ants_api::AntS
Structure for interacting with an ISIS Antenna System
Trait Implementations
impl IAntS for AntS
[src]
impl IAntS for AntS
fn new(
bus: &str,
primary: u8,
secondary: u8,
ant_count: u8,
timeout: u32
) -> AntSResult<AntS>
[src]
fn new(
bus: &str,
primary: u8,
secondary: u8,
ant_count: u8,
timeout: u32
) -> AntSResult<AntS>
Constructor
Opens a connection to the underlying I2C device
Arguments
- bus - The I2C bus to use to communicate with the device
- primary - The I2C address of the system's primary microcontroller
- secondary - The I2C address of the system's secondary microcontroller
(should be
0x00
if no secondary microcontroller is available) - ant_count - The number of antennas present in the antenna system
- timeout - The watchdog timeout interval, in seconds
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
use isis_ants_api::*; let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?;
fn configure(&self, config: KANTSController) -> AntSResult<()>
[src]
fn configure(&self, config: KANTSController) -> AntSResult<()>
Configure the system to send future commands to the requested microcontroller
Arguments
- config - The microcontroller which should be used for future commands to the antenna system
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x00, 2, 20)?; ants.configure(KANTSController::Secondary)?;
fn reset(&self) -> AntSResult<()>
[src]
fn reset(&self) -> AntSResult<()>
Reset both of the antenna's microcontrollers
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?; ants.reset()?;
fn arm(&self) -> AntSResult<()>
[src]
fn arm(&self) -> AntSResult<()>
Arm the antenna system for deployment
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?; ants.arm()?;
fn disarm(&self) -> AntSResult<()>
[src]
fn disarm(&self) -> AntSResult<()>
Disarm the antenna system
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?; ants.disarm()?;
fn deploy(&self, antenna: KANTSAnt, force: bool, timeout: u8) -> AntSResult<()>
[src]
fn deploy(&self, antenna: KANTSAnt, force: bool, timeout: u8) -> AntSResult<()>
Deploy a particular antenna
Arguments
- antenna - The antenna to deploy
- force - Whether the system should ignore previous successful deployment
- timeout - The maximum time, in seconds, the system should spend deploying the antenna
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x00, 2, 20)?; ants.deploy(KANTSAnt::Ant2, false, 10)?;
fn auto_deploy(&self, timeout: u8) -> AntSResult<()>
[src]
fn auto_deploy(&self, timeout: u8) -> AntSResult<()>
Auto-deploy all antennas sequentially.
Arguments
- timeout - The maximum time, in seconds, the system should spend deploying each antenna
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x00, 2, 20)?; ants.auto_deploy(5)?;
fn cancel_deploy(&self) -> AntSResult<()>
[src]
fn cancel_deploy(&self) -> AntSResult<()>
Cancel all current deployment actions
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?; ants.cancel_deploy()?;
fn get_deploy(&self) -> AntSResult<DeployStatus>
[src]
fn get_deploy(&self) -> AntSResult<DeployStatus>
Get the current deployment status
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?; let deploy = ants.get_deploy()?; println!("Antenna 1 deployed: {}", !deploy.ant_1_not_deployed); println!("Antenna 2 deployment active: {}", deploy.ant_2_active);
fn get_uptime(&self) -> AntSResult<u32>
[src]
fn get_uptime(&self) -> AntSResult<u32>
Get the system's uptime
Returns the systems uptime, in seconds
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?; let uptime = ants.get_uptime()?; println!("Antenna system uptime: {}", uptime);
fn get_system_telemetry(&self) -> AntSResult<AntsTelemetry>
[src]
fn get_system_telemetry(&self) -> AntSResult<AntsTelemetry>
Get the current system telemetry
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?; let sys_telem = ants.get_system_telemetry()?; println!("Antenna system telemetry:"); println!(" raw_temp: {}", sys_telem.raw_temp); println!(" deploy_status:"); println!(" Antenna 1 deployed: {}", !sys_telem.deploy_status.ant_1_not_deployed); println!(" Antenna 2 deployment active: {}", sys_telem.deploy_status.ant_2_active); println!(" uptime: {}\n", sys_telem.uptime);
fn get_activation_count(&self, antenna: KANTSAnt) -> AntSResult<u8>
[src]
fn get_activation_count(&self, antenna: KANTSAnt) -> AntSResult<u8>
Get an antenna's activation count
Arguments
- antenna - Antenna to query
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x00, 2, 20)?; let act_count = ants.get_activation_count(KANTSAnt::Ant3)?; println!("Antenna 3 activation count - {}", act_count);
fn get_activation_time(&self, antenna: KANTSAnt) -> AntSResult<u16>
[src]
fn get_activation_time(&self, antenna: KANTSAnt) -> AntSResult<u16>
Get an antenna's activation time
Returns the total amount of time spent attempting to active the antenna, in seconds
Arguments
- antenna - Antenna to query
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x00, 2, 20)?; let act_count = ants.get_activation_time(KANTSAnt::Ant1)?; println!("Antenna 1 activation time - {}", act_count);
fn watchdog_kick(&self) -> AntSResult<()>
[src]
fn watchdog_kick(&self) -> AntSResult<()>
Kick both antenna system's watchdogs once
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?; ants.watchdog_kick()?;
fn watchdog_start(&self) -> AntSResult<()>
[src]
fn watchdog_start(&self) -> AntSResult<()>
Start a thread to kick the system's watchdogs at an interval of (timeout)/3 seconds
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?; ants.watchdog_start()?;
fn watchdog_stop(&self) -> AntSResult<()>
[src]
fn watchdog_stop(&self) -> AntSResult<()>
Stop the watchdog thread
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x32, 4, 10)?; ants.watchdog_start()?; //... ants.watchdog_stop()?;
fn passthrough(&self, tx: &[u8], rx_in: &mut [u8]) -> AntSResult<()>
[src]
fn passthrough(&self, tx: &[u8], rx_in: &mut [u8]) -> AntSResult<()>
Pass a command packet directly through to the antenna system Useful for executing commands which have not been implemented in either the generic or specific antenna APIs.
Arguments
- tx - Reference to byte array data to send
- rx - Reference to byte array which returned data should be stored in
Errors
If this function encounters any errors, an AntsError
variant will be returned.
Examples
let ants = AntS::new("KI2C1", 0x31, 0x00, 2, 20)?; let tx: [u8; 1] = [0xC3]; let mut rx: [u8; 2] = [0; 2]; ants.passthrough(&tx, &mut rx).unwrap(); println!("Antenna passthrough response: {:?}", rx);
impl Clone for AntS
[src]
impl Clone for AntS
fn clone(&self) -> AntS
[src]
fn clone(&self) -> AntS
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Drop for AntS
[src]
impl Drop for AntS
Close the connection to the I2C bus
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T