use crate::frame::enums::{Parameters, Response};
use crate::frame::parameters::zll;
impl TryFrom<Parameters> for zll::clear_tokens::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::ClearTokens(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::get_primary_channel_mask::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::GetPrimaryChannelMask(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::get_secondary_channel_mask::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::GetSecondaryChannelMask(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::get_tokens::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::GetTokens(response))) => {
Ok(*response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::is_zll_network::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::IsZllNetwork(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::network_ops::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::NetworkOps(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::operation_in_progress::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::OperationInProgress(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::rx_on_when_idle_get_active::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::RxOnWhenIdleGetActive(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::set_additional_state::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::SetAdditionalState(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::set_data_token::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::SetDataToken(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::set_initial_security_state::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::SetInitialSecurityState(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::set_node_type::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::SetNodeType(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::set_non_zll_network::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::SetNonZllNetwork(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::set_primary_channel_mask::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::SetPrimaryChannelMask(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::set_radio_idle_mode::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::SetRadioIdleMode(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::set_rx_on_when_idle::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::SetRxOnWhenIdle(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::set_secondary_channel_mask::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::SetSecondaryChannelMask(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::set_security_state_without_key::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::SetSecurityStateWithoutKey(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for zll::start_scan::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Zll(zll::Response::StartScan(response))) => Ok(response),
_ => Err(parameters),
}
}
}