openthread_fuchsia/backing/
reset.rsuse super::*;
use std::sync::atomic::Ordering;
#[derive(thiserror::Error, Debug, Hash)]
#[error("PlatformResetRequested")]
pub struct PlatformResetRequested {}
impl PlatformBacking {
fn on_plat_reset(&self, instance: Option<&ot::Instance>) {
#[no_mangle]
unsafe extern "C" fn otPlatReset(instance: *mut otsys::otInstance) {
PlatformBacking::on_plat_reset(
PlatformBacking::as_ref(),
ot::Instance::ref_from_ot_ptr(instance),
)
}
if let Some(instance) = instance {
instance.thread_set_enabled(false).unwrap();
instance.ip6_set_enabled(false).unwrap();
}
self.is_platform_reset_requested.store(true, Ordering::SeqCst);
info!("on_plat_reset for {:?}", instance);
}
}