Browse Source

add `load_network_slot` (commented out atm)

pull/140/head
Lena 1 year ago committed by Lena
parent
commit
3f6beae7b0
No known key found for this signature in database
GPG Key ID: 5A940B96C2DA3683
  1. 40
      ctru-rs/src/services/ac.rs
  2. 2
      ctru-rs/src/services/mod.rs

40
ctru-rs/src/services/ac.rs

@ -268,6 +268,34 @@ impl Ac {
Ok(String::from_utf8(vec).unwrap()) Ok(String::from_utf8(vec).unwrap())
} }
} }
/*
/// Load the selected network slot, if present.
///
/// Note: this method requires `ac:i` access
/// # Example
///
/// ```
/// # let _runner = test_runner::GdbRunner::default();
/// # use std::error::Error;
/// # fn main() -> Result<(), Box<dyn Error>> {
/// #
/// use ctru::services::ac::Ac;
///
/// let ac = Ac::new()?;
///
/// ac.load_network_slot(NetworkSlot::Second)?;
/// #
/// # Ok(())
/// # }
/// ```
#[doc(alias = "ACI_LoadNetworkSetting")]
pub fn load_network_slot(&self, slot: NetworkSlot) -> crate::Result<()> {
unsafe {
ResultCode(ctru_sys::ACI_LoadNetworkSetting(slot as u32))?;
Ok(())
}
}*/
} }
impl Drop for Ac { impl Drop for Ac {
@ -288,5 +316,15 @@ pub enum SecurityMode {
WPA_TKIP = 4, WPA_TKIP = 4,
WPA2_TKIP = 5, WPA2_TKIP = 5,
WPA_AES = 6, WPA_AES = 6,
WPA2_AES = 7 WPA2_AES = 7,
}
/*
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[repr(u32)]
pub enum NetworkSlot {
First = 0,
Second = 1,
Third = 2
} }
*/

2
ctru-rs/src/services/mod.rs

@ -11,6 +11,7 @@
//! //!
//! In [`ctru-rs`](crate) some services only allow a single handle to be created at a time, to ensure a safe and controlled environment. //! In [`ctru-rs`](crate) some services only allow a single handle to be created at a time, to ensure a safe and controlled environment.
pub mod ac;
pub mod am; pub mod am;
pub mod apt; pub mod apt;
pub mod cam; pub mod cam;
@ -26,7 +27,6 @@ mod reference;
pub mod soc; pub mod soc;
pub mod sslc; pub mod sslc;
pub mod svc; pub mod svc;
pub mod ac;
cfg_if::cfg_if! { cfg_if::cfg_if! {
if #[cfg(all(feature = "romfs", romfs_exists))] { if #[cfg(all(feature = "romfs", romfs_exists))] {

Loading…
Cancel
Save