-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
161 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#![allow(dead_code)] | ||
use crate::aps::types; | ||
|
||
type DstAddrMode = u8; | ||
// 2.2.4.1.1 | ||
struct ApsdeSapRequest { | ||
dst_addr_mode: DstAddrMode, | ||
dst_address: u8, | ||
dst_endpoint: u8, | ||
profile_id: u16, | ||
cluster_id: u16, | ||
src_endpoint: types::SrcEndpoint, | ||
asdulength: u8, | ||
asdu: u8, | ||
tx_options: bitmaps::Bitmap<8>, | ||
use_alias: bool, | ||
alias_src_addr: u16, | ||
alias_seq_number: u8, | ||
radius_counter: u8 | ||
} | ||
|
||
enum ApsdeSapConfirmStatus { | ||
Success, | ||
NoShortAddress, | ||
NoBoundDevice, | ||
SecurityFail, | ||
NoAck, | ||
AsduTooLong | ||
} | ||
// 2.2.4.1.2 | ||
struct ApsdeSapConfirm { | ||
dst_addr_mode: DstAddrMode, | ||
dst_address: u8, | ||
dst_endpoint: u8, | ||
src_endpoint: types::SrcEndpoint, | ||
status: ApsdeSapConfirmStatus, | ||
tx_time: u8, | ||
} | ||
|
||
enum ApsdeSapIndicationStatus { | ||
Success, | ||
DefragUnsupported, | ||
DefragDeferred | ||
} | ||
enum SecurityStatus { | ||
Unsecured, | ||
SecuredNwkKey, | ||
SecuredLinkKey | ||
} | ||
|
||
// 2.2.4.1.3 | ||
struct ApsdeSapIndication { | ||
dst_addr_mode: DstAddrMode, | ||
dst_address: u8, | ||
dst_endpoint: u8, | ||
src_addr_mode: u8, | ||
src_address: u64, | ||
src_endpoint: types::SrcEndpoint, | ||
profile_id: u16, | ||
cluster_id: u16, | ||
asdulength: u8, | ||
status: ApsdeSapIndicationStatus, | ||
security_status: SecurityStatus, | ||
link_quality: u8, | ||
rx_time: u8, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#![allow(dead_code)] | ||
use crate::aps::types; | ||
|
||
type DstAddrMode = u8; | ||
// 2.2.4.3.1 APSME-BIND.request | ||
struct ApsmeBindRequest { | ||
src_address: u64, | ||
src_endpoint: types::SrcEndpoint, | ||
cluster_id: u16, | ||
dst_addr_mode: DstAddrMode, | ||
dst_address: u8, | ||
dst_endpoint: u8, | ||
} | ||
|
||
enum ApsmeBindRequestStatus { | ||
Success, | ||
IllegalRequest, | ||
TableFull, | ||
NotSupported | ||
} | ||
|
||
// 2.2.4.3.2 APSME-BIND.confirm | ||
struct ApsmeBindConfirm { | ||
status: ApsmeBindRequestStatus, | ||
src_address: u64, | ||
src_endpoint: types::SrcEndpoint, | ||
cluster_id: u16, | ||
dst_addr_mode: DstAddrMode, | ||
dst_address: u8, | ||
dst_endpoint: u8, | ||
} | ||
|
||
// 2.2.4.3.3 APSME-UNBIND.request | ||
struct ApsmeUnbindRequest { | ||
src_address: u64, | ||
src_endpoint: types::SrcEndpoint, | ||
cluster_id: u16, | ||
dst_addr_mode: DstAddrMode, | ||
dst_address: u8, | ||
dst_endpoint: u8, | ||
} | ||
|
||
enum ApsmeUnbindRequestStatus { | ||
Success, | ||
IllegalRequest, | ||
InvalidBinding | ||
} | ||
// 2.2.4.3.4 APSME-UNBIND.confirm | ||
struct ApsmeUnbindConfirm { | ||
status: ApsmeUnbindRequestStatus, | ||
src_address: u64, | ||
src_endpoint: types::SrcEndpoint, | ||
cluster_id: u16, | ||
dst_addr_mode: DstAddrMode, | ||
dst_address: u8, | ||
dst_endpoint: u8, | ||
} | ||
|
||
enum AIBAttribute { | ||
IapsBindingTable = 0xc1, | ||
ApsDesignatedCoordinator = 0xc2, | ||
ApsChannelMaskList = 0xc3, | ||
ApsUseExtendedPANID = 0xc4, | ||
ApsGroupTable = 0xc5, | ||
ApsNonmemberRadius = 0xc6, | ||
ApsUseInsecureJoin = 0xc8, | ||
ApsInterframeDelay = 0xc9, | ||
ApsLastChannelEnergy = 0xca, | ||
ApsLastChannelFailureRate = 0xcb, | ||
ApsChannelTimer = 0xcc, | ||
ApsMaxWindowSize = 0xcd, | ||
ApsParentAnnounceTimer = 0xce, | ||
} | ||
|
||
// 2.2.4.4.1 APSME-GET.request | ||
struct ApsmeGetRequest { | ||
attribute: AIBAttribute | ||
} | ||
|
||
struct AIBAttributeValue { | ||
|
||
} | ||
|
||
struct ApsmeGetConfirm { | ||
status: u8, | ||
attribute: AIBAttribute, | ||
attribute_length: u8, | ||
attribute_value: AIBAttributeValue, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,6 @@ | ||
#![allow(dead_code)] | ||
pub(crate) mod types; | ||
pub(crate) mod error; | ||
|
||
mod error; | ||
mod types; | ||
|
||
trait ApsdeSap { | ||
|
||
} | ||
|
||
type DstAddrMode = u8; | ||
// 2.2.4.1.1 | ||
struct ApsdeSapRequest { | ||
dst_addr_mode: DstAddrMode, | ||
dst_address: u8, | ||
dst_endpoint: u8, | ||
profile_id: u16, | ||
cluster_id: u16, | ||
src_endpoint: types::SrcEndpoint, | ||
asdulength: u8, | ||
asdu: u8, | ||
tx_options: bitmaps::Bitmap<8>, | ||
use_alias: bool, | ||
alias_src_addr: u16, | ||
alias_seq_number: u8, | ||
radius_counter: u8 | ||
} | ||
|
||
enum ApsdeSapConfirmStatus { | ||
Success, | ||
NoShortAddress, | ||
NoBoundDevice, | ||
SecurityFail, | ||
NoAck, | ||
AsduTooLong | ||
} | ||
// 2.2.4.1.2 | ||
struct ApsdeSapConfirm { | ||
dst_addr_mode: DstAddrMode, | ||
dst_address: u8, | ||
dst_endpoint: u8, | ||
src_endpoint: types::SrcEndpoint, | ||
status: ApsdeSapConfirmStatus, | ||
tx_time: u8, | ||
} | ||
|
||
enum ApsdeSapIndicationStatus { | ||
Success, | ||
DefragUnsupported, | ||
DefragDeferred | ||
} | ||
enum SecurityStatus { | ||
Unsecured, | ||
SecuredNwkKey, | ||
SecuredLinkKey | ||
} | ||
|
||
// 2.2.4.1.3 | ||
struct ApsdeSapIndication { | ||
dst_addr_mode: DstAddrMode, | ||
dst_address: u8, | ||
dst_endpoint: u8, | ||
src_addr_mode: u8, | ||
src_address: u64, | ||
src_endpoint: types::SrcEndpoint, | ||
profile_id: u16, | ||
cluster_id: u16, | ||
asdulength: u8, | ||
status: ApsdeSapIndicationStatus, | ||
security_status: SecurityStatus, | ||
link_quality: u8, | ||
rx_time: u8, | ||
} | ||
pub(crate) mod apsde; | ||
pub(crate) mod apsme; | ||
|