use crate::frame::enums::{Parameters, Response};
use crate::frame::parameters::messaging;
impl TryFrom<Parameters> for messaging::address_table_entry_is_active::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::AddressTableEntryIsActive(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::get_address_table_remote_eui64::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::GetAddressTableRemoteEui64(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::get_address_table_remote_node_id::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::GetAddressTableRemoteNodeId(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::get_beacon_classification_params::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::GetBeaconClassificationParams(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::get_extended_timeout::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(messaging::Response::GetExtendedTimeout(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::get_multicast_table_entry::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::GetMulticastTableEntry(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::lookup_eui64_by_node_id::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::LookupEui64ByNodeId(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::lookup_node_id_by_eui64::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::LookupNodeIdByEui64(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::maximum_payload_length::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::MaximumPayloadLength(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::poll_for_data::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(messaging::Response::PollForData(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::proxy_broadcast::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(messaging::Response::ProxyBroadcast(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::replace_address_table_entry::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::ReplaceAddressTableEntry(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::send_broadcast::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(messaging::Response::SendBroadcast(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::send_many_to_one_route_request::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::SendManyToOneRouteRequest(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::send_multicast::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(messaging::Response::SendMulticast(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::send_multicast_with_alias::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::SendMulticastWithAlias(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::send_raw_message::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(messaging::Response::SendRawMessage(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::send_raw_message_extended::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::SendRawMessageExtended(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::send_reply::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(messaging::Response::SendReply(response))) => {
Ok(response)
}
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::send_unicast::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(messaging::Response::SendUnicast(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::set_address_table_remote_eui64::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::SetAddressTableRemoteEui64(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::set_address_table_remote_node_id::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::SetAddressTableRemoteNodeId(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::set_beacon_classification_params::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::SetBeaconClassificationParams(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::set_extended_timeout::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(messaging::Response::SetExtendedTimeout(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::set_mac_poll_failure_wait_time::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::SetMacPollFailureWaitTime(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::set_multicast_table_entry::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::SetMulticastTableEntry(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::set_source_route_discovery_mode::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::SetSourceRouteDiscoveryMode(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::unicast_current_network_key::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(
messaging::Response::UnicastCurrentNetworkKey(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for messaging::write_node_data::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Messaging(messaging::Response::WriteNodeData(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}