Documentation
¶
Index ¶
Constants ¶
const FormatVersion = 1
FormatVersion is the current backup format version.
Variables ¶
This section is empty.
Functions ¶
func DecodeIEEEAddr ¶
DecodeIEEEAddr decodes a hex string to IEEE address.
func EncodeIEEEAddr ¶
EncodeIEEEAddr encodes an IEEE address to hex string.
Types ¶
type AdapterInfo ¶
type AdapterInfo struct {
ZStackVariant int `json:"zstackVariant"`
SDKVersion string `json:"sdkVersion"`
BuildDate uint32 `json:"buildDate"`
}
AdapterInfo contains adapter firmware information.
type Backup ¶
type Backup struct {
Version int `json:"version"`
Created time.Time `json:"created"`
Adapter AdapterInfo `json:"adapter"`
Coordinator CoordinatorInfo `json:"coordinator"`
Network NetworkConfig `json:"network"`
Security SecurityInfo `json:"security"`
Devices []DeviceEntry `json:"devices"`
}
Backup represents a complete adapter backup.
type CoordinatorInfo ¶
type CoordinatorInfo struct {
IEEEAddress string `json:"ieeeAddress"` // Hex string without colons
NetworkAddress uint16 `json:"networkAddress"`
}
CoordinatorInfo contains coordinator address information.
type DeviceEntry ¶
type DeviceEntry struct {
IEEEAddress string `json:"ieeeAddress"` // Hex string
NetworkAddress uint16 `json:"networkAddress"`
Type string `json:"type"` // "router", "endDevice", "unknown"
LinkKey *LinkKey `json:"linkKey,omitempty"`
}
DeviceEntry represents a paired device.
type LinkKey ¶
type LinkKey struct {
Key string `json:"key"` // Hex string (32 chars)
TxCounter uint32 `json:"txCounter"`
RxCounter uint32 `json:"rxCounter"`
}
LinkKey contains link key information for a device.
type NetworkConfig ¶
type NetworkConfig struct {
PanID uint16 `json:"panId"`
ExtendedPanID string `json:"extendedPanId"` // Hex string
Channel uint8 `json:"channel"`
NetworkKey string `json:"networkKey"` // Hex string (32 chars) - SENSITIVE
NetworkKeySequence uint8 `json:"networkKeySequence"`
SecurityLevel uint8 `json:"securityLevel"`
UpdateID uint8 `json:"updateId"`
}
NetworkConfig contains network configuration.
SECURITY WARNING: This struct contains sensitive cryptographic material. The NetworkKey is the Zigbee network encryption key - if compromised, attackers can decrypt all network traffic and inject malicious commands.
Best practices:
- Never commit backup files to version control
- Store backup files with restricted file permissions (0600)
- Consider encrypting backup files at rest
- Securely delete backup files when no longer needed
type SecurityInfo ¶
type SecurityInfo struct {
FrameCounter uint32 `json:"frameCounter"`
TrustCenterLinkKeySeed string `json:"trustCenterLinkKeySeed,omitempty"` // Hex string
}
SecurityInfo contains security-related information.