From 4ab6bd910b9dd9285d59658b2bd47cd1383989b5 Mon Sep 17 00:00:00 2001 From: nicolaiw Date: Wed, 18 Nov 2020 14:15:44 +0100 Subject: [PATCH 01/10] remove locks and use ConcurrentDictionary instead --- libraries/ZigBeeNet/ZigBeeNetworkManager.cs | 46 ++++++++------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/libraries/ZigBeeNet/ZigBeeNetworkManager.cs b/libraries/ZigBeeNet/ZigBeeNetworkManager.cs index 52d47025..151cfc76 100644 --- a/libraries/ZigBeeNet/ZigBeeNetworkManager.cs +++ b/libraries/ZigBeeNet/ZigBeeNetworkManager.cs @@ -75,7 +75,7 @@ public class ZigBeeNetworkManager : IZigBeeNetwork, IZigBeeTransportReceive /// /// The groups in the ZigBee network /// - private Dictionary _networkGroups = new Dictionary(); + private ConcurrentDictionary _networkGroups = new ConcurrentDictionary(); /// /// The node listeners of the ZigBee network. Registered listeners will be @@ -507,7 +507,7 @@ public void Shutdown() Log.Debug("ZigBeeNetworkManager shutdown: networkState={NetworkState}", NetworkState); SetNetworkState(ZigBeeNetworkState.SHUTDOWN); - if(_clusterMatcher != null) + if (_clusterMatcher != null) { _clusterMatcher.Shutdown(); } @@ -698,7 +698,7 @@ public void ReceiveCommand(ZigBeeApsFrame apsFrame) announceListener.AnnounceUnknownDevice(apsFrame.SourceAddress); } } - else if(currentNode.NodeState != ZigBeeNodeState.ONLINE) + else if (currentNode.NodeState != ZigBeeNodeState.ONLINE) { // If command is received from a known node which is not ONLINE, mark it as ONLINE ZigBeeNode node = new ZigBeeNode(this, currentNode.IeeeAddress, currentNode.NetworkAddress); @@ -1075,12 +1075,12 @@ private Task Broadcast(ZigBeeCommand command) { lock (command) { - //ZigBeeTransactionFuture transactionFuture = new ZigBeeTransactionFuture(); + //ZigBeeTransactionFuture transactionFuture = new ZigBeeTransactionFuture(); - SendCommand(command); - //transactionFuture.set(new CommandResult(new BroadcastResponse())); + SendCommand(command); + //transactionFuture.set(new CommandResult(new BroadcastResponse())); - return new CommandResult(new BroadcastResponse()); + return new CommandResult(new BroadcastResponse()); } }); } @@ -1209,42 +1209,30 @@ public async Task Leave(ushort destinationAddress, IeeeAddress leaveAddress, boo public void AddGroup(ZigBeeGroupAddress group) { - lock (_networkGroups) - { - _networkGroups[group.GroupId] = group; - } + // https://referencesource.microsoft.com/#mscorlib/system/Collections/Concurrent/ConcurrentDictionary.cs,968 + _networkGroups[group.GroupId] = group; } public void UpdateGroup(ZigBeeGroupAddress group) { - lock (_networkGroups) - { - _networkGroups[group.GroupId] = group; - } + // https://referencesource.microsoft.com/#mscorlib/system/Collections/Concurrent/ConcurrentDictionary.cs,968 + _networkGroups[group.GroupId] = group; } public ZigBeeGroupAddress GetGroup(ushort groupId) { - lock (_networkGroups) - { - return _networkGroups[groupId]; - } + // https://referencesource.microsoft.com/#mscorlib/system/Collections/Concurrent/ConcurrentDictionary.cs,968 + return _networkGroups[groupId]; } public void RemoveGroup(ushort groupId) { - lock (_networkGroups) - { - _networkGroups.Remove(groupId); - } + _networkGroups.TryRemove(groupId, out _); } - public List GetGroups() + public IReadOnlyList GetGroups() { - lock (_networkGroups) - { - return _networkGroups.Values.ToList(); - } + return _networkGroups.Values.ToList().AsReadOnly(); } /// @@ -1387,7 +1375,7 @@ public void UpdateNode(ZigBeeNode node) // If the node is already known, refresh and return // We especially don't want to notify listeners - if(!_networkNodes.TryAdd(node.IeeeAddress, node)) + if (!_networkNodes.TryAdd(node.IeeeAddress, node)) { RefreshNode(node); return; From bb0d640866d6fd50447081ff2c05cd4d08d3355c Mon Sep 17 00:00:00 2001 From: Mr-Markus Date: Sun, 29 Nov 2020 13:59:24 +0100 Subject: [PATCH 02/10] Updated .NET Core version --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 7f02730e..1ade830d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "${workspaceFolder}/samples/ZigBeeNet.PlayGround/bin/Debug/netcoreapp3.0/ZigBeeNet.PlayGround.dll", + "program": "${workspaceFolder}/samples/ZigBeeNet.PlayGround/bin/Debug/netcoreapp3.1/ZigBeeNet.PlayGround.dll", "args": [], "cwd": "${workspaceFolder}/samples/ZigBeeNet.PlayGround", "console": "integratedTerminal", From baecfaf114393ed9d98451b51a50bcd7fc1f08e3 Mon Sep 17 00:00:00 2001 From: Olivier Blaise Date: Sun, 20 Dec 2020 09:41:30 +0100 Subject: [PATCH 03/10] Replace DoubleByte by ushort Remove all reference to DoubleByte and use ushort instead to avoid allocation on the heap for each DoubleByte object. --- .../Implementation/BlockingCommandReceiver.cs | 2 +- .../Implementation/CommandInterfaceImpl.cs | 20 ++-- .../Network/NetworkManager.cs | 4 +- .../Packet/AF/AF_DATA_CONFIRM.cs | 2 +- .../Packet/AF/AF_DATA_REQUEST.cs | 4 +- .../Packet/AF/AF_DATA_REQUEST_EXT.cs | 2 +- .../Packet/AF/AF_DATA_REQUEST_SRSP.cs | 2 +- .../Packet/AF/AF_DATA_SRSP.cs | 2 +- .../Packet/AF/AF_DATA_SRSP_EXT.cs | 2 +- .../Packet/AF/AF_INCOMING_MSG.cs | 10 +- .../Packet/AF/AF_REGISTER.cs | 2 +- .../Packet/AF/AF_REGISTER_SRSP.cs | 2 +- .../Packet/ErrorPacket.cs | 2 +- .../Packet/SYS/SYS_PING.cs | 2 +- .../Packet/SYS/SYS_PING_RESPONSE.cs | 14 +-- .../Packet/SYS/SYS_RESET.cs | 2 +- .../Packet/SYS/SYS_RESET_RESPONSE.cs | 2 +- .../Packet/SYS/SYS_RPC_ERROR.cs | 4 +- .../Packet/SYS/SYS_TEST_LOOPBACK.cs | 2 +- .../Packet/SYS/SYS_TEST_LOOPBACK_SRSP.cs | 2 +- .../Packet/SYS/SYS_VERSION.cs | 2 +- .../Packet/SYS/SYS_VERSION_RESPONSE.cs | 2 +- .../Packet/SimpleAPI/ZB_ALLOW_BIND.cs | 2 +- .../Packet/SimpleAPI/ZB_ALLOW_BIND_CONFIRM.cs | 2 +- .../Packet/SimpleAPI/ZB_ALLOW_BIND_RSP.cs | 4 +- .../SimpleAPI/ZB_APP_REGISTER_REQUEST.cs | 38 +++---- .../Packet/SimpleAPI/ZB_APP_REGISTER_RSP.cs | 2 +- .../Packet/SimpleAPI/ZB_BIND_CONFIRM.cs | 6 +- .../Packet/SimpleAPI/ZB_BIND_DEVICE.cs | 10 +- .../Packet/SimpleAPI/ZB_BIND_DEVICE_RSP.cs | 4 +- .../SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs | 6 +- .../SimpleAPI/ZB_FIND_DEVICE_REQUEST.cs | 2 +- .../SimpleAPI/ZB_FIND_DEVICE_REQUEST_RSP.cs | 4 +- .../Packet/SimpleAPI/ZB_GET_DEVICE_INFO.cs | 2 +- .../SimpleAPI/ZB_GET_DEVICE_INFO_RSP.cs | 2 +- .../SimpleAPI/ZB_PERMIT_JOINING_REQUEST.cs | 2 +- .../ZB_PERMIT_JOINING_REQUEST_RSP.cs | 2 +- .../Packet/SimpleAPI/ZB_READ_CONFIGURATION.cs | 2 +- .../SimpleAPI/ZB_READ_CONFIGURATION_RSP.cs | 2 +- .../SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs | 10 +- .../Packet/SimpleAPI/ZB_SEND_DATA_CONFIRM.cs | 2 +- .../Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs | 10 +- .../SimpleAPI/ZB_SEND_DATA_REQUEST_RSP.cs | 4 +- .../Packet/SimpleAPI/ZB_START_CONFIRM.cs | 2 +- .../Packet/SimpleAPI/ZB_START_REQUEST.cs | 2 +- .../Packet/SimpleAPI/ZB_START_REQUEST_RSP.cs | 4 +- .../Packet/SimpleAPI/ZB_SYSTEM_RESET.cs | 4 +- .../SimpleAPI/ZB_WRITE_CONFIGURATION.cs | 2 +- .../SimpleAPI/ZB_WRITE_CONFIGURATION_RSP.cs | 2 +- .../UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs | 10 +- .../Packet/UTIL/UTIL_LED_CONTROL.cs | 2 +- .../Packet/UTIL/UTIL_LED_CONTROL_RESPONSE.cs | 2 +- .../Packet/UTIL/UTIL_SET_CHANNELS_RESPONSE.cs | 2 +- .../Packet/UTIL/UTIL_SET_PANID.cs | 15 +-- .../Packet/UTIL/UTIL_SET_PANID_RESPONSE.cs | 2 +- .../Packet/UTIL/UTIL_SET_SECURITY_LEVEL.cs | 4 +- .../UTIL/UTIL_SET_SECURITY_LEVEL_RESPONSE.cs | 4 +- .../Packet/ZDO/ZDO_ACTIVE_EP_REQ.cs | 2 +- .../Packet/ZDO/ZDO_ACTIVE_EP_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_ACTIVE_EP_RSP.cs | 2 +- .../Packet/ZDO/ZDO_BIND_REQ.cs | 10 +- .../Packet/ZDO/ZDO_BIND_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_BIND_RSP.cs | 2 +- .../Packet/ZDO/ZDO_END_DEVICE_ANNCE.cs | 2 +- .../Packet/ZDO/ZDO_END_DEVICE_ANNCE_IND.cs | 2 +- .../Packet/ZDO/ZDO_END_DEVICE_ANNCE_SRSP.cs | 2 +- .../ZDO/ZDO_END_DEVICE_BIND_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_END_DEVICE_BIND_RSP.cs | 2 +- .../Packet/ZDO/ZDO_IEEE_ADDR_REQ.cs | 2 +- .../Packet/ZDO/ZDO_IEEE_ADDR_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_IEEE_ADDR_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MATCH_DESC_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_MATCH_DESC_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LEAVE_REQ.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LEAVE_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LEAVE_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LQI_REQ.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LQI_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LQI_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ.cs | 2 +- .../ZDO/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ.cs | 2 +- .../ZDO/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_RTG_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MSG_CB_INCOMING.cs | 10 +- .../Packet/ZDO/ZDO_MSG_CB_REGISTER.cs | 8 +- .../Packet/ZDO/ZDO_MSG_CB_REGISTER_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_NODE_DESC_REQ.cs | 2 +- .../Packet/ZDO/ZDO_NODE_DESC_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_NODE_DESC_RSP.cs | 14 +-- .../Packet/ZDO/ZDO_NWK_ADDR_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_NWK_ADDR_RSP.cs | 4 +- .../Packet/ZDO/ZDO_POWER_DESC_REQ.cs | 2 +- .../Packet/ZDO/ZDO_POWER_DESC_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_POWER_DESC_RSP.cs | 2 +- .../Packet/ZDO/ZDO_SIMPLE_DESC_REQ.cs | 2 +- .../Packet/ZDO/ZDO_SIMPLE_DESC_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs | 22 ++-- .../Packet/ZDO/ZDO_STARTUP_FROM_APP.cs | 2 +- .../Packet/ZDO/ZDO_STARTUP_FROM_APP_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_STATE_CHANGE_IND.cs | 2 +- .../Packet/ZDO/ZDO_STATUS_ERROR_RSP.cs | 2 +- .../Packet/ZDO/ZDO_TC_DEVICE_IND.cs | 2 +- .../Packet/ZDO/ZDO_UNBIND_REQ.cs | 10 +- .../Packet/ZDO/ZDO_UNBIND_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_UNBIND_RSP.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_CONF.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_REQ.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_RSP.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_SET.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_SET_SRSP.cs | 2 +- .../Packet/ZToolPacket.cs | 14 +-- .../Packet/ZToolPacketStream.cs | 10 +- .../Util/ZToolAddress16.cs | 43 ++----- .../ZigBeeDongleTiCc2531.cs | 4 +- .../ZigBeeNet.Hardware.TI.CC2531.csproj | 2 +- libraries/ZigBeeNet/Util/DoubleByte.cs | 106 +++++++++--------- 119 files changed, 298 insertions(+), 320 deletions(-) diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/BlockingCommandReceiver.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/BlockingCommandReceiver.cs index 3d40df9c..8e7b91ae 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/BlockingCommandReceiver.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/BlockingCommandReceiver.cs @@ -99,7 +99,7 @@ public void ReceivedAsynchronousCommand(ZToolPacket packet) //{ // return; //} - if ((ZToolCMD)packet.CMD.Value != _commandId) + if ((ZToolCMD)packet.CMD != _commandId) { Log.Verbose("Received unexpected packet: " + packet.GetType().Name); return; diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/CommandInterfaceImpl.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/CommandInterfaceImpl.cs index a1718b8a..9f560f1b 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/CommandInterfaceImpl.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/CommandInterfaceImpl.cs @@ -117,8 +117,8 @@ public void Error(Exception th) /// public void HandlePacket(ZToolPacket packet) { - DoubleByte cmdId = packet.CMD; - switch (cmdId.Msb & 0xE0) + ushort cmdId = packet.CMD; + switch (DoubleByte.MSB(cmdId) & 0xE0) { // Received incoming message which can be either message from dongle or remote device. case 0x40: @@ -196,8 +196,8 @@ public void SendSynchronousCommand(ZToolPacket packet, ISynchronousCommandListen _synchronousCommandListenerTimeouts[listener] = expirationTime; } - DoubleByte cmdId = packet.CMD; - int value = (cmdId.Msb & 0xE0); + ushort cmdId = packet.CMD; + int value = (DoubleByte.MSB(cmdId) & 0xE0); if (value != 0x20) { throw new ArgumentException("You are trying to send a non SREQ packet as synchronous command. " + "Evaluated " + value @@ -210,8 +210,8 @@ public void SendSynchronousCommand(ZToolPacket packet, ISynchronousCommandListen { lock (_synchronousCommandListeners) { - ushort id = (ushort)(cmdId.Value & 0x1FFF); - while (_synchronousCommandListeners.ContainsKey(cmdId.Value)) + ushort id = (ushort)(cmdId & 0x1FFF); + while (_synchronousCommandListeners.ContainsKey(cmdId)) { try { @@ -230,7 +230,7 @@ public void SendSynchronousCommand(ZToolPacket packet, ISynchronousCommandListen { lock (_synchronousCommandListeners) { - ushort id = (ushort)(cmdId.Value & 0x1FFF); + ushort id = (ushort)(cmdId & 0x1FFF); while (!(_synchronousCommandListeners.Count == 0)) { try @@ -259,7 +259,7 @@ public void SendSynchronousCommand(ZToolPacket packet, ISynchronousCommandListen /// public void SendAsynchronousCommand(ZToolPacket packet) { - byte value = (byte)(packet.CMD.Msb & 0xE0); + byte value = (byte)(DoubleByte.MSB(packet.CMD) & 0xE0); if (value != 0x40) { throw new ArgumentException("You are trying to send a non AREQ packet. " + "Evaluated " + value @@ -289,10 +289,10 @@ public void SendRaw(byte[] packet) /// private void NotifySynchronousCommand(ZToolPacket packet) { - DoubleByte cmdId = packet.CMD; + ushort cmdId = packet.CMD; lock (_synchronousCommandListeners) { - ushort id = (ushort)(cmdId.Value & 0x1FFF); + ushort id = (ushort)(cmdId & 0x1FFF); _synchronousCommandListeners.TryGetValue(id, out ISynchronousCommandListener listener); if (listener != null) { diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Network/NetworkManager.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Network/NetworkManager.cs index 4a273c7b..01a88c42 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Network/NetworkManager.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Network/NetworkManager.cs @@ -265,7 +265,7 @@ private bool CreateZigBeeNetwork() Log.Verbose("Reset seq: Trying MSG_CB_REGISTER"); ZDO_MSG_CB_REGISTER_SRSP responseCb = (ZDO_MSG_CB_REGISTER_SRSP)SendSynchronous( - new ZDO_MSG_CB_REGISTER(new DoubleByte(ALL_CLUSTERS))); + new ZDO_MSG_CB_REGISTER(ALL_CLUSTERS)); if (responseCb == null) { return false; @@ -1337,7 +1337,7 @@ private void CreateCustomDevicesOnDongle() } } - if (NewDevice(new AF_REGISTER(_ep[i], new DoubleByte(_prof[i]).Value, new DoubleByte(_dev[i]).Value, _ver[i], input, output))) + if (NewDevice(new AF_REGISTER(_ep[i], _prof[i], _dev[i], _ver[i], input, output))) { Log.Debug("Custom device {Dev} registered at endpoint {Ep}", _dev[i], _ep[i]); } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_CONFIRM.cs index 74677f7b..125a5156 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_CONFIRM.cs @@ -30,7 +30,7 @@ public AF_DATA_CONFIRM(byte[] framedata) Endpoint = framedata[1]; TransId = framedata[2]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.AF_DATA_CONFIRM), framedata); + BuildPacket(((ushort)ZToolCMD.AF_DATA_CONFIRM), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST.cs index c36ae565..23a28144 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST.cs @@ -15,7 +15,7 @@ public class AF_DATA_REQUEST : ZToolPacket /// /// Specifies the cluster ID /// - public DoubleByte ClusterId { get; private set; } + public ushort ClusterId { get; private set; } /// /// 0-128 bytes data @@ -92,7 +92,7 @@ public AF_DATA_REQUEST(ushort nwkDstAddr, byte dstEndpoint, byte srcEndpoint, us framedata[10 + i] = data[i]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.AF_DATA_REQUEST), framedata); + BuildPacket(((ushort)ZToolCMD.AF_DATA_REQUEST), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs index 8bc0db86..f3713033 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs @@ -42,7 +42,7 @@ public AF_DATA_REQUEST_EXT(ushort groupdId, short srcEndPoint, int j, int k, byt { framedata[20 + i] = payload[i]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.AF_DATA_REQUEST_EXT), framedata); + BuildPacket(((ushort)ZToolCMD.AF_DATA_REQUEST_EXT), framedata); } } } \ No newline at end of file diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_SRSP.cs index d6ae5e3e..29a99fed 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_SRSP.cs @@ -12,7 +12,7 @@ public AF_DATA_REQUEST_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.AF_DATA_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.AF_DATA_SRSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP.cs index cb38bac9..421fe2fd 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP.cs @@ -19,7 +19,7 @@ public AF_DATA_SRSP() public AF_DATA_SRSP(byte[] framedata) { Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.AF_DATA_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.AF_DATA_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP_EXT.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP_EXT.cs index 5cd18464..11a3fb08 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP_EXT.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP_EXT.cs @@ -19,7 +19,7 @@ public class AF_DATA_SRSP_EXT : ZToolPacket public AF_DATA_SRSP_EXT(byte[] framedata) { Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.AF_DATA_SRSP_EXT), framedata); + BuildPacket(((ushort)ZToolCMD.AF_DATA_SRSP_EXT), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs index 28bbd6e7..40265332 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs @@ -13,12 +13,12 @@ public class AF_INCOMING_MSG : ZToolPacket /// /// Specifies the group ID of the device /// - public DoubleByte GroupId { get; private set; } + public ushort GroupId { get; private set; } /// /// Specifies the cluster Id (only the LSB is used in V1.0 networks.) /// - public DoubleByte ClusterId { get; private set; } + public ushort ClusterId { get; private set; } /// /// Specifies the ZigBee network address of the source device sending the message @@ -73,8 +73,8 @@ public class AF_INCOMING_MSG : ZToolPacket public AF_INCOMING_MSG(byte[] framedata) { - GroupId = new DoubleByte(framedata[1], framedata[0]); - ClusterId = new DoubleByte(framedata[3], framedata[2]); + GroupId = DoubleByte.Convert(framedata[1], framedata[0]); + ClusterId = DoubleByte.Convert(framedata[3], framedata[2]); SrcAddr = new ZToolAddress16(framedata[5], framedata[4]); SrcEndpoint = framedata[6]; DstEndpoint = framedata[7]; @@ -95,7 +95,7 @@ public AF_INCOMING_MSG(byte[] framedata) this.Data[i] = framedata[17 + i]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.AF_INCOMING_MSG), framedata); + BuildPacket(((ushort)ZToolCMD.AF_INCOMING_MSG), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER.cs index 18314f40..9207b7c8 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER.cs @@ -91,7 +91,7 @@ public AF_REGISTER(byte endpoint, ushort appProfId, ushort appDeviceId, byte add framedata[(i * 2) + ((AppInClusterList.Length) * 2) + 10] = AppOutClusterList[i].GetByte(1); } - BuildPacket(new DoubleByte((ushort)ZToolCMD.AF_REGISTER), framedata); + BuildPacket(((ushort)ZToolCMD.AF_REGISTER), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER_SRSP.cs index 732782a6..acf97c9a 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER_SRSP.cs @@ -12,7 +12,7 @@ public AF_REGISTER_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.AF_REGISTER_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.AF_REGISTER_SRSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ErrorPacket.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ErrorPacket.cs index ebdac856..e97e63a9 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ErrorPacket.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ErrorPacket.cs @@ -7,7 +7,7 @@ namespace ZigBeeNet.Hardware.TI.CC2531.Packet public class ErrorPacket : ZToolPacket { public ErrorPacket() - :base(new DoubleByte(), new byte[0]) + :base(0, new byte[0]) { } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING.cs index 0614974d..29b36b80 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING.cs @@ -8,7 +8,7 @@ public class SYS_PING : ZToolPacket { public SYS_PING() { - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_PING), new byte[0]); + BuildPacket(((ushort)ZToolCMD.SYS_PING), new byte[0]); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs index d9f1dce7..7aed8778 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs @@ -16,22 +16,22 @@ public SYS_PING_RESPONSE() { } - public SYS_PING_RESPONSE(DoubleByte capabilities1) + public SYS_PING_RESPONSE(ushort capabilities1) { - this.Capabilities = capabilities1.Value; + this.Capabilities = capabilities1; byte[] framedata = new byte[2]; - framedata[0] = capabilities1.Lsb; - framedata[1] = capabilities1.Msb; + framedata[0] = DoubleByte.LSB(capabilities1); + framedata[1] = DoubleByte.MSB(capabilities1); - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_PING_RESPONSE), framedata); + BuildPacket(((ushort)ZToolCMD.SYS_PING_RESPONSE), framedata); } public SYS_PING_RESPONSE(byte[] framedata) { - this.Capabilities = new DoubleByte(framedata[1], framedata[0]).Value; + this.Capabilities = DoubleByte.Convert(framedata[1], framedata[0]); - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_PING_RESPONSE), framedata); + BuildPacket(((ushort)ZToolCMD.SYS_PING_RESPONSE), framedata); } /// TI.ZPI1.SYS_PING_RESPONSE.CAPABILITIES diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET.cs index 67570650..5d309dde 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET.cs @@ -11,7 +11,7 @@ public SYS_RESET(byte resetType) byte[] framedata = new byte[1]; framedata[0] = resetType; - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_RESET), framedata); + BuildPacket(((ushort)ZToolCMD.SYS_RESET), framedata); } /// TI.ZPI1.SYS_RESET.RESET_TYPE diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET_RESPONSE.cs index 286820c4..cf2384f0 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET_RESPONSE.cs @@ -48,7 +48,7 @@ public SYS_RESET_RESPONSE(byte[] framedata) MinorRel = framedata[4]; HwRev = framedata[5]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_RESET_RESPONSE), framedata); + BuildPacket(((ushort)ZToolCMD.SYS_RESET_RESPONSE), framedata); } public enum ResetType : byte diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RPC_ERROR.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RPC_ERROR.cs index d4d6de62..efcabcaf 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RPC_ERROR.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RPC_ERROR.cs @@ -30,7 +30,7 @@ public SYS_RPC_ERROR(byte num1, byte num2, byte num3) this.ErrCmd0 = num2; this.ErrCmd1 = num3; byte[] framedata = { num1, num2, num3 }; - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_RPC_ERROR), framedata); + BuildPacket(((ushort)ZToolCMD.SYS_RPC_ERROR), framedata); } public SYS_RPC_ERROR(byte[] framedata) @@ -38,7 +38,7 @@ public SYS_RPC_ERROR(byte[] framedata) this.Status = framedata[0]; this.ErrCmd0 = framedata[1]; this.ErrCmd1 = framedata[3]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_RPC_ERROR), framedata); + BuildPacket(((ushort)ZToolCMD.SYS_RPC_ERROR), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK.cs index 56ec905e..33fea107 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK.cs @@ -19,7 +19,7 @@ public SYS_TEST_LOOPBACK(byte[] buffer1) this.TestData = buffer1; byte[] framedata = new byte[buffer1.Length]; framedata = this.TestData; - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_TEST_LOOPBACK), framedata); + BuildPacket(((ushort)ZToolCMD.SYS_TEST_LOOPBACK), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK_SRSP.cs index 0727c599..e38921af 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK_SRSP.cs @@ -17,7 +17,7 @@ public SYS_TEST_LOOPBACK_SRSP(byte[] framedata) { this.TestData = new byte[framedata.Length]; this.TestData = framedata; - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_TEST_LOOPBACK_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.SYS_TEST_LOOPBACK_SRSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION.cs index 8eb076a9..1a71eaaa 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION.cs @@ -9,7 +9,7 @@ public class SYS_VERSION : ZToolPacket public SYS_VERSION() { - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_VERSION), new byte[0]); + BuildPacket(((ushort)ZToolCMD.SYS_VERSION), new byte[0]); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION_RESPONSE.cs index e6a5dd37..824727c3 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION_RESPONSE.cs @@ -38,7 +38,7 @@ public SYS_VERSION_RESPONSE(byte[] framedata) MinorRel = framedata[3]; HwRev = framedata[4]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.SYS_VERSION_RESPONSE), framedata); + BuildPacket(((ushort)ZToolCMD.SYS_VERSION_RESPONSE), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND.cs index 9b55cf7f..a9cd3263 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND.cs @@ -26,7 +26,7 @@ public ZB_ALLOW_BIND(byte timeout) byte[] framedata = new byte[1]; framedata[0] = Timeout; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_ALLOW_BIND), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_ALLOW_BIND), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_CONFIRM.cs index 4a95110b..eb611d95 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_CONFIRM.cs @@ -20,7 +20,7 @@ public ZB_ALLOW_BIND_CONFIRM(byte[] framedata) Source = new ZToolAddress16(framedata[1], framedata[0]); - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_ALLOW_BIND_CONFIRM), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_ALLOW_BIND_CONFIRM), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_RSP.cs index 302f00ff..c2105884 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_RSP.cs @@ -8,12 +8,12 @@ public class ZB_ALLOW_BIND_RSP : ZToolPacket { public ZB_ALLOW_BIND_RSP() { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_ALLOW_BIND_RSP), new byte[0]); + BuildPacket(((ushort)ZToolCMD.ZB_ALLOW_BIND_RSP), new byte[0]); } public ZB_ALLOW_BIND_RSP(byte[] framedata) { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_ALLOW_BIND_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_ALLOW_BIND_RSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs index defeb548..2d2df449 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs @@ -13,22 +13,22 @@ public class ZB_APP_REGISTER_REQUEST : ZToolPacket /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.AppProfileID /// The profile id of the application. This should be set to same value for all devices in this /// network. - public DoubleByte AppProfileID { get; set; } + public ushort AppProfileID { get; set; } /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.DeviceId /// The device description id for this endpoint - public DoubleByte DeviceId { get; set; } + public ushort DeviceId { get; set; } /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.DeviceVersion /// The version of the device description public byte DeviceVersion { get; set; } /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.InputCommandsList /// List of input commands that are processed by this device application - public DoubleByte[] InputCommandsList { get; set; } + public ushort[] InputCommandsList { get; set; } /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.InputCommandsNum /// The number of Input commands Ids following in the InputCommandsList public byte InputCommandsNum { get; set; } /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.OutputCommandsList /// List of output commands that are generated by this device application - public DoubleByte[] OutputCommandsList { get; set; } + public ushort[] OutputCommandsList { get; set; } /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.OutputCommandsNum /// The number of Output command Ids in the OutputCommandsList public byte OutputCommandsNum { get; set; } @@ -40,14 +40,14 @@ public class ZB_APP_REGISTER_REQUEST : ZToolPacket /// Constructor public ZB_APP_REGISTER_REQUEST() { - this.InputCommandsList = new DoubleByte[0xff]; - this.OutputCommandsList = new DoubleByte[0xff]; + this.InputCommandsList = new ushort[0xff]; + this.OutputCommandsList = new ushort[0xff]; } /// TI.ZPI2.ZB_APP_REGISTER_REQUEST /// Constructor - public ZB_APP_REGISTER_REQUEST(byte num1, DoubleByte num2, DoubleByte num3, byte num4, byte num5, byte num6, - DoubleByte[] numArray1, byte num7, DoubleByte[] numArray2) + public ZB_APP_REGISTER_REQUEST(byte num1, ushort num2, ushort num3, byte num4, byte num5, byte num6, + ushort[] numArray1, byte num7, ushort[] numArray2) { this.AppEndPoint = num1; this.AppProfileID = num2; @@ -55,34 +55,34 @@ public ZB_APP_REGISTER_REQUEST(byte num1, DoubleByte num2, DoubleByte num3, byte this.DeviceVersion = num4; this.Unused = num5; this.InputCommandsNum = num6; - this.InputCommandsList = new DoubleByte[numArray1.Length]; + this.InputCommandsList = new ushort[numArray1.Length]; this.InputCommandsList = numArray1; this.OutputCommandsNum = num7; - this.OutputCommandsList = new DoubleByte[numArray2.Length]; + this.OutputCommandsList = new ushort[numArray2.Length]; this.OutputCommandsList = numArray2; byte[] framedata = new byte[9 + this.InputCommandsList.Length * 2 + this.OutputCommandsList.Length * 2]; framedata[0] = this.AppEndPoint; - framedata[1] = this.AppProfileID.Lsb; - framedata[2] = this.AppProfileID.Msb; - framedata[3] = this.DeviceId.Lsb; - framedata[4] = this.DeviceId.Msb; + framedata[1] = DoubleByte.LSB(this.AppProfileID); + framedata[2] = DoubleByte.MSB(this.AppProfileID); + framedata[3] = DoubleByte.LSB(this.DeviceId); + framedata[4] = DoubleByte.MSB(this.DeviceId); framedata[5] = this.DeviceVersion; framedata[6] = this.Unused; framedata[7] = this.InputCommandsNum; for (int i = 0; i < this.InputCommandsList.Length; i++) { - framedata[(i * 2) + 8] = this.InputCommandsList[i].Lsb; - framedata[(i * 2) + 9] = this.InputCommandsList[i].Msb; + framedata[(i * 2) + 8] = DoubleByte.LSB(this.InputCommandsList[i]); + framedata[(i * 2) + 9] = DoubleByte.MSB(this.InputCommandsList[i]); } framedata[((this.InputCommandsList.Length) * 2) + 8] = this.OutputCommandsNum; for (int i = 0; i < this.OutputCommandsList.Length; i++) { - framedata[(i * 2) + ((this.InputCommandsList.Length) * 2) + 9] = this.OutputCommandsList[i].Lsb; - framedata[(i * 2) + ((this.InputCommandsList.Length) * 2) + 10] = this.OutputCommandsList[i].Msb; + framedata[(i * 2) + ((this.InputCommandsList.Length) * 2) + 9] = DoubleByte.LSB(this.OutputCommandsList[i]); + framedata[(i * 2) + ((this.InputCommandsList.Length) * 2) + 10] = DoubleByte.MSB(this.OutputCommandsList[i]); } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_APP_REGISTER_REQUEST), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_APP_REGISTER_REQUEST), framedata); } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_RSP.cs index 9394ecc2..bf7805b6 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_RSP.cs @@ -19,7 +19,7 @@ public ZB_APP_REGISTER_RSP() public ZB_APP_REGISTER_RSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_APP_REGISTER_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_APP_REGISTER_RSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs index 22f17fd4..f5e5d80b 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs @@ -8,7 +8,7 @@ public class ZB_BIND_CONFIRM : ZToolPacket { /// TI.ZPI2.ZB_BIND_CONFIRM.CommandId /// CommandId - public DoubleByte CommandId { get; set; } + public ushort CommandId { get; set; } /// TI.ZPI2.ZB_BIND_CONFIRM.Status /// The immediate return value from executing the RPC. public int Status { get; set; } @@ -23,9 +23,9 @@ public ZB_BIND_CONFIRM() /// Constructor public ZB_BIND_CONFIRM(byte[] framedata) { - this.CommandId = new DoubleByte(framedata[1], framedata[0]); + this.CommandId = DoubleByte.Convert(framedata[1],framedata[0]); this.Status = framedata[2]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_FIND_DEVICE_CONFIRM), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_CONFIRM), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs index a6085606..faac27e4 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs @@ -19,14 +19,14 @@ public class ZB_BIND_DEVICE : ZToolPacket /// /// The Identifier of the binding /// - public DoubleByte CommandId { get; private set; } + public ushort CommandId { get; private set; } /// /// Specifies the 64-bit IEEE address of the device to bind to /// public ZToolAddress64 Destination { get; private set; } - public ZB_BIND_DEVICE(bool create, DoubleByte commandId, ZToolAddress64 destination) + public ZB_BIND_DEVICE(bool create, ushort commandId, ZToolAddress64 destination) { Create = create; CommandId = commandId; @@ -34,8 +34,8 @@ public ZB_BIND_DEVICE(bool create, DoubleByte commandId, ZToolAddress64 destinat byte[] framedata = new byte[11]; framedata[0] = create ? (byte)0x01 : (byte)0x00; - framedata[1] = commandId.Lsb; - framedata[2] = commandId.Msb; + framedata[1] = DoubleByte.LSB(commandId); + framedata[2] = DoubleByte.MSB(commandId); byte[] dst = destination.Address; for (int i = 3; i < 8; i++) @@ -43,7 +43,7 @@ public ZB_BIND_DEVICE(bool create, DoubleByte commandId, ZToolAddress64 destinat framedata[i] = dst[i - 3]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_BIND_DEVICE), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_BIND_DEVICE), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE_RSP.cs index cc37b92b..a2ad5bc8 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE_RSP.cs @@ -8,12 +8,12 @@ public class ZB_BIND_DEVICE_RSP : ZToolPacket { public ZB_BIND_DEVICE_RSP() { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_BIND_DEVICE_RSP), new byte[0]); + BuildPacket(((ushort)ZToolCMD.ZB_BIND_DEVICE_RSP), new byte[0]); } public ZB_BIND_DEVICE_RSP(byte[] framedata) { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_BIND_DEVICE_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_BIND_DEVICE_RSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs index 591601a9..77cebf89 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs @@ -17,7 +17,7 @@ public class ZB_FIND_DEVICE_CONFIRM : ZToolPacket /// /// Value that the search was executed on /// - public DoubleByte SearchKey { get; private set; } + public ushort SearchKey { get; private set; } /// /// The result of the search @@ -27,7 +27,7 @@ public class ZB_FIND_DEVICE_CONFIRM : ZToolPacket public ZB_FIND_DEVICE_CONFIRM(byte[] framedata) { SearchType = framedata[0]; - SearchKey = new DoubleByte(framedata[1], framedata[2]); + SearchKey = DoubleByte.Convert(framedata[1], framedata[2]); Result = new byte[8]; for (int i = 0; i < 8; i++) @@ -35,7 +35,7 @@ public ZB_FIND_DEVICE_CONFIRM(byte[] framedata) this.Result[i] = framedata[i + 3]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_FIND_DEVICE_CONFIRM), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_CONFIRM), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST.cs index 2cff81cc..929cfef1 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST.cs @@ -22,7 +22,7 @@ public ZB_FIND_DEVICE_REQUEST(ulong searchKey) { SearchKey = searchKey; byte[] framedata = ByteUtils.ConvertLongtoMultiByte(SearchKey); - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST_RSP.cs index 70e8b404..059c116d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST_RSP.cs @@ -8,12 +8,12 @@ public class ZB_FIND_DEVICE_REQUEST_RSP : ZToolPacket { public ZB_FIND_DEVICE_REQUEST_RSP() { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP), new byte[0]); + BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP), new byte[0]); } public ZB_FIND_DEVICE_REQUEST_RSP(byte[] framedata) { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO.cs index 3d680c94..883e6e12 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO.cs @@ -19,7 +19,7 @@ public ZB_GET_DEVICE_INFO(DEV_INFO_TYPE param) Param = param; byte[] framedata = new byte[] { (byte)param }; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_GET_DEVICE_INFO), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_GET_DEVICE_INFO), framedata); } public enum DEV_INFO_TYPE : byte diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO_RSP.cs index 8741e13b..9e05d1e1 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO_RSP.cs @@ -21,7 +21,7 @@ public ZB_GET_DEVICE_INFO_RSP(byte[] framedata) this.Value[i] = framedata[i + 1]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_GET_DEVICE_INFO_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_GET_DEVICE_INFO_RSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST.cs index df699593..baa417f3 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST.cs @@ -28,7 +28,7 @@ public ZB_PERMIT_JOINING_REQUEST(ushort dstAddr, byte timeout) data.AddRange(Destination.GetBytes()); data.Add(Timeout); - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_PERMIT_JOINING_REQUEST), data.ToArray()); + BuildPacket(((ushort)ZToolCMD.ZB_PERMIT_JOINING_REQUEST), data.ToArray()); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST_RSP.cs index 0d7bd545..845640d4 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST_RSP.cs @@ -13,7 +13,7 @@ public ZB_PERMIT_JOINING_REQUEST_RSP(byte[] data) { Status = data[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_PERMIT_JOINING_REQUEST_RSP), data); + BuildPacket(((ushort)ZToolCMD.ZB_PERMIT_JOINING_REQUEST_RSP), data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION.cs index 545e1b2e..70b84336 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION.cs @@ -20,7 +20,7 @@ public ZB_READ_CONFIGURATION(ZB_WRITE_CONFIGURATION.CONFIG_ID configId) byte[] framedata = new byte[] { (byte)configId }; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_READ_CONFIGURATION), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_READ_CONFIGURATION), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION_RSP.cs index 54036091..dea8876d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION_RSP.cs @@ -42,7 +42,7 @@ public ZB_READ_CONFIGURATION_RSP(byte[] framedata) this.Value[i] = framedata[i + 3]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_READ_CONFIGURATION_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_READ_CONFIGURATION_RSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs index eea02ccc..23109402 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs @@ -18,12 +18,12 @@ public class ZB_RECEIVE_DATA_INDICATION : ZToolPacket /// /// The command Id associated with the data /// - public DoubleByte Command { get; private set; } + public ushort Command { get; private set; } /// /// Specifies the number of bytes in the Data parameter /// - public DoubleByte Len { get; private set; } + public ushort Len { get; private set; } /// /// The data sent by the peer device @@ -33,8 +33,8 @@ public class ZB_RECEIVE_DATA_INDICATION : ZToolPacket public ZB_RECEIVE_DATA_INDICATION(byte[] framedata) { Source = new ZToolAddress16(framedata[1], framedata[0]); - Command = new DoubleByte(framedata[3], framedata[2]); - Len = new DoubleByte(framedata[5], framedata[4]); + Command = DoubleByte.Convert(framedata[3], framedata[2]); + Len = DoubleByte.Convert(framedata[5], framedata[4]); Data = new byte[framedata.Length - 6]; for (int i = 0; i < Data.Length; i++) @@ -42,7 +42,7 @@ public ZB_RECEIVE_DATA_INDICATION(byte[] framedata) Data[i] = framedata[i + 6]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_RECEIVE_DATA_INDICATION), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_RECEIVE_DATA_INDICATION), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_CONFIRM.cs index 056373ae..93943070 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_CONFIRM.cs @@ -24,7 +24,7 @@ public ZB_SEND_DATA_CONFIRM(byte[] framedata) Handle = framedata[0]; Status = (PacketStatus)framedata[1]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_SEND_DATA_CONFIRM), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_SEND_DATA_CONFIRM), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs index 3e5ecc73..4b480d6d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs @@ -15,7 +15,7 @@ public class ZB_SEND_DATA_REQUEST : ZToolPacket /// The command Id to send with the message. /// If the ZB_BINDING_ADDR destination is used, this parameter also indicates the binding to use. /// - public DoubleByte CommandId { get; private set; } + public ushort CommandId { get; private set; } /// /// The destination of the data. @@ -56,7 +56,7 @@ public ZB_SEND_DATA_REQUEST() PayloadValue = new byte[0xff]; } - public ZB_SEND_DATA_REQUEST(ZToolAddress16 destination, DoubleByte commandId, int handle, int ack, int radius, int payloadLength, byte[] payload) + public ZB_SEND_DATA_REQUEST(ZToolAddress16 destination, ushort commandId, int handle, int ack, int radius, int payloadLength, byte[] payload) { // TODO: check buffer length Destination = destination; @@ -70,8 +70,8 @@ public ZB_SEND_DATA_REQUEST(ZToolAddress16 destination, DoubleByte commandId, in byte[] framedata = new byte[PayloadValue.Length + 8]; framedata[0] = Destination.Lsb; framedata[1] = Destination.Msb; - framedata[2] = CommandId.Lsb; - framedata[3] = CommandId.Msb; + framedata[2] = DoubleByte.LSB(CommandId); + framedata[3] = DoubleByte.MSB(CommandId); framedata[4] = (byte)Handle; framedata[5] = (byte)Ack; framedata[6] = (byte)Radius; @@ -82,7 +82,7 @@ public ZB_SEND_DATA_REQUEST(ZToolAddress16 destination, DoubleByte commandId, in framedata[i + 8] = this.PayloadValue[i]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST_RSP.cs index 12d4f272..0ec8524d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST_RSP.cs @@ -8,12 +8,12 @@ public class ZB_SEND_DATA_REQUEST_RSP : ZToolPacket { public ZB_SEND_DATA_REQUEST_RSP() { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST_RSP), new byte[0]); + BuildPacket(((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST_RSP), new byte[0]); } public ZB_SEND_DATA_REQUEST_RSP(byte[] framedata) { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST_RSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_CONFIRM.cs index 6ba319f3..81bd62cd 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_CONFIRM.cs @@ -18,7 +18,7 @@ public ZB_START_CONFIRM(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_START_CONFIRM), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_START_CONFIRM), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST.cs index 3c55eed9..af1b38e3 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST.cs @@ -13,7 +13,7 @@ public class ZB_START_REQUEST : ZToolPacket { public ZB_START_REQUEST() { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_START_REQUEST), new byte[0]); + BuildPacket(((ushort)ZToolCMD.ZB_START_REQUEST), new byte[0]); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST_RSP.cs index 7640b37d..f691f416 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST_RSP.cs @@ -8,12 +8,12 @@ public class ZB_START_REQUEST_RSP : ZToolPacket { public ZB_START_REQUEST_RSP() { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_START_REQUEST_RSP), new byte[0]); + BuildPacket(((ushort)ZToolCMD.ZB_START_REQUEST_RSP), new byte[0]); } public ZB_START_REQUEST_RSP(byte[] framedata) { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_START_REQUEST_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_START_REQUEST_RSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SYSTEM_RESET.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SYSTEM_RESET.cs index 2ebd4f40..20698fb6 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SYSTEM_RESET.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SYSTEM_RESET.cs @@ -14,12 +14,12 @@ public class ZB_SYSTEM_RESET : ZToolPacket { public ZB_SYSTEM_RESET() { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_SYSTEM_RESET), new byte[0]); + BuildPacket(((ushort)ZToolCMD.ZB_SYSTEM_RESET), new byte[0]); } public ZB_SYSTEM_RESET(byte[] framedata) { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_SYSTEM_RESET), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_SYSTEM_RESET), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION.cs index 1d704ef4..534beac6 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION.cs @@ -20,7 +20,7 @@ public ZB_WRITE_CONFIGURATION(CONFIG_ID configId, byte[] nvItemValue) framedata[i + 2] = nvItemValue[i]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_WRITE_CONFIGURATION), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_WRITE_CONFIGURATION), framedata); } public enum CONFIG_ID : byte diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION_RSP.cs index bb0b8785..485ac6c1 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION_RSP.cs @@ -12,7 +12,7 @@ public ZB_WRITE_CONFIGURATION_RSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZB_WRITE_CONFIGURATION_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZB_WRITE_CONFIGURATION_RSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs index 437d0528..ce01fd26 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs @@ -9,7 +9,7 @@ public class UTIL_GET_DEVICE_INFO_RESPONSE : ZToolPacket { /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.AssocDevicesList /// Dynamic array; Assoc Devices List - public DoubleByte[] AssocDevicesList { get; private set; } + public ushort[] AssocDevicesList { get; private set; } /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DeviceState /// Device Type public byte DeviceState { get; private set; } @@ -35,7 +35,7 @@ public class UTIL_GET_DEVICE_INFO_RESPONSE : ZToolPacket /// Constructor public UTIL_GET_DEVICE_INFO_RESPONSE() { - this.AssocDevicesList = new DoubleByte[0xff]; + this.AssocDevicesList = new ushort[0xff]; } public UTIL_GET_DEVICE_INFO_RESPONSE(byte[] framedata) @@ -53,13 +53,13 @@ public UTIL_GET_DEVICE_INFO_RESPONSE(byte[] framedata) this.DeviceState = framedata[12]; this.NumAssocDevices = framedata[13]; // AssocDevicesList=new DoubleByte[(framedata.length-14)/2];//Actually more than NumAssocDevices - AssocDevicesList = new DoubleByte[this.NumAssocDevices]; + AssocDevicesList = new ushort[this.NumAssocDevices]; for (int i = 0; i < this.AssocDevicesList.Length; i++) { - AssocDevicesList[i] = new DoubleByte(framedata[14 + (i * 2)], framedata[15 + (i * 2)]); + AssocDevicesList[i] = DoubleByte.Convert(framedata[14 + (i * 2)], framedata[15 + (i * 2)]); } - BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_GET_DEVICE_INFO_RESPONSE), framedata); + BuildPacket(((ushort)ZToolCMD.UTIL_GET_DEVICE_INFO_RESPONSE), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL.cs index 68ff4ec6..806e0c58 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL.cs @@ -12,7 +12,7 @@ public UTIL_LED_CONTROL(byte led, bool mode) framedata[0] = led; framedata[1] = mode ? (byte)1 : (byte)0; - base.BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_LED_CONTROL), framedata); + base.BuildPacket(((ushort)ZToolCMD.UTIL_LED_CONTROL), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL_RESPONSE.cs index 0bbef839..9f281609 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL_RESPONSE.cs @@ -12,7 +12,7 @@ public UTIL_LED_CONTROL_RESPONSE(byte[] framedata) { Status = (PacketStatus)framedata[0]; - base.BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_LED_CONTROL_RESPONSE), framedata); + base.BuildPacket(((ushort)ZToolCMD.UTIL_LED_CONTROL_RESPONSE), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_CHANNELS_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_CHANNELS_RESPONSE.cs index 19e4ee09..5893cb2e 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_CHANNELS_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_CHANNELS_RESPONSE.cs @@ -14,7 +14,7 @@ public UTIL_SET_CHANNELS_RESPONSE(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_SET_CHANNELS_RESPONSE), framedata); + BuildPacket(((ushort)ZToolCMD.UTIL_SET_CHANNELS_RESPONSE), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs index 1fdeaffe..83154ac1 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs @@ -8,7 +8,7 @@ public class UTIL_SET_PANID : ZToolPacket { /// TI.ZPI1.SYS_SET_PANID.PanID /// PanID. - public DoubleByte PanID { get; set; } + public ushort PanID { get; set; } /// TI.ZPI1.SYS_SET_PANID /// Constructor @@ -18,22 +18,23 @@ public UTIL_SET_PANID() /// TI.ZPI1.SYS_SET_PANID /// Constructor - public UTIL_SET_PANID(DoubleByte num1) + public UTIL_SET_PANID(ushort num1) { this.PanID = num1; byte[] framedata = new byte[1]; - framedata[0] = this.PanID.Msb; - framedata[1] = this.PanID.Lsb; + //Inversed because at first glance order wasn't valid + framedata[0] = DoubleByte.LSB(this.PanID); + framedata[1] = DoubleByte.MSB(this.PanID); - BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_SET_PANID), framedata); + BuildPacket(((ushort)ZToolCMD.UTIL_SET_PANID), framedata); } public UTIL_SET_PANID(byte[] framedata) { - this.PanID = new DoubleByte(framedata[1], framedata[0]); + this.PanID = DoubleByte.Convert(framedata[1], framedata[0]); - BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_SET_PANID), framedata); + BuildPacket(((ushort)ZToolCMD.UTIL_SET_PANID), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID_RESPONSE.cs index ed7cfd46..cd089a71 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID_RESPONSE.cs @@ -20,7 +20,7 @@ public UTIL_SET_PANID_RESPONSE(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_SET_PANID_RESPONSE), framedata); + BuildPacket(((ushort)ZToolCMD.UTIL_SET_PANID_RESPONSE), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL.cs index 2c55e62d..568240a1 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL.cs @@ -25,14 +25,14 @@ public UTIL_SET_SECURITY_LEVEL(byte num1) byte[] framedata = new byte[1]; framedata[0] = this.SecurityLevel; - BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL), framedata); + BuildPacket(((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL), framedata); } public UTIL_SET_SECURITY_LEVEL(byte[] framedata) { this.SecurityLevel = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL), framedata); + BuildPacket(((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL_RESPONSE.cs index 3f3a8cc5..4831568d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL_RESPONSE.cs @@ -23,14 +23,14 @@ public UTIL_SET_SECURITY_LEVEL_RESPONSE(byte cmd_status1) byte[] framedata = new byte[1]; framedata[0] = this.Status; - BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL_RESPONSE), framedata); + BuildPacket(((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL_RESPONSE), framedata); } public UTIL_SET_SECURITY_LEVEL_RESPONSE(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL_RESPONSE), framedata); + BuildPacket(((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL_RESPONSE), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ.cs index 9fb02ec8..abe657a4 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ.cs @@ -15,7 +15,7 @@ public ZDO_ACTIVE_EP_REQ(ZToolAddress16 dstAddr, ZToolAddress16 nwkAddrOfInteres framedata[2] = nwkAddrOfInterest.Lsb; framedata[3] = nwkAddrOfInterest.Msb; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_ACTIVE_EP_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_ACTIVE_EP_REQ), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ_SRSP.cs index 136afda8..5ae75962 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ_SRSP.cs @@ -12,7 +12,7 @@ public ZDO_ACTIVE_EP_REQ_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_ACTIVE_EP_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_ACTIVE_EP_REQ_SRSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_RSP.cs index 5563f871..b6eb975d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_RSP.cs @@ -30,7 +30,7 @@ public ZDO_ACTIVE_EP_RSP(byte[] framedata) ActiveEpList[i] = framedata[i + 6]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_ACTIVE_EP_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_ACTIVE_EP_RSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs index 2e2f0a9e..50925566 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs @@ -29,7 +29,7 @@ public class ZDO_BIND_REQ : ZToolPacket /// /// Specifies the cluster Id to match in message /// - public DoubleByte ClusterId { get; private set; } + public ushort ClusterId { get; private set; } /// /// Specifies destination address mode @@ -55,7 +55,7 @@ public enum Address_Mode :byte BROADCAST = 0xFF } - public ZDO_BIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, DoubleByte cluster, + public ZDO_BIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, ushort cluster, Address_Mode addressingMode, ZToolAddress64 ieeeDst, byte epDst) { @@ -77,8 +77,8 @@ public ZDO_BIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, D } framedata[10] = epSrc; - framedata[11] = cluster.Lsb; - framedata[12] = cluster.Msb; + framedata[11] = DoubleByte.LSB(cluster); + framedata[12] = DoubleByte.MSB(cluster); framedata[13] = (byte)addressingMode; bytes = ieeeDst.Address; if (addressingMode == Address_Mode.ADDRESS_64_BIT) @@ -95,7 +95,7 @@ public ZDO_BIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, D framedata[15] = bytes[6]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_BIND_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_BIND_REQ), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ_SRSP.cs index 2997315d..d06343b4 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ_SRSP.cs @@ -12,7 +12,7 @@ public ZDO_BIND_REQ_SRSP(byte[] data) { Status = (PacketStatus)data[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_BIND_REQ_SRSP), data); + BuildPacket(((ushort)ZToolCMD.ZDO_BIND_REQ_SRSP), data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_RSP.cs index 92935417..87c2c474 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_RSP.cs @@ -17,7 +17,7 @@ public ZDO_BIND_RSP(byte[] data) SrcAddr = new ZToolAddress16(data[1], data[0]); Status = (PacketStatus)data[2]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_BIND_RSP), data); + BuildPacket(((ushort)ZToolCMD.ZDO_BIND_RSP), data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE.cs index da012e63..e9bb61c3 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE.cs @@ -37,7 +37,7 @@ public ZDO_END_DEVICE_ANNCE(ZToolAddress16 num1, ZToolAddress64 num2, int capabi { framedata[i + 2] = bytes[7 - i]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE), framedata); } /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.CAPABILITY_INFO diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_IND.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_IND.cs index 2c6525d3..a89f582c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_IND.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_IND.cs @@ -45,7 +45,7 @@ public ZDO_END_DEVICE_ANNCE_IND(byte[] framedata) IEEEAddr = new ZToolAddress64(BitConverter.ToInt64(framedata, 4)); Capabilities = framedata[12]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE_IND), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE_IND), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_SRSP.cs index a21492fa..88d3bc26 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_END_DEVICE_ANNCE_SRSP() public ZDO_END_DEVICE_ANNCE_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_REQ_SRSP.cs index 821c18d4..04cf09d1 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_END_DEVICE_BIND_REQ_SRSP() public ZDO_END_DEVICE_BIND_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_END_DEVICE_BIND_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_END_DEVICE_BIND_REQ_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_RSP.cs index bcf341bf..c64ff218 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_RSP.cs @@ -18,7 +18,7 @@ public ZDO_END_DEVICE_BIND_RSP(byte[] framedata) { this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); this.Status = framedata[2]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_END_DEVICE_BIND_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_END_DEVICE_BIND_RSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ.cs index d77455a7..7bac524c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ.cs @@ -37,7 +37,7 @@ public ZDO_IEEE_ADDR_REQ(ZToolAddress16 shortAddress, RequestType reqType, byte data.Add((byte)ReqType); data.Add(StartIndex); - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_IEEE_ADDR_REQ), data.ToArray()); + BuildPacket(((ushort)ZToolCMD.ZDO_IEEE_ADDR_REQ), data.ToArray()); } public enum RequestType : byte diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ_SRSP.cs index 95cde8c0..d97dbc49 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ_SRSP.cs @@ -12,7 +12,7 @@ public ZDO_IEEE_ADDR_REQ_SRSP(byte[] data) { Status = (PacketStatus)data[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_IEEE_ADDR_REQ_SRSP), data); + BuildPacket(((ushort)ZToolCMD.ZDO_IEEE_ADDR_REQ_SRSP), data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_RSP.cs index 6988129e..b01246a6 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_RSP.cs @@ -61,7 +61,7 @@ public ZDO_IEEE_ADDR_RSP(byte[] data) this.AssocDevList[i] = new ZToolAddress16(data[14 + (i * 2)], data[13 + (i * 2)]); } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_IEEE_ADDR_RSP), data); + BuildPacket(((ushort)ZToolCMD.ZDO_IEEE_ADDR_RSP), data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_REQ_SRSP.cs index 6da35ff2..0ffe7e1d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_REQ_SRSP.cs @@ -13,7 +13,7 @@ public class ZDO_MATCH_DESC_REQ_SRSP : ZToolPacket public ZDO_MATCH_DESC_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MATCH_DESC_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MATCH_DESC_REQ_SRSP), framedata); } public String toString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_RSP.cs index c19c0d52..94ba980c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_RSP.cs @@ -41,7 +41,7 @@ public ZDO_MATCH_DESC_RSP(byte[] framedata) { this.MatchEndpointList[i] = framedata[i + 6]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MATCH_DESC_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MATCH_DESC_RSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ.cs index e486384d..93bf58c8 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ.cs @@ -43,7 +43,7 @@ public ZDO_MGMT_LEAVE_REQ(ZToolAddress16 num1, ZToolAddress64 num2, byte flag1) framedata[2 + i] = this.DeviceAddress.Address[7 - i]; } framedata[10] = this.RemoveChildren_Rejoin; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_LEAVE_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LEAVE_REQ), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ_SRSP.cs index 2228134a..03c311b4 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_MGMT_LEAVE_REQ_SRSP() public ZDO_MGMT_LEAVE_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_LEAVE_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LEAVE_REQ_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_RSP.cs index 96211db5..dd6ff5ba 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_RSP.cs @@ -24,7 +24,7 @@ public ZDO_MGMT_LEAVE_RSP(byte[] framedata) { this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); this.Status = framedata[2]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_LEAVE_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LEAVE_RSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ.cs index 4268fdf3..acd1915d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ.cs @@ -35,7 +35,7 @@ public ZDO_MGMT_LQI_REQ(ZToolAddress16 num1, byte num2) framedata[0] = this.DstAddr.Lsb; framedata[1] = this.DstAddr.Msb; framedata[2] = this.StartIndex; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_LQI_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LQI_REQ), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ_SRSP.cs index 30b76719..5ad63b69 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_MGMT_LQI_REQ_SRSP() public ZDO_MGMT_LQI_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_LQI_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LQI_REQ_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_RSP.cs index d69eb54d..7b21f513 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_RSP.cs @@ -78,7 +78,7 @@ public ZDO_MGMT_LQI_RSP(byte[] framedata) k += 22; } } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_LQI_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LQI_RSP), framedata); } /// TI.ZPI1.ZDO_MGMT_LQI_RSP.NeighborLqiListItemClass diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ.cs index 4011f4ee..9937d5dc 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ.cs @@ -70,7 +70,7 @@ public ZDO_MGMT_NWK_UPDATE_REQ(ushort destinationAddress, byte destinationAddres framedata[9] = this.NetworkManagerAddress.GetByte(0); framedata[10] = this.NetworkManagerAddress.GetByte(1); - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.cs index d2dfea3b..be640218 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.cs @@ -15,7 +15,7 @@ public class ZDO_MGMT_NWK_UPDATE_REQ_SRSP : ZToolPacket public ZDO_MGMT_NWK_UPDATE_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ.cs index 8d509453..f2663627 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ.cs @@ -44,7 +44,7 @@ public ZDO_MGMT_PERMIT_JOIN_REQ(byte addrMode, ZToolAddress16 dstAddr, byte dura data.Add(Duration); data.Add(TCSignificance); - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ), data.ToArray()); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ), data.ToArray()); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.cs index d9cecad2..a411f7e9 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.cs @@ -11,7 +11,7 @@ public class ZDO_MGMT_PERMIT_JOIN_REQ_SRSP : ZToolPacket public ZDO_MGMT_PERMIT_JOIN_REQ_SRSP(byte[] data) { Status = (PacketStatus)data[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ_SRSP), data); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ_SRSP), data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_RSP.cs index d107e3b9..7c348442 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_RSP.cs @@ -20,7 +20,7 @@ public ZDO_MGMT_PERMIT_JOIN_RSP(byte[] data) SrcAddr = new ZToolAddress16(data[1], data[0]); Status = (PacketStatus)data[2]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_RSP), data); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_RSP), data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_RTG_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_RTG_RSP.cs index 3f8e91e2..e95117a8 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_RTG_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_RTG_RSP.cs @@ -43,7 +43,7 @@ public ZDO_MGMT_RTG_RSP() public ZDO_MGMT_RTG_RSP(byte[] framedata) { - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MGMT_LQI_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LQI_RSP), framedata); } /// TI.ZPI1.ZDO_MGMT_LQI_RSP.NeighborLqiListItemClass diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs index e2e61489..6e372119 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs @@ -43,7 +43,7 @@ static ZDO_MSG_CB_INCOMING() public int WasBroadcast { get; private set; } /// TI.ZPI2.ZDO_MSG_CB_INCOMING.ClusterId /// The ZDO Cluster Id of this message. - public DoubleByte ClusterId { get; private set; } + public ushort ClusterId { get; private set; } /// TI.ZPI2.ZDO_MSG_CB_INCOMING.SecurityUse /// N/A - not used. public int SecurityUse { get; private set; } @@ -67,7 +67,7 @@ public ZDO_MSG_CB_INCOMING(byte[] framedata) { SrcAddr = new ZToolAddress16(framedata[1], framedata[0]); WasBroadcast = framedata[2]; - ClusterId = new DoubleByte(framedata[4], framedata[3]); + ClusterId = DoubleByte.Convert(framedata[4], framedata[3]); SecurityUse = framedata[5]; SeqNum = framedata[6]; MacDstAddr = new ZToolAddress16(framedata[8], framedata[7]); @@ -78,7 +78,7 @@ public ZDO_MSG_CB_INCOMING(byte[] framedata) Data = framedata.Skip(9).ToArray(); // Arrays.copyOfRange(framedata, 9, framedata.Length); - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MSG_CB_INCOMING), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MSG_CB_INCOMING), framedata); } /// @@ -91,7 +91,7 @@ public ZToolPacket Translate() Log.Verbose("Translating ZDO cluster callback {ClusterId}", ClusterId); - Type newPacketClass = ClusterToRSP[ClusterId.Value]; + Type newPacketClass = ClusterToRSP[ClusterId]; if (newPacketClass == null) { @@ -130,7 +130,7 @@ public ZToolPacket Translate() try { //newPacket = Activator.CreateInstance(newPacketClass, frame); - switch (ClusterId.Value) + switch (ClusterId) { case 0x0013: newPacket = new ZDO_END_DEVICE_ANNCE_IND(frame); diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs index b30fa146..ad9ea16c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs @@ -6,13 +6,13 @@ namespace ZigBeeNet.Hardware.TI.CC2531.Packet.ZDO { public class ZDO_MSG_CB_REGISTER : ZToolPacket { - public ZDO_MSG_CB_REGISTER(DoubleByte cluster) + public ZDO_MSG_CB_REGISTER(ushort cluster) { byte[] framedata = new byte[2]; - framedata[0] = cluster.Lsb; - framedata[1] = cluster.Msb; + framedata[0] = DoubleByte.LSB(cluster); + framedata[1] = DoubleByte.MSB(cluster); - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MSG_CB_REGISTER), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MSG_CB_REGISTER), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER_SRSP.cs index 558e8c89..c7fc2a75 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER_SRSP.cs @@ -20,7 +20,7 @@ public ZDO_MSG_CB_REGISTER_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_MSG_CB_REGISTER_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_MSG_CB_REGISTER_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ.cs index 2a49b57b..3993f294 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ.cs @@ -31,7 +31,7 @@ public ZDO_NODE_DESC_REQ(ZToolAddress16 dstAddr, ZToolAddress16 nwkAddrOfinteres framedata[2] = NwkAddrOfInterest.Lsb; framedata[3] = NwkAddrOfInterest.Msb; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_NODE_DESC_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_NODE_DESC_REQ), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ_SRSP.cs index 7c072623..767bd292 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ_SRSP.cs @@ -15,7 +15,7 @@ public ZDO_NODE_DESC_REQ_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_NODE_DESC_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_NODE_DESC_REQ_SRSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs index 392f214b..26a0c378 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs @@ -58,7 +58,7 @@ public class ZDO_NODE_DESC_RSP : ZToolPacket /// /// Specifies a manufacturer code that is allocated by the ZigBee Alliance, relating to the manufacturer to the device /// - public DoubleByte ManufacturerCode { get; set; } + public ushort ManufacturerCode { get; set; } /// /// Indicates size of maximum NPDU. This field is used as a high level indication for management @@ -68,7 +68,7 @@ public class ZDO_NODE_DESC_RSP : ZToolPacket /// /// Indicates maximum size of Transfer up to 0x7fff (This field is reserved in version 1.0 and shall be set to zero). /// - public DoubleByte MaxInTransferSize { get; private set; } + public ushort MaxInTransferSize { get; private set; } /// /// Bit 0 - Primary Trust Center @@ -78,7 +78,7 @@ public class ZDO_NODE_DESC_RSP : ZToolPacket /// 4 - Primary Discovery Cache /// 5 - Backup Discovery Cache /// - public DoubleByte ServerMask { get; private set; } + public ushort ServerMask { get; private set; } /// /// Specifies the Descriptor capabilities @@ -102,13 +102,13 @@ public ZDO_NODE_DESC_RSP(byte[] framedata) APSFlags = (byte)(framedata[6] & (byte)0x0F); FrequencyBand = (byte)(framedata[6] & (byte)0xF0 >> 4); MacCapabilitiesFlags = (CapabilitiesFlags)framedata[10]; - ManufacturerCode = new DoubleByte(framedata[11], framedata[12]); + ManufacturerCode = DoubleByte.Convert(framedata[11], framedata[12]); MaxBufferSize = framedata[13]; - MaxInTransferSize = new DoubleByte(framedata[14], framedata[15]); - ServerMask = new DoubleByte(framedata[16], framedata[17]); + MaxInTransferSize = DoubleByte.Convert(framedata[14], framedata[15]); + ServerMask = DoubleByte.Convert(framedata[16], framedata[17]); } } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_NODE_DESC_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_NODE_DESC_RSP), framedata); } public enum CapabilitiesFlags diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_REQ_SRSP.cs index b7ec13dd..352a73aa 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_NWK_ADDR_REQ_SRSP() public ZDO_NWK_ADDR_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_NWK_ADDR_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_NWK_ADDR_REQ_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_RSP.cs index 263ce790..51d0ae5c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_RSP.cs @@ -57,12 +57,12 @@ public ZDO_NWK_ADDR_RSP(byte[] framedata) { this.AssocDevList[i] = new ZToolAddress16(framedata[14 + (i * 2)], framedata[13 + (i * 2)]); } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_NWK_ADDR_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_NWK_ADDR_RSP), framedata); } public override string ToString() { - return "ZDO_NWK_ADDR_RSP{" + "AssocDevList=" + AssocDevList.ToString() + ", IEEEAddr=" + IEEEAddr + return "ZDO_NWK_ADDR_RSP{" + "AssocDevList=[" + string.Join(",",AssocDevList) + "], IEEEAddr=" + IEEEAddr + ", NumAssocDev=" + NumAssocDev + ", nwkAddr=" + NwkAddr + ", SrcAddress=" + SrcAddress + ", StartIndex=" + StartIndex + ", Status=" + Status + '}'; } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ.cs index e0141001..92af7c71 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ.cs @@ -29,7 +29,7 @@ public ZDO_POWER_DESC_REQ(ushort destination) framedata[1] = destination.GetByte(1); framedata[2] = framedata[0]; framedata[3] = framedata[1]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_POWER_DESC_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_POWER_DESC_REQ), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ_SRSP.cs index ac3ae151..744fcc7c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_POWER_DESC_REQ_SRSP() public ZDO_POWER_DESC_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_POWER_DESC_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_POWER_DESC_REQ_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_RSP.cs index 5ca06b77..b5f66357 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_RSP.cs @@ -51,7 +51,7 @@ public ZDO_POWER_DESC_RSP(byte[] framedata) this.CurrentSource = (framedata[6] & (0x0F)); this.CurrentLevel = (framedata[6] & (0xF0)) >> 4; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_POWER_DESC_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_POWER_DESC_RSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ.cs index 9b96289c..c83d79fe 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ.cs @@ -17,7 +17,7 @@ public ZDO_SIMPLE_DESC_REQ(ZToolAddress16 nwkAddr, byte endPoint) framedata[3] = nwkAddr.Msb; framedata[4] = endPoint; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_SIMPLE_DESC_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_SIMPLE_DESC_REQ), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ_SRSP.cs index 543459af..3dda7ba0 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ_SRSP.cs @@ -12,7 +12,7 @@ public ZDO_SIMPLE_DESC_REQ_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_SIMPLE_DESC_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_SIMPLE_DESC_REQ_SRSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs index 666ec2ed..9810d05e 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs @@ -41,12 +41,12 @@ public class ZDO_SIMPLE_DESC_RSP : ZToolPacket /// /// The profile Id for this endpoint /// - public DoubleByte ProfileId { get; private set; } + public ushort ProfileId { get; private set; } /// /// The Device Description Id for this endpoint /// - public DoubleByte DeviceId { get; private set; } + public ushort DeviceId { get; private set; } /// /// Defined as the following format 0 – Version 1.00 0x01-0x0F – Reserve @@ -61,7 +61,7 @@ public class ZDO_SIMPLE_DESC_RSP : ZToolPacket /// /// List of input cluster Id’s supported /// - public DoubleByte[] InClusterList { get; private set; } + public ushort[] InClusterList { get; private set; } /// /// The number of output clusters in the OutClusterLis @@ -71,7 +71,7 @@ public class ZDO_SIMPLE_DESC_RSP : ZToolPacket /// /// List of output cluster Id’s supported /// - public DoubleByte[] OutClusterList { get; private set; } + public ushort[] OutClusterList { get; private set; } public ZDO_SIMPLE_DESC_RSP(byte[] framedata) { @@ -83,28 +83,28 @@ public ZDO_SIMPLE_DESC_RSP(byte[] framedata) if (Len >= MIN_DESC_LEN) { Endpoint = framedata[6]; - ProfileId = new DoubleByte(framedata[8], framedata[7]); - DeviceId = new DoubleByte(framedata[10], framedata[9]); + ProfileId = DoubleByte.Convert(framedata[8], framedata[7]); + DeviceId = DoubleByte.Convert(framedata[10], framedata[9]); DeviceVersion = framedata[11]; NumInClusters = framedata[12]; - InClusterList = new DoubleByte[NumInClusters]; + InClusterList = new ushort[NumInClusters]; for (int i = 0; i < NumInClusters; i++) { - InClusterList[i] = new DoubleByte(framedata[(i * 2) + 14], framedata[(i * 2) + 13]); + InClusterList[i] = DoubleByte.Convert(framedata[(i * 2) + 14], framedata[(i * 2) + 13]); } NumOutClusters = framedata[((NumInClusters) * 2) + 13]; - OutClusterList = new DoubleByte[NumOutClusters]; + OutClusterList = new ushort[NumOutClusters]; for (int i = 0; i < NumOutClusters; i++) { - OutClusterList[i] = new DoubleByte(framedata[(i * 2) + ((NumInClusters) * 2) + 15], + OutClusterList[i] = DoubleByte.Convert(framedata[(i * 2) + ((NumInClusters) * 2) + 15], framedata[(i * 2) + ((NumInClusters) * 2) + 14]); } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_SIMPLE_DESC_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_SIMPLE_DESC_RSP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP.cs index 1d61b77d..03e702d1 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP.cs @@ -24,7 +24,7 @@ public ZDO_STARTUP_FROM_APP(byte start_delay) framedata[0] = (byte)(start_delay & 0xff); framedata[1] = (byte)((start_delay & 0xff) >> 8); - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_STARTUP_FROM_APP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_STARTUP_FROM_APP), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP_SRSP.cs index d570e48c..0be90f3d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_STARTUP_FROM_APP_SRSP() public ZDO_STARTUP_FROM_APP_SRSP(byte[] framedata) { Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_STARTUP_FROM_APP_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_STARTUP_FROM_APP_SRSP), framedata); } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATE_CHANGE_IND.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATE_CHANGE_IND.cs index 732021f6..a5043f90 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATE_CHANGE_IND.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATE_CHANGE_IND.cs @@ -18,7 +18,7 @@ public ZDO_STATE_CHANGE_IND(byte[] data) { Status = (DeviceState)data[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_STATE_CHANGE_IND), data); + BuildPacket(((ushort)ZToolCMD.ZDO_STATE_CHANGE_IND), data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATUS_ERROR_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATUS_ERROR_RSP.cs index 6c4953e1..c0b40323 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATUS_ERROR_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATUS_ERROR_RSP.cs @@ -22,7 +22,7 @@ public ZDO_STATUS_ERROR_RSP(byte[] data) SrcAddr = new ZToolAddress16(data[1], data[0]); Status = (PacketStatus)data[2]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_STATUS_ERROR_RSP), data); + BuildPacket(((ushort)ZToolCMD.ZDO_STATUS_ERROR_RSP), data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_TC_DEVICE_IND.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_TC_DEVICE_IND.cs index 3cd4db06..a8649a55 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_TC_DEVICE_IND.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_TC_DEVICE_IND.cs @@ -29,7 +29,7 @@ public ZDO_TC_DEVICE_IND(byte[] framedata) IeeeAddr = new ZToolAddress64(bytes); NwkAddr = new ZToolAddress16(framedata[11], framedata[10]); - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_TC_DEVICE_IND), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_TC_DEVICE_IND), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs index 77df6de4..49098b59 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs @@ -9,7 +9,7 @@ namespace ZigBeeNet.Hardware.TI.CC2531.Packet.ZDO public class ZDO_UNBIND_REQ : ZToolPacket { - public ZDO_UNBIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, DoubleByte cluster, + public ZDO_UNBIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, ushort cluster, byte addressingMode, ZToolAddress64 ieeeDst, byte epDst) { byte[] framedata; @@ -29,8 +29,8 @@ public ZDO_UNBIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, framedata[i + 2] = (byte)(bytes[7 - i] & 0xFF); } framedata[10] = epSrc; - framedata[11] = cluster.Lsb; - framedata[12] = cluster.Msb; + framedata[11] = DoubleByte.LSB(cluster); + framedata[12] = DoubleByte.MSB(cluster); framedata[13] = addressingMode; bytes = ieeeDst.Address; if (addressingMode == 3) @@ -46,7 +46,7 @@ public ZDO_UNBIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, framedata[14] = bytes[7]; framedata[15] = bytes[6]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_UNBIND_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_UNBIND_REQ), framedata); } public ZDO_UNBIND_REQ(ushort nwkDstAdr, ushort clusterId, ulong bindSrcAdr, byte bindSrcEP, ulong bindDstAdr, @@ -75,7 +75,7 @@ public ZDO_UNBIND_REQ(ushort nwkDstAdr, ushort clusterId, ulong bindSrcAdr, byte framedata[i + 14] = bDstAddr[i]; } framedata[22] = (byte)(bindDstEP & 0xFF); // TODO REMOVE?!??! - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_UNBIND_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_UNBIND_REQ), framedata); } /// TI.ZPI1.ZDO_UNBIND_REQ.ADDRESS_MODE diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ_SRSP.cs index 7b72787b..602bc06f 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_UNBIND_REQ_SRSP() public ZDO_UNBIND_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_UNBIND_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_UNBIND_REQ_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_RSP.cs index 712f83aa..dc694a8a 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_RSP.cs @@ -24,7 +24,7 @@ public ZDO_UNBIND_RSP(byte[] framedata) { this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); this.Status = framedata[2]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_UNBIND_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_UNBIND_RSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_CONF.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_CONF.cs index 4cb96ccd..69ed2943 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_CONF.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_CONF.cs @@ -33,7 +33,7 @@ public ZDO_USER_DESC_CONF(byte[] framedata) { this.NwkAddr = new ZToolAddress16(); } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_USER_DESC_CONF), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_CONF), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ.cs index b1886082..b8971384 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ.cs @@ -25,7 +25,7 @@ public ZDO_USER_DESC_REQ(ZToolAddress16 num1, ZToolAddress16 num2) framedata[2] = this.NwkAddr.Lsb; framedata[3] = this.NwkAddr.Msb; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_USER_DESC_REQ), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_REQ), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ_SRSP.cs index 961d18f1..361cbedd 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ_SRSP.cs @@ -13,7 +13,7 @@ public class ZDO_USER_DESC_REQ_SRSP : ZToolPacket public ZDO_USER_DESC_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_USER_DESC_REQ_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_REQ_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_RSP.cs index fd0fddea..4a4b4d18 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_RSP.cs @@ -51,7 +51,7 @@ public ZDO_USER_DESC_RSP(byte[] framedata) this.DescLen = 0; this.Descriptor = new byte[0]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_USER_DESC_RSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_RSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET.cs index c8fbff5d..95a8c2ba 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET.cs @@ -53,7 +53,7 @@ public ZDO_USER_DESC_SET(ZToolAddress16 num1, ZToolAddress16 num2, byte num3, by { framedata[i + 5] = this.Descriptor[i]; } - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_USER_DESC_SET), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_SET), framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET_SRSP.cs index f19b38f7..0bb809ec 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_USER_DESC_SET_SRSP() public ZDO_USER_DESC_SET_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(new DoubleByte((ushort)ZToolCMD.ZDO_USER_DESC_SET_SRSP), framedata); + BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_SET_SRSP), framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacket.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacket.cs index c03e012f..90eb5831 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacket.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacket.cs @@ -80,7 +80,7 @@ public enum CommandSubsystem : byte public int LEN { get; set; } - public DoubleByte CMD { get; set; } + public ushort CMD { get; set; } public bool Error { get; set; } = false; @@ -114,12 +114,12 @@ public ZToolPacket() } // PROTECTED? - public ZToolPacket(DoubleByte ApiId, byte[] frameData) + public ZToolPacket(ushort ApiId, byte[] frameData) { BuildPacket(ApiId, frameData); } - public void BuildPacket(DoubleByte ApiId, byte[] frameData) + public void BuildPacket(ushort ApiId, byte[] frameData) { // packet size is start byte + len byte + 2 cmd bytes + data + checksum byte Packet = new byte[frameData.Length + 5]; @@ -133,10 +133,10 @@ public void BuildPacket(DoubleByte ApiId, byte[] frameData) Packet[1] = (byte)LEN; checksum.AddByte(Packet[1]); // msb Cmd0 -> Type & Subsystem - Packet[2] = ApiId.Msb; + Packet[2] = DoubleByte.MSB(ApiId); checksum.AddByte(Packet[2]); // lsb Cmd1 -> PROFILE_ID_HOME_AUTOMATION - Packet[3] = ApiId.Lsb; + Packet[3] = DoubleByte.LSB(ApiId); checksum.AddByte(Packet[3]); CMD = ApiId; // data @@ -193,9 +193,9 @@ public override string ToString() .Append(", length=") .Append(LEN) .Append(", apiId=") - .Append(ByteUtils.ToBase16(CMD.Msb)) + .Append(ByteUtils.ToBase16(DoubleByte.MSB(CMD))) .Append(" ") - .Append(ByteUtils.ToBase16(CMD.Lsb)) + .Append(ByteUtils.ToBase16(DoubleByte.LSB(CMD))) .Append(", data=") .Append(ByteUtils.ToBase16(Packet)) .Append(", checksum=") diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacketStream.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacketStream.cs index 25e1f827..50132d45 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacketStream.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacketStream.cs @@ -51,7 +51,7 @@ public ZToolPacket ParsePacket() byte[] frameData; byte apiIdMSB = Read("API PROFILE_ID_HOME_AUTOMATION MSB"); byte apiIdLSB = Read("API PROFILE_ID_HOME_AUTOMATION LSB"); - DoubleByte apiId = new DoubleByte(apiIdMSB, apiIdLSB); + ushort apiId = DoubleByte.Convert(apiIdMSB, apiIdLSB); // TODO Remove generic never used // generic = true; if (_generic) @@ -127,7 +127,7 @@ public static async Task ReadAsync(Stream stream) if (buffer.Skip(1).Take(length + 3).Aggregate((byte)0x00, (total, next) => (byte)(total ^ next)) != buffer[length + 4]) throw new InvalidDataException("checksum error"); - DoubleByte cmd = new DoubleByte(buffer[3], buffer[2]); + ushort cmd = DoubleByte.Convert(buffer[3], buffer[2]); return ParsePayload(cmd, buffer.Skip(4).Take(length).ToArray()); } @@ -135,9 +135,9 @@ public static async Task ReadAsync(Stream stream) throw new InvalidDataException("unable to decode packet"); } - public static ZToolPacket ParsePayload(DoubleByte cmd, byte[] payload) + public static ZToolPacket ParsePayload(ushort cmd, byte[] payload) { - switch ((ZToolCMD)cmd.Value) + switch ((ZToolCMD)cmd) { case ZToolCMD.SYS_RESET_RESPONSE: return new SYS_RESET_RESPONSE(payload); @@ -281,7 +281,7 @@ public static ZToolPacket ParsePayload(DoubleByte cmd, byte[] payload) case ZToolCMD.UTIL_LED_CONTROL_RESPONSE: return new UTIL_LED_CONTROL_RESPONSE(payload); default: - Log.Warning("Unknown command ID: {Command}", cmd); + Log.Warning($"Unknown command ID: {{Command}} [0x{cmd:X4}]", cmd); return new ZToolPacket(cmd, payload); } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Util/ZToolAddress16.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Util/ZToolAddress16.cs index 39e5faf2..5437fa34 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Util/ZToolAddress16.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Util/ZToolAddress16.cs @@ -15,7 +15,7 @@ public class ZToolAddress16 : ZToolAddress public static readonly ZToolAddress16 ZNET_BROADCAST = new ZToolAddress16(0xFF, 0xFE); public static readonly ZToolAddress16 ZCZR_BROADCAST = new ZToolAddress16(0xFF, 0xFC); - private DoubleByte _doubleByte = new DoubleByte(); + private ushort _doubleByte;// = new DoubleByte(); /// /// Provide address as msb byte and lsb byte @@ -25,14 +25,13 @@ public class ZToolAddress16 : ZToolAddress /// public ZToolAddress16(byte msb, byte lsb) { - this._doubleByte.Msb = msb; - this._doubleByte.Lsb = lsb; + // this._doubleByte.Msb = msb; + // this._doubleByte.Lsb = lsb; + _doubleByte = (ushort)(msb<<8|lsb); } - public ZToolAddress16(byte[] arr) + public ZToolAddress16(byte[] arr) : this(arr[0],arr[1]) { - this._doubleByte.Msb = arr[0]; - this._doubleByte.Lsb = arr[1]; } public ZToolAddress16() @@ -44,34 +43,14 @@ public ushort Value { get { - return this._doubleByte.Value; + return _doubleByte; //this._doubleByte.Value; } } - public byte Msb - { - get - { - return this._doubleByte.Msb; - } - set - { - this._doubleByte.Msb = value; - } - } - - public byte Lsb - { - get - { - return this._doubleByte.Lsb; - } - set - { - this._doubleByte.Lsb = value; - } - } + public byte Msb => (byte)(_doubleByte>>8); + public byte Lsb => unchecked((byte)(_doubleByte)); + public override int GetHashCode() { return _doubleByte.GetHashCode(); @@ -102,11 +81,11 @@ public override byte[] Address { get { - return new byte[] { (byte)this._doubleByte.Msb, (byte)this._doubleByte.Lsb }; + return new byte[] { Msb, Lsb }; } protected set { - this._doubleByte = new DoubleByte(value[0], value[1]); + this._doubleByte = (ushort)(value[0]<<8 | value[1]); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeDongleTiCc2531.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeDongleTiCc2531.cs index 40e3d22e..72175192 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeDongleTiCc2531.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeDongleTiCc2531.cs @@ -103,7 +103,7 @@ public ZigBeeStatus Initialize() public bool Notify(AF_INCOMING_MSG msg) { ZigBeeApsFrame apsFrame = new ZigBeeApsFrame(); - apsFrame.Cluster = msg.ClusterId.Value; + apsFrame.Cluster = msg.ClusterId; apsFrame.DestinationEndpoint = msg.DstEndpoint; apsFrame.SourceEndpoint = msg.SrcEndpoint; apsFrame.Profile = GetEndpointProfile(msg.DstEndpoint); @@ -128,7 +128,7 @@ public void ReceivedAsynchronousCommand(ZToolPacket packet) } ZigBeeApsFrame apsFrame = null; - switch ((ZToolCMD)packet.CMD.Value) + switch ((ZToolCMD)packet.CMD) { case ZToolCMD.ZDO_MSG_CB_INCOMING: apsFrame = ZdoCallbackIncoming.Create(packet); diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeNet.Hardware.TI.CC2531.csproj b/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeNet.Hardware.TI.CC2531.csproj index 1d2309b6..a1d2dcc8 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeNet.Hardware.TI.CC2531.csproj +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeNet.Hardware.TI.CC2531.csproj @@ -19,4 +19,4 @@ - + \ No newline at end of file diff --git a/libraries/ZigBeeNet/Util/DoubleByte.cs b/libraries/ZigBeeNet/Util/DoubleByte.cs index a04bc15b..ae7ac7af 100644 --- a/libraries/ZigBeeNet/Util/DoubleByte.cs +++ b/libraries/ZigBeeNet/Util/DoubleByte.cs @@ -5,60 +5,58 @@ namespace ZigBeeNet { - public class DoubleByte + public static class DoubleByte { - /// - /// Gets or sets high byte - /// - public byte Msb { get; set; } - - /// - /// Gets or sets low byte - /// - public byte Lsb { get; set; } - - - public DoubleByte() - { - - } - - /// - /// Decomposes a 16bit int into high and low bytes - /// - /// - public DoubleByte(ushort val) - { - if (val > 0xFFFF || val < 0) - throw new InvalidDataException(nameof(val)); - - // split address into high and low bytes - Msb = (byte)(val >> 8); - Lsb = (byte)(val & 0xFF); - } - - /// - /// Constructs a 16bit value from two bytes (high and low) - /// - /// - /// - public DoubleByte(byte msb, byte lsb) - { - - if (msb > 0xFF) - throw new InvalidDataException(nameof(msb)); - if(lsb > 0xFF) - throw new InvalidDataException(nameof(lsb)); - - this.Msb = msb; - this.Lsb = lsb; - } - - public ushort Value => BitConverter.ToUInt16(new byte[2] { Lsb, Msb }, 0); - - public override string ToString() - { - return Value.ToString(); - } + // /// + // /// Gets or sets high byte + // /// + // public byte Msb { + // get => (byte)(Value>>8); + // set => Value = (ushort)(((byte)Value) | value<<8); + // } + + // /// + // /// Gets or sets low byte + // /// + // public byte Lsb { + // get => unchecked( (byte)Value ); + // set => Value = (ushort)(((byte)value) | Value&0xFF00 ); + // } + + + // // public DoubleByte() + // // { + + // // } + + // /// + // /// Decomposes a 16bit int into high and low bytes + // /// + // /// + // public DoubleByte(ushort val) + // { + // Value = val; + // } + + // /// + // /// Constructs a 16bit value from two bytes (high and low) + // /// + // /// + // /// + // public DoubleByte(byte msb, byte lsb) : this( (ushort)( msb<<8 | lsb)) + // { + + // } + + // public ushort Value { get; private set; } + + // public override string ToString() + // { + // return Value.ToString(); + // } + + public static ushort Convert(byte MSB,byte LSB) => (ushort)(MSB<<8 | LSB); + public static byte MSB(ushort doubleByte) => (byte)(doubleByte>>8); + public static byte LSB(ushort doubleByte) => (byte)doubleByte; } } From fb31e6e54ef955a4f3a0e8f94a5db2dfb1d89927 Mon Sep 17 00:00:00 2001 From: Olivier Blaise Date: Mon, 21 Dec 2020 07:58:33 +0100 Subject: [PATCH 04/10] Remove DoubleByte and replace by helper/extensions --- .../Implementation/CommandInterfaceImpl.cs | 7 ++- .../Packet/AF/AF_DATA_REQUEST_EXT.cs | 8 +-- .../Packet/AF/AF_INCOMING_MSG.cs | 4 +- .../Packet/SYS/SYS_PING_RESPONSE.cs | 7 ++- .../SimpleAPI/ZB_APP_REGISTER_REQUEST.cs | 18 +++--- .../Packet/SimpleAPI/ZB_BIND_CONFIRM.cs | 2 +- .../Packet/SimpleAPI/ZB_BIND_DEVICE.cs | 6 +- .../SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs | 2 +- .../SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs | 4 +- .../Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs | 5 +- .../UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs | 2 +- .../Packet/UTIL/UTIL_SET_PANID.cs | 7 ++- .../Packet/ZDO/ZDO_BIND_REQ.cs | 5 +- .../Packet/ZDO/ZDO_MSG_CB_INCOMING.cs | 2 +- .../Packet/ZDO/ZDO_MSG_CB_REGISTER.cs | 5 +- .../Packet/ZDO/ZDO_NODE_DESC_RSP.cs | 6 +- .../Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs | 8 +-- .../Packet/ZDO/ZDO_UNBIND_REQ.cs | 4 +- .../Packet/ZToolPacket.cs | 8 +-- .../Packet/ZToolPacketStream.cs | 4 +- .../ZigBeeNet/Extensions/DataTypeExtension.cs | 22 +++++-- libraries/ZigBeeNet/Util/ByteHelper.cs | 7 ++- libraries/ZigBeeNet/Util/DoubleByte.cs | 62 ------------------- 23 files changed, 81 insertions(+), 124 deletions(-) delete mode 100644 libraries/ZigBeeNet/Util/DoubleByte.cs diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/CommandInterfaceImpl.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/CommandInterfaceImpl.cs index 9f560f1b..dd0cab62 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/CommandInterfaceImpl.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Implementation/CommandInterfaceImpl.cs @@ -7,6 +7,7 @@ using ZigBeeNet.Hardware.TI.CC2531.Packet; using ZigBeeNet.Transport; using ZigBeeNet.Hardware.TI.CC2531.Util; +using ZigBeeNet.Extensions; using System.Threading; using Serilog; @@ -118,7 +119,7 @@ public void Error(Exception th) public void HandlePacket(ZToolPacket packet) { ushort cmdId = packet.CMD; - switch (DoubleByte.MSB(cmdId) & 0xE0) + switch (cmdId.GetMSB() & 0xE0) { // Received incoming message which can be either message from dongle or remote device. case 0x40: @@ -197,7 +198,7 @@ public void SendSynchronousCommand(ZToolPacket packet, ISynchronousCommandListen } ushort cmdId = packet.CMD; - int value = (DoubleByte.MSB(cmdId) & 0xE0); + int value = (cmdId.GetMSB() & 0xE0); if (value != 0x20) { throw new ArgumentException("You are trying to send a non SREQ packet as synchronous command. " + "Evaluated " + value @@ -259,7 +260,7 @@ public void SendSynchronousCommand(ZToolPacket packet, ISynchronousCommandListen /// public void SendAsynchronousCommand(ZToolPacket packet) { - byte value = (byte)(DoubleByte.MSB(packet.CMD) & 0xE0); + byte value = (byte)(packet.CMD.GetMSB() & 0xE0); if (value != 0x40) { throw new ArgumentException("You are trying to send a non AREQ packet. " + "Evaluated " + value diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs index f3713033..ebbe3470 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs @@ -31,13 +31,13 @@ public AF_DATA_REQUEST_EXT(ushort groupdId, short srcEndPoint, int j, int k, byt framedata[10] = 0x00; // Destination PAN ID framedata[11] = 0x00; // Destination PAN ID framedata[12] = (byte)(srcEndPoint & 0xFF); - framedata[13] = j.GetByte(0); - framedata[14] = j.GetByte(1); + framedata[13] = ((ushort)j).GetByte(0); + framedata[14] = ((ushort)j).GetByte(1); framedata[15] = (byte)(k & 0xFF); framedata[16] = (byte)(bitmapOpt & 0xFF); framedata[17] = (byte)(radius & 0xFF); - framedata[18] = payload.Length.GetByte(0); - framedata[19] = payload.Length.GetByte(1); + framedata[18] = ((ushort)payload.Length).GetByte(0); + framedata[19] = ((ushort)payload.Length).GetByte(1); for (int i = 0; i < payload.Length; i++) { framedata[20 + i] = payload[i]; diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs index 40265332..4f5d8d47 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs @@ -73,8 +73,8 @@ public class AF_INCOMING_MSG : ZToolPacket public AF_INCOMING_MSG(byte[] framedata) { - GroupId = DoubleByte.Convert(framedata[1], framedata[0]); - ClusterId = DoubleByte.Convert(framedata[3], framedata[2]); + GroupId = ByteHelper.ShortFromBytes(framedata[1], framedata[0]); + ClusterId = ByteHelper.ShortFromBytes(framedata[3], framedata[2]); SrcAddr = new ZToolAddress16(framedata[5], framedata[4]); SrcEndpoint = framedata[6]; DstEndpoint = framedata[7]; diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs index 7aed8778..e284a1f7 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using ZigBeeNet.Extensions; namespace ZigBeeNet.Hardware.TI.CC2531.Packet.SYS { @@ -21,15 +22,15 @@ public SYS_PING_RESPONSE(ushort capabilities1) this.Capabilities = capabilities1; byte[] framedata = new byte[2]; - framedata[0] = DoubleByte.LSB(capabilities1); - framedata[1] = DoubleByte.MSB(capabilities1); + framedata[0] = capabilities1.GetLSB(); + framedata[1] = capabilities1.GetMSB(); BuildPacket(((ushort)ZToolCMD.SYS_PING_RESPONSE), framedata); } public SYS_PING_RESPONSE(byte[] framedata) { - this.Capabilities = DoubleByte.Convert(framedata[1], framedata[0]); + this.Capabilities = ByteHelper.ShortFromBytes(framedata[1], framedata[0]); BuildPacket(((ushort)ZToolCMD.SYS_PING_RESPONSE), framedata); } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs index 2d2df449..986a7104 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Text; - +using ZigBeeNet.Extensions; namespace ZigBeeNet.Hardware.TI.CC2531.Packet.SimpleAPI { public class ZB_APP_REGISTER_REQUEST : ZToolPacket @@ -64,23 +64,23 @@ public ZB_APP_REGISTER_REQUEST(byte num1, ushort num2, ushort num3, byte num4, b byte[] framedata = new byte[9 + this.InputCommandsList.Length * 2 + this.OutputCommandsList.Length * 2]; framedata[0] = this.AppEndPoint; - framedata[1] = DoubleByte.LSB(this.AppProfileID); - framedata[2] = DoubleByte.MSB(this.AppProfileID); - framedata[3] = DoubleByte.LSB(this.DeviceId); - framedata[4] = DoubleByte.MSB(this.DeviceId); + framedata[1] = this.AppProfileID.GetLSB(); + framedata[2] = this.AppProfileID.GetMSB(); + framedata[3] = this.DeviceId.GetLSB(); + framedata[4] = this.DeviceId.GetMSB(); framedata[5] = this.DeviceVersion; framedata[6] = this.Unused; framedata[7] = this.InputCommandsNum; for (int i = 0; i < this.InputCommandsList.Length; i++) { - framedata[(i * 2) + 8] = DoubleByte.LSB(this.InputCommandsList[i]); - framedata[(i * 2) + 9] = DoubleByte.MSB(this.InputCommandsList[i]); + framedata[(i * 2) + 8] = this.InputCommandsList[i].GetLSB(); + framedata[(i * 2) + 9] = this.InputCommandsList[i].GetMSB(); } framedata[((this.InputCommandsList.Length) * 2) + 8] = this.OutputCommandsNum; for (int i = 0; i < this.OutputCommandsList.Length; i++) { - framedata[(i * 2) + ((this.InputCommandsList.Length) * 2) + 9] = DoubleByte.LSB(this.OutputCommandsList[i]); - framedata[(i * 2) + ((this.InputCommandsList.Length) * 2) + 10] = DoubleByte.MSB(this.OutputCommandsList[i]); + framedata[(i * 2) + ((this.InputCommandsList.Length) * 2) + 9] = this.OutputCommandsList[i].GetLSB(); + framedata[(i * 2) + ((this.InputCommandsList.Length) * 2) + 10] = this.OutputCommandsList[i].GetMSB(); } BuildPacket(((ushort)ZToolCMD.ZB_APP_REGISTER_REQUEST), framedata); diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs index f5e5d80b..2db94e74 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs @@ -23,7 +23,7 @@ public ZB_BIND_CONFIRM() /// Constructor public ZB_BIND_CONFIRM(byte[] framedata) { - this.CommandId = DoubleByte.Convert(framedata[1],framedata[0]); + this.CommandId = ByteHelper.ShortFromBytes(framedata[1],framedata[0]); this.Status = framedata[2]; BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_CONFIRM), framedata); } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs index faac27e4..929c6af8 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; using ZigBeeNet.Hardware.TI.CC2531.Util; - +using ZigBeeNet.Extensions; namespace ZigBeeNet.Hardware.TI.CC2531.Packet.SimpleAPI { /// @@ -34,8 +34,8 @@ public ZB_BIND_DEVICE(bool create, ushort commandId, ZToolAddress64 destination) byte[] framedata = new byte[11]; framedata[0] = create ? (byte)0x01 : (byte)0x00; - framedata[1] = DoubleByte.LSB(commandId); - framedata[2] = DoubleByte.MSB(commandId); + framedata[1] = commandId.GetLSB(); + framedata[2] = commandId.GetMSB(); byte[] dst = destination.Address; for (int i = 3; i < 8; i++) diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs index 77cebf89..db017c1c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs @@ -27,7 +27,7 @@ public class ZB_FIND_DEVICE_CONFIRM : ZToolPacket public ZB_FIND_DEVICE_CONFIRM(byte[] framedata) { SearchType = framedata[0]; - SearchKey = DoubleByte.Convert(framedata[1], framedata[2]); + SearchKey = ByteHelper.ShortFromBytes(framedata[1], framedata[2]); Result = new byte[8]; for (int i = 0; i < 8; i++) diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs index 23109402..b3d1dad3 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs @@ -33,8 +33,8 @@ public class ZB_RECEIVE_DATA_INDICATION : ZToolPacket public ZB_RECEIVE_DATA_INDICATION(byte[] framedata) { Source = new ZToolAddress16(framedata[1], framedata[0]); - Command = DoubleByte.Convert(framedata[3], framedata[2]); - Len = DoubleByte.Convert(framedata[5], framedata[4]); + Command = ByteHelper.ShortFromBytes(framedata[3], framedata[2]); + Len = ByteHelper.ShortFromBytes(framedata[5], framedata[4]); Data = new byte[framedata.Length - 6]; for (int i = 0; i < Data.Length; i++) diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs index 4b480d6d..3c1d8c97 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text; using ZigBeeNet.Hardware.TI.CC2531.Util; +using ZigBeeNet.Extensions; namespace ZigBeeNet.Hardware.TI.CC2531.Packet.SimpleAPI { @@ -70,8 +71,8 @@ public ZB_SEND_DATA_REQUEST(ZToolAddress16 destination, ushort commandId, int ha byte[] framedata = new byte[PayloadValue.Length + 8]; framedata[0] = Destination.Lsb; framedata[1] = Destination.Msb; - framedata[2] = DoubleByte.LSB(CommandId); - framedata[3] = DoubleByte.MSB(CommandId); + framedata[2] = CommandId.GetLSB(); + framedata[3] = CommandId.GetMSB(); framedata[4] = (byte)Handle; framedata[5] = (byte)Ack; framedata[6] = (byte)Radius; diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs index ce01fd26..df29836c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs @@ -56,7 +56,7 @@ public UTIL_GET_DEVICE_INFO_RESPONSE(byte[] framedata) AssocDevicesList = new ushort[this.NumAssocDevices]; for (int i = 0; i < this.AssocDevicesList.Length; i++) { - AssocDevicesList[i] = DoubleByte.Convert(framedata[14 + (i * 2)], framedata[15 + (i * 2)]); + AssocDevicesList[i] = ByteHelper.ShortFromBytes(framedata[14 + (i * 2)], framedata[15 + (i * 2)]); } BuildPacket(((ushort)ZToolCMD.UTIL_GET_DEVICE_INFO_RESPONSE), framedata); diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs index 83154ac1..c80da5ab 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using ZigBeeNet.Extensions; namespace ZigBeeNet.Hardware.TI.CC2531.Packet.UTIL { @@ -24,15 +25,15 @@ public UTIL_SET_PANID(ushort num1) byte[] framedata = new byte[1]; //Inversed because at first glance order wasn't valid - framedata[0] = DoubleByte.LSB(this.PanID); - framedata[1] = DoubleByte.MSB(this.PanID); + framedata[0] = this.PanID.GetLSB(); + framedata[1] = this.PanID.GetMSB(); BuildPacket(((ushort)ZToolCMD.UTIL_SET_PANID), framedata); } public UTIL_SET_PANID(byte[] framedata) { - this.PanID = DoubleByte.Convert(framedata[1], framedata[0]); + this.PanID = ByteHelper.ShortFromBytes(framedata[1], framedata[0]); BuildPacket(((ushort)ZToolCMD.UTIL_SET_PANID), framedata); } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs index 50925566..3e836ceb 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs @@ -3,6 +3,7 @@ using System.Text; using ZigBeeNet.Hardware.TI.CC2531.Util; using ZigBeeNet.ZCL; +using ZigBeeNet.Extensions; namespace ZigBeeNet.Hardware.TI.CC2531.Packet.ZDO { @@ -77,8 +78,8 @@ public ZDO_BIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, u } framedata[10] = epSrc; - framedata[11] = DoubleByte.LSB(cluster); - framedata[12] = DoubleByte.MSB(cluster); + framedata[11] = cluster.GetLSB(); + framedata[12] = cluster.GetMSB(); framedata[13] = (byte)addressingMode; bytes = ieeeDst.Address; if (addressingMode == Address_Mode.ADDRESS_64_BIT) diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs index 6e372119..c0fd819a 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs @@ -67,7 +67,7 @@ public ZDO_MSG_CB_INCOMING(byte[] framedata) { SrcAddr = new ZToolAddress16(framedata[1], framedata[0]); WasBroadcast = framedata[2]; - ClusterId = DoubleByte.Convert(framedata[4], framedata[3]); + ClusterId = ByteHelper.ShortFromBytes(framedata[4], framedata[3]); SecurityUse = framedata[5]; SeqNum = framedata[6]; MacDstAddr = new ZToolAddress16(framedata[8], framedata[7]); diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs index ad9ea16c..f0826908 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using ZigBeeNet.Extensions; namespace ZigBeeNet.Hardware.TI.CC2531.Packet.ZDO { @@ -9,8 +10,8 @@ public class ZDO_MSG_CB_REGISTER : ZToolPacket public ZDO_MSG_CB_REGISTER(ushort cluster) { byte[] framedata = new byte[2]; - framedata[0] = DoubleByte.LSB(cluster); - framedata[1] = DoubleByte.MSB(cluster); + framedata[0] = cluster.GetLSB(); + framedata[1] = cluster.GetMSB(); BuildPacket(((ushort)ZToolCMD.ZDO_MSG_CB_REGISTER), framedata); } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs index 26a0c378..21e38afc 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs @@ -102,10 +102,10 @@ public ZDO_NODE_DESC_RSP(byte[] framedata) APSFlags = (byte)(framedata[6] & (byte)0x0F); FrequencyBand = (byte)(framedata[6] & (byte)0xF0 >> 4); MacCapabilitiesFlags = (CapabilitiesFlags)framedata[10]; - ManufacturerCode = DoubleByte.Convert(framedata[11], framedata[12]); + ManufacturerCode = ByteHelper.ShortFromBytes(framedata[11], framedata[12]); MaxBufferSize = framedata[13]; - MaxInTransferSize = DoubleByte.Convert(framedata[14], framedata[15]); - ServerMask = DoubleByte.Convert(framedata[16], framedata[17]); + MaxInTransferSize = ByteHelper.ShortFromBytes(framedata[14], framedata[15]); + ServerMask = ByteHelper.ShortFromBytes(framedata[16], framedata[17]); } } BuildPacket(((ushort)ZToolCMD.ZDO_NODE_DESC_RSP), framedata); diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs index 9810d05e..2b7a3a18 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs @@ -83,8 +83,8 @@ public ZDO_SIMPLE_DESC_RSP(byte[] framedata) if (Len >= MIN_DESC_LEN) { Endpoint = framedata[6]; - ProfileId = DoubleByte.Convert(framedata[8], framedata[7]); - DeviceId = DoubleByte.Convert(framedata[10], framedata[9]); + ProfileId = ByteHelper.ShortFromBytes(framedata[8], framedata[7]); + DeviceId = ByteHelper.ShortFromBytes(framedata[10], framedata[9]); DeviceVersion = framedata[11]; NumInClusters = framedata[12]; @@ -92,7 +92,7 @@ public ZDO_SIMPLE_DESC_RSP(byte[] framedata) for (int i = 0; i < NumInClusters; i++) { - InClusterList[i] = DoubleByte.Convert(framedata[(i * 2) + 14], framedata[(i * 2) + 13]); + InClusterList[i] = ByteHelper.ShortFromBytes(framedata[(i * 2) + 14], framedata[(i * 2) + 13]); } NumOutClusters = framedata[((NumInClusters) * 2) + 13]; @@ -100,7 +100,7 @@ public ZDO_SIMPLE_DESC_RSP(byte[] framedata) for (int i = 0; i < NumOutClusters; i++) { - OutClusterList[i] = DoubleByte.Convert(framedata[(i * 2) + ((NumInClusters) * 2) + 15], + OutClusterList[i] = ByteHelper.ShortFromBytes(framedata[(i * 2) + ((NumInClusters) * 2) + 15], framedata[(i * 2) + ((NumInClusters) * 2) + 14]); } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs index 49098b59..befcb2f4 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs @@ -29,8 +29,8 @@ public ZDO_UNBIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, framedata[i + 2] = (byte)(bytes[7 - i] & 0xFF); } framedata[10] = epSrc; - framedata[11] = DoubleByte.LSB(cluster); - framedata[12] = DoubleByte.MSB(cluster); + framedata[11] = cluster.GetLSB(); + framedata[12] = cluster.GetMSB(); framedata[13] = addressingMode; bytes = ieeeDst.Address; if (addressingMode == 3) diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacket.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacket.cs index 90eb5831..3ca96cf8 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacket.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacket.cs @@ -133,10 +133,10 @@ public void BuildPacket(ushort ApiId, byte[] frameData) Packet[1] = (byte)LEN; checksum.AddByte(Packet[1]); // msb Cmd0 -> Type & Subsystem - Packet[2] = DoubleByte.MSB(ApiId); + Packet[2] = ApiId.GetMSB(); checksum.AddByte(Packet[2]); // lsb Cmd1 -> PROFILE_ID_HOME_AUTOMATION - Packet[3] = DoubleByte.LSB(ApiId); + Packet[3] = ApiId.GetLSB(); checksum.AddByte(Packet[3]); CMD = ApiId; // data @@ -193,9 +193,9 @@ public override string ToString() .Append(", length=") .Append(LEN) .Append(", apiId=") - .Append(ByteUtils.ToBase16(DoubleByte.MSB(CMD))) + .Append(ByteUtils.ToBase16(CMD.GetMSB())) .Append(" ") - .Append(ByteUtils.ToBase16(DoubleByte.LSB(CMD))) + .Append(ByteUtils.ToBase16(CMD.GetLSB())) .Append(", data=") .Append(ByteUtils.ToBase16(Packet)) .Append(", checksum=") diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacketStream.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacketStream.cs index 50132d45..612eb8e5 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacketStream.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZToolPacketStream.cs @@ -51,7 +51,7 @@ public ZToolPacket ParsePacket() byte[] frameData; byte apiIdMSB = Read("API PROFILE_ID_HOME_AUTOMATION MSB"); byte apiIdLSB = Read("API PROFILE_ID_HOME_AUTOMATION LSB"); - ushort apiId = DoubleByte.Convert(apiIdMSB, apiIdLSB); + ushort apiId = ByteHelper.ShortFromBytes(apiIdMSB, apiIdLSB); // TODO Remove generic never used // generic = true; if (_generic) @@ -127,7 +127,7 @@ public static async Task ReadAsync(Stream stream) if (buffer.Skip(1).Take(length + 3).Aggregate((byte)0x00, (total, next) => (byte)(total ^ next)) != buffer[length + 4]) throw new InvalidDataException("checksum error"); - ushort cmd = DoubleByte.Convert(buffer[3], buffer[2]); + ushort cmd = ByteHelper.ShortFromBytes(buffer[3], buffer[2]); return ParsePayload(cmd, buffer.Skip(4).Take(length).ToArray()); } diff --git a/libraries/ZigBeeNet/Extensions/DataTypeExtension.cs b/libraries/ZigBeeNet/Extensions/DataTypeExtension.cs index e79a4ceb..5c97ac0a 100644 --- a/libraries/ZigBeeNet/Extensions/DataTypeExtension.cs +++ b/libraries/ZigBeeNet/Extensions/DataTypeExtension.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.CompilerServices; using System.Collections.Generic; using System.Text; @@ -6,25 +7,34 @@ namespace ZigBeeNet.Extensions { public static class DataTypeExtension { + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte GetByte(this ushort value, int index) { if (index < 0 || index > 1) throw new ArgumentOutOfRangeException(nameof(index)); - - return BitConverter.GetBytes(value)[index]; + + if (index==0) // Little endian encoding + return value.GetLSB(); + else + return value.GetMSB(); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static byte GetMSB(this ushort value) => unchecked((byte)(value>>8)); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static byte GetLSB(this ushort value) => unchecked((byte)(value)); + public static byte GetByte(this int value, int index) { - if (index < 0 || index > 1) + if (index < 0 || index > 3) throw new ArgumentOutOfRangeException(nameof(index)); - return BitConverter.GetBytes(value)[index]; + return unchecked((byte)(value>>(8*index))); } public static byte[] GetBytes(this ushort value) { - return BitConverter.GetBytes(value); + return new byte[] { unchecked((byte)value), unchecked((byte)(value>>8)) }; } - } + } } diff --git a/libraries/ZigBeeNet/Util/ByteHelper.cs b/libraries/ZigBeeNet/Util/ByteHelper.cs index ea1799fb..0c0a9c51 100644 --- a/libraries/ZigBeeNet/Util/ByteHelper.cs +++ b/libraries/ZigBeeNet/Util/ByteHelper.cs @@ -8,9 +8,12 @@ public static class ByteHelper { public static ushort ShortFromBytes(byte[] values, int msb, int lsb) { - int value = (values[msb] << 8) + values[lsb]; + return ShortFromBytes(values[msb],values[lsb]); + } - return (ushort)value; + public static ushort ShortFromBytes(byte msb, byte lsb) + { + return (ushort)(msb<<8 | lsb); } public static long LongFromBytes(byte[] values, int msb, int lsb) diff --git a/libraries/ZigBeeNet/Util/DoubleByte.cs b/libraries/ZigBeeNet/Util/DoubleByte.cs deleted file mode 100644 index ae7ac7af..00000000 --- a/libraries/ZigBeeNet/Util/DoubleByte.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace ZigBeeNet -{ - public static class DoubleByte - { - // /// - // /// Gets or sets high byte - // /// - // public byte Msb { - // get => (byte)(Value>>8); - // set => Value = (ushort)(((byte)Value) | value<<8); - // } - - // /// - // /// Gets or sets low byte - // /// - // public byte Lsb { - // get => unchecked( (byte)Value ); - // set => Value = (ushort)(((byte)value) | Value&0xFF00 ); - // } - - - // // public DoubleByte() - // // { - - // // } - - // /// - // /// Decomposes a 16bit int into high and low bytes - // /// - // /// - // public DoubleByte(ushort val) - // { - // Value = val; - // } - - // /// - // /// Constructs a 16bit value from two bytes (high and low) - // /// - // /// - // /// - // public DoubleByte(byte msb, byte lsb) : this( (ushort)( msb<<8 | lsb)) - // { - - // } - - // public ushort Value { get; private set; } - - // public override string ToString() - // { - // return Value.ToString(); - // } - - public static ushort Convert(byte MSB,byte LSB) => (ushort)(MSB<<8 | LSB); - public static byte MSB(ushort doubleByte) => (byte)(doubleByte>>8); - public static byte LSB(ushort doubleByte) => (byte)doubleByte; - } -} From ff32bbbd19030c97d9715cfe6007b584943768f4 Mon Sep 17 00:00:00 2001 From: Olivier Blaise Date: Mon, 21 Dec 2020 08:11:38 +0100 Subject: [PATCH 05/10] Cleanup calls to BuildPacket --- .../ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_CONFIRM.cs | 2 +- .../ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST.cs | 2 +- .../Packet/AF/AF_DATA_REQUEST_EXT.cs | 2 +- .../Packet/AF/AF_DATA_REQUEST_SRSP.cs | 2 +- .../ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP.cs | 2 +- .../Packet/AF/AF_DATA_SRSP_EXT.cs | 2 +- .../ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs | 2 +- .../ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER.cs | 2 +- .../Packet/AF/AF_REGISTER_SRSP.cs | 2 +- libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING.cs | 2 +- .../Packet/SYS/SYS_PING_RESPONSE.cs | 4 ++-- .../ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET.cs | 2 +- .../Packet/SYS/SYS_RESET_RESPONSE.cs | 2 +- .../ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RPC_ERROR.cs | 4 ++-- .../Packet/SYS/SYS_TEST_LOOPBACK.cs | 2 +- .../Packet/SYS/SYS_TEST_LOOPBACK_SRSP.cs | 2 +- .../ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION.cs | 2 +- .../Packet/SYS/SYS_VERSION_RESPONSE.cs | 2 +- .../Packet/SimpleAPI/ZB_ALLOW_BIND.cs | 2 +- .../Packet/SimpleAPI/ZB_ALLOW_BIND_CONFIRM.cs | 2 +- .../Packet/SimpleAPI/ZB_ALLOW_BIND_RSP.cs | 4 ++-- .../Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs | 2 +- .../Packet/SimpleAPI/ZB_APP_REGISTER_RSP.cs | 2 +- .../Packet/SimpleAPI/ZB_BIND_CONFIRM.cs | 2 +- .../Packet/SimpleAPI/ZB_BIND_DEVICE.cs | 2 +- .../Packet/SimpleAPI/ZB_BIND_DEVICE_RSP.cs | 4 ++-- .../Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs | 2 +- .../Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST.cs | 2 +- .../Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST_RSP.cs | 4 ++-- .../Packet/SimpleAPI/ZB_GET_DEVICE_INFO.cs | 2 +- .../Packet/SimpleAPI/ZB_GET_DEVICE_INFO_RSP.cs | 2 +- .../Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST.cs | 2 +- .../Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST_RSP.cs | 2 +- .../Packet/SimpleAPI/ZB_READ_CONFIGURATION.cs | 2 +- .../Packet/SimpleAPI/ZB_READ_CONFIGURATION_RSP.cs | 2 +- .../Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs | 2 +- .../Packet/SimpleAPI/ZB_SEND_DATA_CONFIRM.cs | 2 +- .../Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs | 2 +- .../Packet/SimpleAPI/ZB_SEND_DATA_REQUEST_RSP.cs | 4 ++-- .../Packet/SimpleAPI/ZB_START_CONFIRM.cs | 2 +- .../Packet/SimpleAPI/ZB_START_REQUEST.cs | 2 +- .../Packet/SimpleAPI/ZB_START_REQUEST_RSP.cs | 4 ++-- .../Packet/SimpleAPI/ZB_SYSTEM_RESET.cs | 4 ++-- .../Packet/SimpleAPI/ZB_WRITE_CONFIGURATION.cs | 2 +- .../Packet/SimpleAPI/ZB_WRITE_CONFIGURATION_RSP.cs | 2 +- .../Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs | 2 +- .../Packet/UTIL/UTIL_LED_CONTROL.cs | 2 +- .../Packet/UTIL/UTIL_LED_CONTROL_RESPONSE.cs | 2 +- .../Packet/UTIL/UTIL_SET_CHANNELS_RESPONSE.cs | 2 +- .../Packet/UTIL/UTIL_SET_PANID.cs | 4 ++-- .../Packet/UTIL/UTIL_SET_PANID_RESPONSE.cs | 2 +- .../Packet/UTIL/UTIL_SET_SECURITY_LEVEL.cs | 4 ++-- .../Packet/UTIL/UTIL_SET_SECURITY_LEVEL_RESPONSE.cs | 4 ++-- .../Packet/ZDO/ZDO_ACTIVE_EP_REQ.cs | 2 +- .../Packet/ZDO/ZDO_ACTIVE_EP_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_ACTIVE_EP_RSP.cs | 2 +- .../ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs | 2 +- .../Packet/ZDO/ZDO_BIND_REQ_SRSP.cs | 2 +- .../ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_RSP.cs | 2 +- .../Packet/ZDO/ZDO_END_DEVICE_ANNCE.cs | 2 +- .../Packet/ZDO/ZDO_END_DEVICE_ANNCE_IND.cs | 2 +- .../Packet/ZDO/ZDO_END_DEVICE_ANNCE_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_END_DEVICE_BIND_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_END_DEVICE_BIND_RSP.cs | 2 +- .../Packet/ZDO/ZDO_IEEE_ADDR_REQ.cs | 2 +- .../Packet/ZDO/ZDO_IEEE_ADDR_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_IEEE_ADDR_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MATCH_DESC_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_MATCH_DESC_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LEAVE_REQ.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LEAVE_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LEAVE_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LQI_REQ.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LQI_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_LQI_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MGMT_RTG_RSP.cs | 2 +- .../Packet/ZDO/ZDO_MSG_CB_INCOMING.cs | 2 +- .../Packet/ZDO/ZDO_MSG_CB_REGISTER.cs | 2 +- .../Packet/ZDO/ZDO_MSG_CB_REGISTER_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_NODE_DESC_REQ.cs | 2 +- .../Packet/ZDO/ZDO_NODE_DESC_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_NODE_DESC_RSP.cs | 2 +- .../Packet/ZDO/ZDO_NWK_ADDR_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_NWK_ADDR_RSP.cs | 2 +- .../Packet/ZDO/ZDO_POWER_DESC_REQ.cs | 2 +- .../Packet/ZDO/ZDO_POWER_DESC_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_POWER_DESC_RSP.cs | 2 +- .../Packet/ZDO/ZDO_SIMPLE_DESC_REQ.cs | 2 +- .../Packet/ZDO/ZDO_SIMPLE_DESC_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs | 2 +- .../Packet/ZDO/ZDO_STARTUP_FROM_APP.cs | 2 +- .../Packet/ZDO/ZDO_STARTUP_FROM_APP_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_STATE_CHANGE_IND.cs | 2 +- .../Packet/ZDO/ZDO_STATUS_ERROR_RSP.cs | 2 +- .../Packet/ZDO/ZDO_TC_DEVICE_IND.cs | 2 +- .../ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs | 4 ++-- .../Packet/ZDO/ZDO_UNBIND_REQ_SRSP.cs | 2 +- .../ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_RSP.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_CONF.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_REQ.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_REQ_SRSP.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_RSP.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_SET.cs | 2 +- .../Packet/ZDO/ZDO_USER_DESC_SET_SRSP.cs | 2 +- 109 files changed, 121 insertions(+), 121 deletions(-) diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_CONFIRM.cs index 125a5156..de5bbcdf 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_CONFIRM.cs @@ -30,7 +30,7 @@ public AF_DATA_CONFIRM(byte[] framedata) Endpoint = framedata[1]; TransId = framedata[2]; - BuildPacket(((ushort)ZToolCMD.AF_DATA_CONFIRM), framedata); + BuildPacket((ushort)ZToolCMD.AF_DATA_CONFIRM, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST.cs index 23a28144..d41e593f 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST.cs @@ -92,7 +92,7 @@ public AF_DATA_REQUEST(ushort nwkDstAddr, byte dstEndpoint, byte srcEndpoint, us framedata[10 + i] = data[i]; } - BuildPacket(((ushort)ZToolCMD.AF_DATA_REQUEST), framedata); + BuildPacket((ushort)ZToolCMD.AF_DATA_REQUEST, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs index ebbe3470..1058f5b9 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_EXT.cs @@ -42,7 +42,7 @@ public AF_DATA_REQUEST_EXT(ushort groupdId, short srcEndPoint, int j, int k, byt { framedata[20 + i] = payload[i]; } - BuildPacket(((ushort)ZToolCMD.AF_DATA_REQUEST_EXT), framedata); + BuildPacket((ushort)ZToolCMD.AF_DATA_REQUEST_EXT, framedata); } } } \ No newline at end of file diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_SRSP.cs index 29a99fed..1baad56e 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_REQUEST_SRSP.cs @@ -12,7 +12,7 @@ public AF_DATA_REQUEST_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(((ushort)ZToolCMD.AF_DATA_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.AF_DATA_SRSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP.cs index 421fe2fd..26118f79 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP.cs @@ -19,7 +19,7 @@ public AF_DATA_SRSP() public AF_DATA_SRSP(byte[] framedata) { Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.AF_DATA_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.AF_DATA_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP_EXT.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP_EXT.cs index 11a3fb08..12bb17a0 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP_EXT.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_DATA_SRSP_EXT.cs @@ -19,7 +19,7 @@ public class AF_DATA_SRSP_EXT : ZToolPacket public AF_DATA_SRSP_EXT(byte[] framedata) { Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.AF_DATA_SRSP_EXT), framedata); + BuildPacket((ushort)ZToolCMD.AF_DATA_SRSP_EXT, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs index 4f5d8d47..6e100ef1 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_INCOMING_MSG.cs @@ -95,7 +95,7 @@ public AF_INCOMING_MSG(byte[] framedata) this.Data[i] = framedata[17 + i]; } - BuildPacket(((ushort)ZToolCMD.AF_INCOMING_MSG), framedata); + BuildPacket((ushort)ZToolCMD.AF_INCOMING_MSG, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER.cs index 9207b7c8..18b3e022 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER.cs @@ -91,7 +91,7 @@ public AF_REGISTER(byte endpoint, ushort appProfId, ushort appDeviceId, byte add framedata[(i * 2) + ((AppInClusterList.Length) * 2) + 10] = AppOutClusterList[i].GetByte(1); } - BuildPacket(((ushort)ZToolCMD.AF_REGISTER), framedata); + BuildPacket((ushort)ZToolCMD.AF_REGISTER, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER_SRSP.cs index acf97c9a..6df4674b 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/AF/AF_REGISTER_SRSP.cs @@ -12,7 +12,7 @@ public AF_REGISTER_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(((ushort)ZToolCMD.AF_REGISTER_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.AF_REGISTER_SRSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING.cs index 29b36b80..60852c61 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING.cs @@ -8,7 +8,7 @@ public class SYS_PING : ZToolPacket { public SYS_PING() { - BuildPacket(((ushort)ZToolCMD.SYS_PING), new byte[0]); + BuildPacket((ushort)ZToolCMD.SYS_PING, new byte[0]); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs index e284a1f7..5732a1b6 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_PING_RESPONSE.cs @@ -25,14 +25,14 @@ public SYS_PING_RESPONSE(ushort capabilities1) framedata[0] = capabilities1.GetLSB(); framedata[1] = capabilities1.GetMSB(); - BuildPacket(((ushort)ZToolCMD.SYS_PING_RESPONSE), framedata); + BuildPacket((ushort)ZToolCMD.SYS_PING_RESPONSE, framedata); } public SYS_PING_RESPONSE(byte[] framedata) { this.Capabilities = ByteHelper.ShortFromBytes(framedata[1], framedata[0]); - BuildPacket(((ushort)ZToolCMD.SYS_PING_RESPONSE), framedata); + BuildPacket((ushort)ZToolCMD.SYS_PING_RESPONSE, framedata); } /// TI.ZPI1.SYS_PING_RESPONSE.CAPABILITIES diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET.cs index 5d309dde..e7213538 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET.cs @@ -11,7 +11,7 @@ public SYS_RESET(byte resetType) byte[] framedata = new byte[1]; framedata[0] = resetType; - BuildPacket(((ushort)ZToolCMD.SYS_RESET), framedata); + BuildPacket((ushort)ZToolCMD.SYS_RESET, framedata); } /// TI.ZPI1.SYS_RESET.RESET_TYPE diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET_RESPONSE.cs index cf2384f0..9e179a52 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RESET_RESPONSE.cs @@ -48,7 +48,7 @@ public SYS_RESET_RESPONSE(byte[] framedata) MinorRel = framedata[4]; HwRev = framedata[5]; - BuildPacket(((ushort)ZToolCMD.SYS_RESET_RESPONSE), framedata); + BuildPacket((ushort)ZToolCMD.SYS_RESET_RESPONSE, framedata); } public enum ResetType : byte diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RPC_ERROR.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RPC_ERROR.cs index efcabcaf..32ca6be8 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RPC_ERROR.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_RPC_ERROR.cs @@ -30,7 +30,7 @@ public SYS_RPC_ERROR(byte num1, byte num2, byte num3) this.ErrCmd0 = num2; this.ErrCmd1 = num3; byte[] framedata = { num1, num2, num3 }; - BuildPacket(((ushort)ZToolCMD.SYS_RPC_ERROR), framedata); + BuildPacket((ushort)ZToolCMD.SYS_RPC_ERROR, framedata); } public SYS_RPC_ERROR(byte[] framedata) @@ -38,7 +38,7 @@ public SYS_RPC_ERROR(byte[] framedata) this.Status = framedata[0]; this.ErrCmd0 = framedata[1]; this.ErrCmd1 = framedata[3]; - BuildPacket(((ushort)ZToolCMD.SYS_RPC_ERROR), framedata); + BuildPacket((ushort)ZToolCMD.SYS_RPC_ERROR, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK.cs index 33fea107..c4bed369 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK.cs @@ -19,7 +19,7 @@ public SYS_TEST_LOOPBACK(byte[] buffer1) this.TestData = buffer1; byte[] framedata = new byte[buffer1.Length]; framedata = this.TestData; - BuildPacket(((ushort)ZToolCMD.SYS_TEST_LOOPBACK), framedata); + BuildPacket((ushort)ZToolCMD.SYS_TEST_LOOPBACK, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK_SRSP.cs index e38921af..4523c142 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_TEST_LOOPBACK_SRSP.cs @@ -17,7 +17,7 @@ public SYS_TEST_LOOPBACK_SRSP(byte[] framedata) { this.TestData = new byte[framedata.Length]; this.TestData = framedata; - BuildPacket(((ushort)ZToolCMD.SYS_TEST_LOOPBACK_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.SYS_TEST_LOOPBACK_SRSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION.cs index 1a71eaaa..5d22e0fe 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION.cs @@ -9,7 +9,7 @@ public class SYS_VERSION : ZToolPacket public SYS_VERSION() { - BuildPacket(((ushort)ZToolCMD.SYS_VERSION), new byte[0]); + BuildPacket((ushort)ZToolCMD.SYS_VERSION, new byte[0]); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION_RESPONSE.cs index 824727c3..67abeb56 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SYS/SYS_VERSION_RESPONSE.cs @@ -38,7 +38,7 @@ public SYS_VERSION_RESPONSE(byte[] framedata) MinorRel = framedata[3]; HwRev = framedata[4]; - BuildPacket(((ushort)ZToolCMD.SYS_VERSION_RESPONSE), framedata); + BuildPacket((ushort)ZToolCMD.SYS_VERSION_RESPONSE, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND.cs index a9cd3263..ff0684f0 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND.cs @@ -26,7 +26,7 @@ public ZB_ALLOW_BIND(byte timeout) byte[] framedata = new byte[1]; framedata[0] = Timeout; - BuildPacket(((ushort)ZToolCMD.ZB_ALLOW_BIND), framedata); + BuildPacket((ushort)ZToolCMD.ZB_ALLOW_BIND, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_CONFIRM.cs index eb611d95..8ac3ae47 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_CONFIRM.cs @@ -20,7 +20,7 @@ public ZB_ALLOW_BIND_CONFIRM(byte[] framedata) Source = new ZToolAddress16(framedata[1], framedata[0]); - BuildPacket(((ushort)ZToolCMD.ZB_ALLOW_BIND_CONFIRM), framedata); + BuildPacket((ushort)ZToolCMD.ZB_ALLOW_BIND_CONFIRM, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_RSP.cs index c2105884..c103beb8 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_ALLOW_BIND_RSP.cs @@ -8,12 +8,12 @@ public class ZB_ALLOW_BIND_RSP : ZToolPacket { public ZB_ALLOW_BIND_RSP() { - BuildPacket(((ushort)ZToolCMD.ZB_ALLOW_BIND_RSP), new byte[0]); + BuildPacket((ushort)ZToolCMD.ZB_ALLOW_BIND_RSP, new byte[0]); } public ZB_ALLOW_BIND_RSP(byte[] framedata) { - BuildPacket(((ushort)ZToolCMD.ZB_ALLOW_BIND_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZB_ALLOW_BIND_RSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs index 986a7104..6d1728ea 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_REQUEST.cs @@ -82,7 +82,7 @@ public ZB_APP_REGISTER_REQUEST(byte num1, ushort num2, ushort num3, byte num4, b framedata[(i * 2) + ((this.InputCommandsList.Length) * 2) + 9] = this.OutputCommandsList[i].GetLSB(); framedata[(i * 2) + ((this.InputCommandsList.Length) * 2) + 10] = this.OutputCommandsList[i].GetMSB(); } - BuildPacket(((ushort)ZToolCMD.ZB_APP_REGISTER_REQUEST), framedata); + BuildPacket((ushort)ZToolCMD.ZB_APP_REGISTER_REQUEST, framedata); } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_RSP.cs index bf7805b6..7688ad42 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_APP_REGISTER_RSP.cs @@ -19,7 +19,7 @@ public ZB_APP_REGISTER_RSP() public ZB_APP_REGISTER_RSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZB_APP_REGISTER_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZB_APP_REGISTER_RSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs index 2db94e74..083a5fa0 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_CONFIRM.cs @@ -25,7 +25,7 @@ public ZB_BIND_CONFIRM(byte[] framedata) { this.CommandId = ByteHelper.ShortFromBytes(framedata[1],framedata[0]); this.Status = framedata[2]; - BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_CONFIRM), framedata); + BuildPacket((ushort)ZToolCMD.ZB_FIND_DEVICE_CONFIRM, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs index 929c6af8..070f3670 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE.cs @@ -43,7 +43,7 @@ public ZB_BIND_DEVICE(bool create, ushort commandId, ZToolAddress64 destination) framedata[i] = dst[i - 3]; } - BuildPacket(((ushort)ZToolCMD.ZB_BIND_DEVICE), framedata); + BuildPacket((ushort)ZToolCMD.ZB_BIND_DEVICE, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE_RSP.cs index a2ad5bc8..e1dc85a6 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_BIND_DEVICE_RSP.cs @@ -8,12 +8,12 @@ public class ZB_BIND_DEVICE_RSP : ZToolPacket { public ZB_BIND_DEVICE_RSP() { - BuildPacket(((ushort)ZToolCMD.ZB_BIND_DEVICE_RSP), new byte[0]); + BuildPacket((ushort)ZToolCMD.ZB_BIND_DEVICE_RSP, new byte[0]); } public ZB_BIND_DEVICE_RSP(byte[] framedata) { - BuildPacket(((ushort)ZToolCMD.ZB_BIND_DEVICE_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZB_BIND_DEVICE_RSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs index db017c1c..72cdfd14 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_CONFIRM.cs @@ -35,7 +35,7 @@ public ZB_FIND_DEVICE_CONFIRM(byte[] framedata) this.Result[i] = framedata[i + 3]; } - BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_CONFIRM), framedata); + BuildPacket((ushort)ZToolCMD.ZB_FIND_DEVICE_CONFIRM, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST.cs index 929cfef1..8affba71 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST.cs @@ -22,7 +22,7 @@ public ZB_FIND_DEVICE_REQUEST(ulong searchKey) { SearchKey = searchKey; byte[] framedata = ByteUtils.ConvertLongtoMultiByte(SearchKey); - BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST), framedata); + BuildPacket((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST_RSP.cs index 059c116d..1680f52f 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_FIND_DEVICE_REQUEST_RSP.cs @@ -8,12 +8,12 @@ public class ZB_FIND_DEVICE_REQUEST_RSP : ZToolPacket { public ZB_FIND_DEVICE_REQUEST_RSP() { - BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP), new byte[0]); + BuildPacket((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP, new byte[0]); } public ZB_FIND_DEVICE_REQUEST_RSP(byte[] framedata) { - BuildPacket(((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO.cs index 883e6e12..656c70ab 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO.cs @@ -19,7 +19,7 @@ public ZB_GET_DEVICE_INFO(DEV_INFO_TYPE param) Param = param; byte[] framedata = new byte[] { (byte)param }; - BuildPacket(((ushort)ZToolCMD.ZB_GET_DEVICE_INFO), framedata); + BuildPacket((ushort)ZToolCMD.ZB_GET_DEVICE_INFO, framedata); } public enum DEV_INFO_TYPE : byte diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO_RSP.cs index 9e05d1e1..05ad2f2b 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_GET_DEVICE_INFO_RSP.cs @@ -21,7 +21,7 @@ public ZB_GET_DEVICE_INFO_RSP(byte[] framedata) this.Value[i] = framedata[i + 1]; } - BuildPacket(((ushort)ZToolCMD.ZB_GET_DEVICE_INFO_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZB_GET_DEVICE_INFO_RSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST.cs index baa417f3..8beab1b5 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST.cs @@ -28,7 +28,7 @@ public ZB_PERMIT_JOINING_REQUEST(ushort dstAddr, byte timeout) data.AddRange(Destination.GetBytes()); data.Add(Timeout); - BuildPacket(((ushort)ZToolCMD.ZB_PERMIT_JOINING_REQUEST), data.ToArray()); + BuildPacket((ushort)ZToolCMD.ZB_PERMIT_JOINING_REQUEST, data.ToArray()); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST_RSP.cs index 845640d4..9ce4287f 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_PERMIT_JOINING_REQUEST_RSP.cs @@ -13,7 +13,7 @@ public ZB_PERMIT_JOINING_REQUEST_RSP(byte[] data) { Status = data[0]; - BuildPacket(((ushort)ZToolCMD.ZB_PERMIT_JOINING_REQUEST_RSP), data); + BuildPacket((ushort)ZToolCMD.ZB_PERMIT_JOINING_REQUEST_RSP, data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION.cs index 70b84336..749900f4 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION.cs @@ -20,7 +20,7 @@ public ZB_READ_CONFIGURATION(ZB_WRITE_CONFIGURATION.CONFIG_ID configId) byte[] framedata = new byte[] { (byte)configId }; - BuildPacket(((ushort)ZToolCMD.ZB_READ_CONFIGURATION), framedata); + BuildPacket((ushort)ZToolCMD.ZB_READ_CONFIGURATION, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION_RSP.cs index dea8876d..94cb724d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_READ_CONFIGURATION_RSP.cs @@ -42,7 +42,7 @@ public ZB_READ_CONFIGURATION_RSP(byte[] framedata) this.Value[i] = framedata[i + 3]; } - BuildPacket(((ushort)ZToolCMD.ZB_READ_CONFIGURATION_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZB_READ_CONFIGURATION_RSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs index b3d1dad3..59ce4e8d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_RECEIVE_DATA_INDICATION.cs @@ -42,7 +42,7 @@ public ZB_RECEIVE_DATA_INDICATION(byte[] framedata) Data[i] = framedata[i + 6]; } - BuildPacket(((ushort)ZToolCMD.ZB_RECEIVE_DATA_INDICATION), framedata); + BuildPacket((ushort)ZToolCMD.ZB_RECEIVE_DATA_INDICATION, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_CONFIRM.cs index 93943070..86271882 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_CONFIRM.cs @@ -24,7 +24,7 @@ public ZB_SEND_DATA_CONFIRM(byte[] framedata) Handle = framedata[0]; Status = (PacketStatus)framedata[1]; - BuildPacket(((ushort)ZToolCMD.ZB_SEND_DATA_CONFIRM), framedata); + BuildPacket((ushort)ZToolCMD.ZB_SEND_DATA_CONFIRM, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs index 3c1d8c97..32b35a78 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST.cs @@ -83,7 +83,7 @@ public ZB_SEND_DATA_REQUEST(ZToolAddress16 destination, ushort commandId, int ha framedata[i + 8] = this.PayloadValue[i]; } - BuildPacket(((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST), framedata); + BuildPacket((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST_RSP.cs index 0ec8524d..ab8ee675 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SEND_DATA_REQUEST_RSP.cs @@ -8,12 +8,12 @@ public class ZB_SEND_DATA_REQUEST_RSP : ZToolPacket { public ZB_SEND_DATA_REQUEST_RSP() { - BuildPacket(((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST_RSP), new byte[0]); + BuildPacket((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST_RSP, new byte[0]); } public ZB_SEND_DATA_REQUEST_RSP(byte[] framedata) { - BuildPacket(((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZB_SEND_DATA_REQUEST_RSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_CONFIRM.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_CONFIRM.cs index 81bd62cd..d7435306 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_CONFIRM.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_CONFIRM.cs @@ -18,7 +18,7 @@ public ZB_START_CONFIRM(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZB_START_CONFIRM), framedata); + BuildPacket((ushort)ZToolCMD.ZB_START_CONFIRM, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST.cs index af1b38e3..222a7400 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST.cs @@ -13,7 +13,7 @@ public class ZB_START_REQUEST : ZToolPacket { public ZB_START_REQUEST() { - BuildPacket(((ushort)ZToolCMD.ZB_START_REQUEST), new byte[0]); + BuildPacket((ushort)ZToolCMD.ZB_START_REQUEST, new byte[0]); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST_RSP.cs index f691f416..2a98286c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_START_REQUEST_RSP.cs @@ -8,12 +8,12 @@ public class ZB_START_REQUEST_RSP : ZToolPacket { public ZB_START_REQUEST_RSP() { - BuildPacket(((ushort)ZToolCMD.ZB_START_REQUEST_RSP), new byte[0]); + BuildPacket((ushort)ZToolCMD.ZB_START_REQUEST_RSP, new byte[0]); } public ZB_START_REQUEST_RSP(byte[] framedata) { - BuildPacket(((ushort)ZToolCMD.ZB_START_REQUEST_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZB_START_REQUEST_RSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SYSTEM_RESET.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SYSTEM_RESET.cs index 20698fb6..871a3bcd 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SYSTEM_RESET.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_SYSTEM_RESET.cs @@ -14,12 +14,12 @@ public class ZB_SYSTEM_RESET : ZToolPacket { public ZB_SYSTEM_RESET() { - BuildPacket(((ushort)ZToolCMD.ZB_SYSTEM_RESET), new byte[0]); + BuildPacket((ushort)ZToolCMD.ZB_SYSTEM_RESET, new byte[0]); } public ZB_SYSTEM_RESET(byte[] framedata) { - BuildPacket(((ushort)ZToolCMD.ZB_SYSTEM_RESET), framedata); + BuildPacket((ushort)ZToolCMD.ZB_SYSTEM_RESET, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION.cs index 534beac6..7d4d25b8 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION.cs @@ -20,7 +20,7 @@ public ZB_WRITE_CONFIGURATION(CONFIG_ID configId, byte[] nvItemValue) framedata[i + 2] = nvItemValue[i]; } - BuildPacket(((ushort)ZToolCMD.ZB_WRITE_CONFIGURATION), framedata); + BuildPacket((ushort)ZToolCMD.ZB_WRITE_CONFIGURATION, framedata); } public enum CONFIG_ID : byte diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION_RSP.cs index 485ac6c1..b340704d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/SimpleAPI/ZB_WRITE_CONFIGURATION_RSP.cs @@ -12,7 +12,7 @@ public ZB_WRITE_CONFIGURATION_RSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZB_WRITE_CONFIGURATION_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZB_WRITE_CONFIGURATION_RSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs index df29836c..20bdae02 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_GET_DEVICE_INFO_RESPONSE.cs @@ -59,7 +59,7 @@ public UTIL_GET_DEVICE_INFO_RESPONSE(byte[] framedata) AssocDevicesList[i] = ByteHelper.ShortFromBytes(framedata[14 + (i * 2)], framedata[15 + (i * 2)]); } - BuildPacket(((ushort)ZToolCMD.UTIL_GET_DEVICE_INFO_RESPONSE), framedata); + BuildPacket((ushort)ZToolCMD.UTIL_GET_DEVICE_INFO_RESPONSE, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL.cs index 806e0c58..bcaff255 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL.cs @@ -12,7 +12,7 @@ public UTIL_LED_CONTROL(byte led, bool mode) framedata[0] = led; framedata[1] = mode ? (byte)1 : (byte)0; - base.BuildPacket(((ushort)ZToolCMD.UTIL_LED_CONTROL), framedata); + base.BuildPacket((ushort)ZToolCMD.UTIL_LED_CONTROL, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL_RESPONSE.cs index 9f281609..c98c786f 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_LED_CONTROL_RESPONSE.cs @@ -12,7 +12,7 @@ public UTIL_LED_CONTROL_RESPONSE(byte[] framedata) { Status = (PacketStatus)framedata[0]; - base.BuildPacket(((ushort)ZToolCMD.UTIL_LED_CONTROL_RESPONSE), framedata); + base.BuildPacket((ushort)ZToolCMD.UTIL_LED_CONTROL_RESPONSE, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_CHANNELS_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_CHANNELS_RESPONSE.cs index 5893cb2e..322a4d7f 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_CHANNELS_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_CHANNELS_RESPONSE.cs @@ -14,7 +14,7 @@ public UTIL_SET_CHANNELS_RESPONSE(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.UTIL_SET_CHANNELS_RESPONSE), framedata); + BuildPacket((ushort)ZToolCMD.UTIL_SET_CHANNELS_RESPONSE, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs index c80da5ab..78d7b996 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID.cs @@ -28,14 +28,14 @@ public UTIL_SET_PANID(ushort num1) framedata[0] = this.PanID.GetLSB(); framedata[1] = this.PanID.GetMSB(); - BuildPacket(((ushort)ZToolCMD.UTIL_SET_PANID), framedata); + BuildPacket((ushort)ZToolCMD.UTIL_SET_PANID, framedata); } public UTIL_SET_PANID(byte[] framedata) { this.PanID = ByteHelper.ShortFromBytes(framedata[1], framedata[0]); - BuildPacket(((ushort)ZToolCMD.UTIL_SET_PANID), framedata); + BuildPacket((ushort)ZToolCMD.UTIL_SET_PANID, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID_RESPONSE.cs index cd089a71..57a61a00 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_PANID_RESPONSE.cs @@ -20,7 +20,7 @@ public UTIL_SET_PANID_RESPONSE(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.UTIL_SET_PANID_RESPONSE), framedata); + BuildPacket((ushort)ZToolCMD.UTIL_SET_PANID_RESPONSE, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL.cs index 568240a1..3c737229 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL.cs @@ -25,14 +25,14 @@ public UTIL_SET_SECURITY_LEVEL(byte num1) byte[] framedata = new byte[1]; framedata[0] = this.SecurityLevel; - BuildPacket(((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL), framedata); + BuildPacket((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL, framedata); } public UTIL_SET_SECURITY_LEVEL(byte[] framedata) { this.SecurityLevel = framedata[0]; - BuildPacket(((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL), framedata); + BuildPacket((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL_RESPONSE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL_RESPONSE.cs index 4831568d..3fdbeaaa 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL_RESPONSE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/UTIL/UTIL_SET_SECURITY_LEVEL_RESPONSE.cs @@ -23,14 +23,14 @@ public UTIL_SET_SECURITY_LEVEL_RESPONSE(byte cmd_status1) byte[] framedata = new byte[1]; framedata[0] = this.Status; - BuildPacket(((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL_RESPONSE), framedata); + BuildPacket((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL_RESPONSE, framedata); } public UTIL_SET_SECURITY_LEVEL_RESPONSE(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL_RESPONSE), framedata); + BuildPacket((ushort)ZToolCMD.UTIL_SET_SECURITY_LEVEL_RESPONSE, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ.cs index abe657a4..a5790148 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ.cs @@ -15,7 +15,7 @@ public ZDO_ACTIVE_EP_REQ(ZToolAddress16 dstAddr, ZToolAddress16 nwkAddrOfInteres framedata[2] = nwkAddrOfInterest.Lsb; framedata[3] = nwkAddrOfInterest.Msb; - BuildPacket(((ushort)ZToolCMD.ZDO_ACTIVE_EP_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_ACTIVE_EP_REQ, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ_SRSP.cs index 5ae75962..23e88653 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_REQ_SRSP.cs @@ -12,7 +12,7 @@ public ZDO_ACTIVE_EP_REQ_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_ACTIVE_EP_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_ACTIVE_EP_REQ_SRSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_RSP.cs index b6eb975d..f9b8531d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_ACTIVE_EP_RSP.cs @@ -30,7 +30,7 @@ public ZDO_ACTIVE_EP_RSP(byte[] framedata) ActiveEpList[i] = framedata[i + 6]; } - BuildPacket(((ushort)ZToolCMD.ZDO_ACTIVE_EP_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_ACTIVE_EP_RSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs index 3e836ceb..c8bfc7ae 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ.cs @@ -96,7 +96,7 @@ public ZDO_BIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, u framedata[15] = bytes[6]; } - BuildPacket(((ushort)ZToolCMD.ZDO_BIND_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_BIND_REQ, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ_SRSP.cs index d06343b4..ce5b968d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_REQ_SRSP.cs @@ -12,7 +12,7 @@ public ZDO_BIND_REQ_SRSP(byte[] data) { Status = (PacketStatus)data[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_BIND_REQ_SRSP), data); + BuildPacket((ushort)ZToolCMD.ZDO_BIND_REQ_SRSP, data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_RSP.cs index 87c2c474..e5c5e8d1 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_BIND_RSP.cs @@ -17,7 +17,7 @@ public ZDO_BIND_RSP(byte[] data) SrcAddr = new ZToolAddress16(data[1], data[0]); Status = (PacketStatus)data[2]; - BuildPacket(((ushort)ZToolCMD.ZDO_BIND_RSP), data); + BuildPacket((ushort)ZToolCMD.ZDO_BIND_RSP, data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE.cs index e9bb61c3..b46fffca 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE.cs @@ -37,7 +37,7 @@ public ZDO_END_DEVICE_ANNCE(ZToolAddress16 num1, ZToolAddress64 num2, int capabi { framedata[i + 2] = bytes[7 - i]; } - BuildPacket(((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE, framedata); } /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.CAPABILITY_INFO diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_IND.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_IND.cs index a89f582c..d8e1d4cc 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_IND.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_IND.cs @@ -45,7 +45,7 @@ public ZDO_END_DEVICE_ANNCE_IND(byte[] framedata) IEEEAddr = new ZToolAddress64(BitConverter.ToInt64(framedata, 4)); Capabilities = framedata[12]; - BuildPacket(((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE_IND), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE_IND, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_SRSP.cs index 88d3bc26..1a5ebc4e 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_ANNCE_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_END_DEVICE_ANNCE_SRSP() public ZDO_END_DEVICE_ANNCE_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_END_DEVICE_ANNCE_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_REQ_SRSP.cs index 04cf09d1..31af871d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_END_DEVICE_BIND_REQ_SRSP() public ZDO_END_DEVICE_BIND_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_END_DEVICE_BIND_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_END_DEVICE_BIND_REQ_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_RSP.cs index c64ff218..8413023f 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_END_DEVICE_BIND_RSP.cs @@ -18,7 +18,7 @@ public ZDO_END_DEVICE_BIND_RSP(byte[] framedata) { this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); this.Status = framedata[2]; - BuildPacket(((ushort)ZToolCMD.ZDO_END_DEVICE_BIND_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_END_DEVICE_BIND_RSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ.cs index 7bac524c..b3c249bd 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ.cs @@ -37,7 +37,7 @@ public ZDO_IEEE_ADDR_REQ(ZToolAddress16 shortAddress, RequestType reqType, byte data.Add((byte)ReqType); data.Add(StartIndex); - BuildPacket(((ushort)ZToolCMD.ZDO_IEEE_ADDR_REQ), data.ToArray()); + BuildPacket((ushort)ZToolCMD.ZDO_IEEE_ADDR_REQ, data.ToArray()); } public enum RequestType : byte diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ_SRSP.cs index d97dbc49..61303f94 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_REQ_SRSP.cs @@ -12,7 +12,7 @@ public ZDO_IEEE_ADDR_REQ_SRSP(byte[] data) { Status = (PacketStatus)data[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_IEEE_ADDR_REQ_SRSP), data); + BuildPacket((ushort)ZToolCMD.ZDO_IEEE_ADDR_REQ_SRSP, data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_RSP.cs index b01246a6..17112f33 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_IEEE_ADDR_RSP.cs @@ -61,7 +61,7 @@ public ZDO_IEEE_ADDR_RSP(byte[] data) this.AssocDevList[i] = new ZToolAddress16(data[14 + (i * 2)], data[13 + (i * 2)]); } - BuildPacket(((ushort)ZToolCMD.ZDO_IEEE_ADDR_RSP), data); + BuildPacket((ushort)ZToolCMD.ZDO_IEEE_ADDR_RSP, data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_REQ_SRSP.cs index 0ffe7e1d..7dd4c91a 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_REQ_SRSP.cs @@ -13,7 +13,7 @@ public class ZDO_MATCH_DESC_REQ_SRSP : ZToolPacket public ZDO_MATCH_DESC_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_MATCH_DESC_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MATCH_DESC_REQ_SRSP, framedata); } public String toString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_RSP.cs index 94ba980c..9d1e40db 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MATCH_DESC_RSP.cs @@ -41,7 +41,7 @@ public ZDO_MATCH_DESC_RSP(byte[] framedata) { this.MatchEndpointList[i] = framedata[i + 6]; } - BuildPacket(((ushort)ZToolCMD.ZDO_MATCH_DESC_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MATCH_DESC_RSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ.cs index 93bf58c8..41ef8246 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ.cs @@ -43,7 +43,7 @@ public ZDO_MGMT_LEAVE_REQ(ZToolAddress16 num1, ZToolAddress64 num2, byte flag1) framedata[2 + i] = this.DeviceAddress.Address[7 - i]; } framedata[10] = this.RemoveChildren_Rejoin; - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LEAVE_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_LEAVE_REQ, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ_SRSP.cs index 03c311b4..8a6a1e35 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_MGMT_LEAVE_REQ_SRSP() public ZDO_MGMT_LEAVE_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LEAVE_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_LEAVE_REQ_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_RSP.cs index dd6ff5ba..6f923b8b 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LEAVE_RSP.cs @@ -24,7 +24,7 @@ public ZDO_MGMT_LEAVE_RSP(byte[] framedata) { this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); this.Status = framedata[2]; - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LEAVE_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_LEAVE_RSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ.cs index acd1915d..2dab4939 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ.cs @@ -35,7 +35,7 @@ public ZDO_MGMT_LQI_REQ(ZToolAddress16 num1, byte num2) framedata[0] = this.DstAddr.Lsb; framedata[1] = this.DstAddr.Msb; framedata[2] = this.StartIndex; - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LQI_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_LQI_REQ, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ_SRSP.cs index 5ad63b69..f49131e7 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_MGMT_LQI_REQ_SRSP() public ZDO_MGMT_LQI_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LQI_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_LQI_REQ_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_RSP.cs index 7b21f513..7b4f06ae 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_LQI_RSP.cs @@ -78,7 +78,7 @@ public ZDO_MGMT_LQI_RSP(byte[] framedata) k += 22; } } - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LQI_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_LQI_RSP, framedata); } /// TI.ZPI1.ZDO_MGMT_LQI_RSP.NeighborLqiListItemClass diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ.cs index 9937d5dc..af8d1a22 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ.cs @@ -70,7 +70,7 @@ public ZDO_MGMT_NWK_UPDATE_REQ(ushort destinationAddress, byte destinationAddres framedata[9] = this.NetworkManagerAddress.GetByte(0); framedata[10] = this.NetworkManagerAddress.GetByte(1); - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.cs index be640218..0a679cba 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.cs @@ -15,7 +15,7 @@ public class ZDO_MGMT_NWK_UPDATE_REQ_SRSP : ZToolPacket public ZDO_MGMT_NWK_UPDATE_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ.cs index f2663627..2aa39736 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ.cs @@ -44,7 +44,7 @@ public ZDO_MGMT_PERMIT_JOIN_REQ(byte addrMode, ZToolAddress16 dstAddr, byte dura data.Add(Duration); data.Add(TCSignificance); - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ), data.ToArray()); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ, data.ToArray()); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.cs index a411f7e9..990ebd59 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.cs @@ -11,7 +11,7 @@ public class ZDO_MGMT_PERMIT_JOIN_REQ_SRSP : ZToolPacket public ZDO_MGMT_PERMIT_JOIN_REQ_SRSP(byte[] data) { Status = (PacketStatus)data[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ_SRSP), data); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ_SRSP, data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_RSP.cs index 7c348442..c4c87c6f 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_PERMIT_JOIN_RSP.cs @@ -20,7 +20,7 @@ public ZDO_MGMT_PERMIT_JOIN_RSP(byte[] data) SrcAddr = new ZToolAddress16(data[1], data[0]); Status = (PacketStatus)data[2]; - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_RSP), data); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_PERMIT_JOIN_RSP, data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_RTG_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_RTG_RSP.cs index e95117a8..f03b5381 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_RTG_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MGMT_RTG_RSP.cs @@ -43,7 +43,7 @@ public ZDO_MGMT_RTG_RSP() public ZDO_MGMT_RTG_RSP(byte[] framedata) { - BuildPacket(((ushort)ZToolCMD.ZDO_MGMT_LQI_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MGMT_LQI_RSP, framedata); } /// TI.ZPI1.ZDO_MGMT_LQI_RSP.NeighborLqiListItemClass diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs index c0fd819a..10ea4613 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_INCOMING.cs @@ -78,7 +78,7 @@ public ZDO_MSG_CB_INCOMING(byte[] framedata) Data = framedata.Skip(9).ToArray(); // Arrays.copyOfRange(framedata, 9, framedata.Length); - BuildPacket(((ushort)ZToolCMD.ZDO_MSG_CB_INCOMING), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MSG_CB_INCOMING, framedata); } /// diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs index f0826908..07954dc2 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER.cs @@ -13,7 +13,7 @@ public ZDO_MSG_CB_REGISTER(ushort cluster) framedata[0] = cluster.GetLSB(); framedata[1] = cluster.GetMSB(); - BuildPacket(((ushort)ZToolCMD.ZDO_MSG_CB_REGISTER), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MSG_CB_REGISTER, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER_SRSP.cs index c7fc2a75..eed339af 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_MSG_CB_REGISTER_SRSP.cs @@ -20,7 +20,7 @@ public ZDO_MSG_CB_REGISTER_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_MSG_CB_REGISTER_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_MSG_CB_REGISTER_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ.cs index 3993f294..52aaad89 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ.cs @@ -31,7 +31,7 @@ public ZDO_NODE_DESC_REQ(ZToolAddress16 dstAddr, ZToolAddress16 nwkAddrOfinteres framedata[2] = NwkAddrOfInterest.Lsb; framedata[3] = NwkAddrOfInterest.Msb; - BuildPacket(((ushort)ZToolCMD.ZDO_NODE_DESC_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_NODE_DESC_REQ, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ_SRSP.cs index 767bd292..9ed92ead 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_REQ_SRSP.cs @@ -15,7 +15,7 @@ public ZDO_NODE_DESC_REQ_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_NODE_DESC_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_NODE_DESC_REQ_SRSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs index 21e38afc..e8cbbbb2 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NODE_DESC_RSP.cs @@ -108,7 +108,7 @@ public ZDO_NODE_DESC_RSP(byte[] framedata) ServerMask = ByteHelper.ShortFromBytes(framedata[16], framedata[17]); } } - BuildPacket(((ushort)ZToolCMD.ZDO_NODE_DESC_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_NODE_DESC_RSP, framedata); } public enum CapabilitiesFlags diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_REQ_SRSP.cs index 352a73aa..fdca2764 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_NWK_ADDR_REQ_SRSP() public ZDO_NWK_ADDR_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_NWK_ADDR_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_NWK_ADDR_REQ_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_RSP.cs index 51d0ae5c..d37e9072 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_NWK_ADDR_RSP.cs @@ -57,7 +57,7 @@ public ZDO_NWK_ADDR_RSP(byte[] framedata) { this.AssocDevList[i] = new ZToolAddress16(framedata[14 + (i * 2)], framedata[13 + (i * 2)]); } - BuildPacket(((ushort)ZToolCMD.ZDO_NWK_ADDR_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_NWK_ADDR_RSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ.cs index 92af7c71..6e92c29e 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ.cs @@ -29,7 +29,7 @@ public ZDO_POWER_DESC_REQ(ushort destination) framedata[1] = destination.GetByte(1); framedata[2] = framedata[0]; framedata[3] = framedata[1]; - BuildPacket(((ushort)ZToolCMD.ZDO_POWER_DESC_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_POWER_DESC_REQ, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ_SRSP.cs index 744fcc7c..beacf969 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_POWER_DESC_REQ_SRSP() public ZDO_POWER_DESC_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_POWER_DESC_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_POWER_DESC_REQ_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_RSP.cs index b5f66357..3006ee2c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_POWER_DESC_RSP.cs @@ -51,7 +51,7 @@ public ZDO_POWER_DESC_RSP(byte[] framedata) this.CurrentSource = (framedata[6] & (0x0F)); this.CurrentLevel = (framedata[6] & (0xF0)) >> 4; } - BuildPacket(((ushort)ZToolCMD.ZDO_POWER_DESC_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_POWER_DESC_RSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ.cs index c83d79fe..923cbdb2 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ.cs @@ -17,7 +17,7 @@ public ZDO_SIMPLE_DESC_REQ(ZToolAddress16 nwkAddr, byte endPoint) framedata[3] = nwkAddr.Msb; framedata[4] = endPoint; - BuildPacket(((ushort)ZToolCMD.ZDO_SIMPLE_DESC_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_SIMPLE_DESC_REQ, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ_SRSP.cs index 3dda7ba0..131d872f 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_REQ_SRSP.cs @@ -12,7 +12,7 @@ public ZDO_SIMPLE_DESC_REQ_SRSP(byte[] framedata) { Status = (PacketStatus)framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_SIMPLE_DESC_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_SIMPLE_DESC_REQ_SRSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs index 2b7a3a18..d1a7e576 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_SIMPLE_DESC_RSP.cs @@ -104,7 +104,7 @@ public ZDO_SIMPLE_DESC_RSP(byte[] framedata) framedata[(i * 2) + ((NumInClusters) * 2) + 14]); } - BuildPacket(((ushort)ZToolCMD.ZDO_SIMPLE_DESC_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_SIMPLE_DESC_RSP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP.cs index 03e702d1..9f825028 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP.cs @@ -24,7 +24,7 @@ public ZDO_STARTUP_FROM_APP(byte start_delay) framedata[0] = (byte)(start_delay & 0xff); framedata[1] = (byte)((start_delay & 0xff) >> 8); - BuildPacket(((ushort)ZToolCMD.ZDO_STARTUP_FROM_APP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_STARTUP_FROM_APP, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP_SRSP.cs index 0be90f3d..bbffad4d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STARTUP_FROM_APP_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_STARTUP_FROM_APP_SRSP() public ZDO_STARTUP_FROM_APP_SRSP(byte[] framedata) { Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_STARTUP_FROM_APP_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_STARTUP_FROM_APP_SRSP, framedata); } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATE_CHANGE_IND.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATE_CHANGE_IND.cs index a5043f90..fd403e33 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATE_CHANGE_IND.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATE_CHANGE_IND.cs @@ -18,7 +18,7 @@ public ZDO_STATE_CHANGE_IND(byte[] data) { Status = (DeviceState)data[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_STATE_CHANGE_IND), data); + BuildPacket((ushort)ZToolCMD.ZDO_STATE_CHANGE_IND, data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATUS_ERROR_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATUS_ERROR_RSP.cs index c0b40323..1e63c19a 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATUS_ERROR_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_STATUS_ERROR_RSP.cs @@ -22,7 +22,7 @@ public ZDO_STATUS_ERROR_RSP(byte[] data) SrcAddr = new ZToolAddress16(data[1], data[0]); Status = (PacketStatus)data[2]; - BuildPacket(((ushort)ZToolCMD.ZDO_STATUS_ERROR_RSP), data); + BuildPacket((ushort)ZToolCMD.ZDO_STATUS_ERROR_RSP, data); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_TC_DEVICE_IND.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_TC_DEVICE_IND.cs index a8649a55..ec47d265 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_TC_DEVICE_IND.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_TC_DEVICE_IND.cs @@ -29,7 +29,7 @@ public ZDO_TC_DEVICE_IND(byte[] framedata) IeeeAddr = new ZToolAddress64(bytes); NwkAddr = new ZToolAddress16(framedata[11], framedata[10]); - BuildPacket(((ushort)ZToolCMD.ZDO_TC_DEVICE_IND), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_TC_DEVICE_IND, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs index befcb2f4..abb23e43 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ.cs @@ -46,7 +46,7 @@ public ZDO_UNBIND_REQ(ZToolAddress16 nwkDst, ZToolAddress64 ieeeSrc, byte epSrc, framedata[14] = bytes[7]; framedata[15] = bytes[6]; } - BuildPacket(((ushort)ZToolCMD.ZDO_UNBIND_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_UNBIND_REQ, framedata); } public ZDO_UNBIND_REQ(ushort nwkDstAdr, ushort clusterId, ulong bindSrcAdr, byte bindSrcEP, ulong bindDstAdr, @@ -75,7 +75,7 @@ public ZDO_UNBIND_REQ(ushort nwkDstAdr, ushort clusterId, ulong bindSrcAdr, byte framedata[i + 14] = bDstAddr[i]; } framedata[22] = (byte)(bindDstEP & 0xFF); // TODO REMOVE?!??! - BuildPacket(((ushort)ZToolCMD.ZDO_UNBIND_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_UNBIND_REQ, framedata); } /// TI.ZPI1.ZDO_UNBIND_REQ.ADDRESS_MODE diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ_SRSP.cs index 602bc06f..cf66eae9 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_REQ_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_UNBIND_REQ_SRSP() public ZDO_UNBIND_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_UNBIND_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_UNBIND_REQ_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_RSP.cs index dc694a8a..16f6ead4 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_UNBIND_RSP.cs @@ -24,7 +24,7 @@ public ZDO_UNBIND_RSP(byte[] framedata) { this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); this.Status = framedata[2]; - BuildPacket(((ushort)ZToolCMD.ZDO_UNBIND_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_UNBIND_RSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_CONF.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_CONF.cs index 69ed2943..a7bbcaa2 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_CONF.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_CONF.cs @@ -33,7 +33,7 @@ public ZDO_USER_DESC_CONF(byte[] framedata) { this.NwkAddr = new ZToolAddress16(); } - BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_CONF), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_USER_DESC_CONF, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ.cs index b8971384..b8e175b0 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ.cs @@ -25,7 +25,7 @@ public ZDO_USER_DESC_REQ(ZToolAddress16 num1, ZToolAddress16 num2) framedata[2] = this.NwkAddr.Lsb; framedata[3] = this.NwkAddr.Msb; - BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_REQ), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_USER_DESC_REQ, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ_SRSP.cs index 361cbedd..77c8242c 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_REQ_SRSP.cs @@ -13,7 +13,7 @@ public class ZDO_USER_DESC_REQ_SRSP : ZToolPacket public ZDO_USER_DESC_REQ_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_REQ_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_USER_DESC_REQ_SRSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_RSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_RSP.cs index 4a4b4d18..d667ac7d 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_RSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_RSP.cs @@ -51,7 +51,7 @@ public ZDO_USER_DESC_RSP(byte[] framedata) this.DescLen = 0; this.Descriptor = new byte[0]; } - BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_RSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_USER_DESC_RSP, framedata); } public override string ToString() diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET.cs index 95a8c2ba..a5aa91ad 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET.cs @@ -53,7 +53,7 @@ public ZDO_USER_DESC_SET(ZToolAddress16 num1, ZToolAddress16 num2, byte num3, by { framedata[i + 5] = this.Descriptor[i]; } - BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_SET), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_USER_DESC_SET, framedata); } } } diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET_SRSP.cs b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET_SRSP.cs index 0bb809ec..3c119566 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET_SRSP.cs +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/Packet/ZDO/ZDO_USER_DESC_SET_SRSP.cs @@ -19,7 +19,7 @@ public ZDO_USER_DESC_SET_SRSP() public ZDO_USER_DESC_SET_SRSP(byte[] framedata) { this.Status = framedata[0]; - BuildPacket(((ushort)ZToolCMD.ZDO_USER_DESC_SET_SRSP), framedata); + BuildPacket((ushort)ZToolCMD.ZDO_USER_DESC_SET_SRSP, framedata); } public override string ToString() From 0a95d5a53cf19a570676cfed81da12f90b63ce3e Mon Sep 17 00:00:00 2001 From: nicolaiw Date: Fri, 12 Feb 2021 17:04:58 +0100 Subject: [PATCH 06/10] Update README.md As the contributors are now listed by github itself we can remove this section --- README.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/README.md b/README.md index 641110af..507bfae5 100644 --- a/README.md +++ b/README.md @@ -177,22 +177,3 @@ All Company, brand and product names may be trademarks that are the sole propert Some documentation used to implement dongle drivers is copywrite to the respective holders, including Silicon Labs, Texas Instruments, Dresden Electronics, Digi International. -## Contributor - -[@Mr-Markus](https://github.com/Mr-Markus) (repository owner) - -[@nicolaiw](https://github.com/nicolaiw) - -[@andreasfedermann](https://github.com/andreasfedermann) - -[@spudwebb](https://github.com/spudwebb) - -[@Gallimathias](https://github.com/Gallimathias) - -[@thombrink](https://github.com/thombrink) - -[@TheBlubb14](https://github.com/TheBlubb14) - -[@maksim789456](https://github.com/maksim789456) - -[@DavidKarlas](https://github.com/DavidKarlas) From e1f3147ee808e69be0da03ae86d5d0efe9114c0c Mon Sep 17 00:00:00 2001 From: spud Date: Fri, 19 Feb 2021 08:44:59 -0500 Subject: [PATCH 07/10] Update ZCL cluster definitions from the com.zsmartsystems.zigbee project --- .../Resources/0000_Basic.xml | 39 +++- .../Resources/0004_Groups.xml | 12 +- .../Resources/0005_Scenes.xml | 22 +- .../Resources/0006_OnOff.xml | 19 +- .../Resources/0008_LevelControl.xml | 28 ++- .../Resources/0020_PollControl.xml | 6 +- .../Resources/0201_Thermostat.xml | 175 +++++++++++++- .../Resources/0300_ColorControl.xml | 17 +- .../Resources/0406_OccupancySensing.xml | 4 +- .../Resources/0B01_MeterIdentification.xml | 82 +++++++ .../Resources/zigbee-description.xsd | 41 ++-- .../Resources/zigbee_constants.xml | 220 ++++++++++-------- .../ZigBeeBaseClassGenerator.cs | 16 ++ .../ZigBeeBaseFieldGenerator.cs | 2 +- .../ZigBeeCodeGenerator.cs | 3 +- .../ZigBeeNet.CodeGenerator.csproj | 3 + .../ZigBeeZclClusterGenerator.cs | 14 +- .../Clusters/Basic/GenericDeviceTypeEnum.cs | 61 +++++ .../ZCL/Clusters/Groups/AddGroupResponse.cs | 6 +- .../Groups/GetGroupMembershipCommand.cs | 27 ++- .../Groups/GetGroupMembershipResponse.cs | 27 ++- .../Clusters/Groups/RemoveGroupResponse.cs | 6 +- .../ZCL/Clusters/Groups/ViewGroupResponse.cs | 6 +- ...top2Command.cs => StopWithOnOffCommand.cs} | 8 +- .../MeterIdentification/DataQualityEnum.cs | 23 ++ .../MeterIdentification/MeterTypeEnum.cs | 29 +++ .../ZCL/Clusters/OnOff/StartUpOnOffEnum.cs | 23 ++ .../PollControl/SetLongPollIntervalCommand.cs | 6 +- .../ZCL/Clusters/Scenes/AddSceneResponse.cs | 6 +- .../ZCL/Clusters/Scenes/CopySceneResponse.cs | 6 +- .../Scenes/EnhancedAddSceneResponse.cs | 6 +- .../Scenes/EnhancedViewSceneResponse.cs | 6 +- .../Scenes/GetSceneMembershipResponse.cs | 6 +- .../ZCL/Clusters/Scenes/RecallSceneCommand.cs | 16 ++ .../Scenes/RemoveAllScenesResponse.cs | 6 +- .../Clusters/Scenes/RemoveSceneResponse.cs | 6 +- .../ZCL/Clusters/Scenes/StoreSceneResponse.cs | 6 +- .../ZCL/Clusters/Scenes/ViewSceneResponse.cs | 6 +- .../Thermostat/ACCapacityFormatEnum.cs | 17 ++ .../Thermostat/ACCompressorTypeEnum.cs | 23 ++ .../Thermostat/ACLouverPositionEnum.cs | 25 ++ .../Thermostat/ACRefrigerantTypeEnum.cs | 23 ++ .../ZCL/Clusters/Thermostat/ACTypeEnum.cs | 25 ++ .../Thermostat/GetWeeklyScheduleResponse.cs | 8 +- .../Clusters/Thermostat/SetWeeklySchedule.cs | 8 +- .../Thermostat/SetpointChangeSourceEnum.cs | 21 ++ .../Clusters/Thermostat/StartOfWeekEnum.cs | 29 +++ .../Thermostat/TemperatureSetpointHoldEnum.cs | 19 ++ .../ZCL/Clusters/ZclColorControlCluster.cs | 2 +- .../ZCL/Clusters/ZclGroupsCluster.cs | 20 +- .../ZCL/Clusters/ZclLevelControlCluster.cs | 47 +++- .../Clusters/ZclMeterIdentificationCluster.cs | 140 +++++++++++ .../Clusters/ZclOccupancySensingCluster.cs | 4 +- .../ZCL/Clusters/ZclPollControlCluster.cs | 8 +- .../ZCL/Clusters/ZclScenesCluster.cs | 40 ++-- .../ZCL/Clusters/ZclThermostatCluster.cs | 58 ++++- .../ZigBeeNet/ZCL/Protocol/ZclClusterType.cs | 2 + 57 files changed, 1240 insertions(+), 274 deletions(-) create mode 100644 autocode/ZigBeeNet.CodeGenerator/Resources/0B01_MeterIdentification.xml create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/Basic/GenericDeviceTypeEnum.cs rename libraries/ZigBeeNet/ZCL/Clusters/LevelControl/{Stop2Command.cs => StopWithOnOffCommand.cs} (86%) create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/MeterIdentification/DataQualityEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/MeterIdentification/MeterTypeEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/OnOff/StartUpOnOffEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACCapacityFormatEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACCompressorTypeEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACLouverPositionEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACRefrigerantTypeEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACTypeEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/Thermostat/SetpointChangeSourceEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/Thermostat/StartOfWeekEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/Thermostat/TemperatureSetpointHoldEnum.cs create mode 100644 libraries/ZigBeeNet/ZCL/Clusters/ZclMeterIdentificationCluster.cs diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0000_Basic.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0000_Basic.xml index db86f717..c2e17b7e 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/0000_Basic.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0000_Basic.xml @@ -46,19 +46,23 @@ Power Source The PowerSource attribute is 8 bits in length and specifies the source(s) of power available to the device. Bits b0–b6 of this attribute represent the primary power source of the device and bit b7 indicates whether the device has a secondary power source in the form of a battery backup. - + Generic Device Class - + Generic Device Type - + Product Code - + Product URL @@ -93,6 +97,33 @@ The SWBuildIDattribute represents a detailed, manufacturer-specific reference to the version of the software. + + Generic Device Type + + + + + + + + + + + + + + + + + + + + + + + + + Power Source diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0004_Groups.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0004_Groups.xml index d2eb9870..9f28525b 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/0004_Groups.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0004_Groups.xml @@ -27,8 +27,9 @@ Group Count - + Group List + groupCount @@ -55,7 +56,7 @@ Add Group Response The add group response is sent by the groups cluster server in response to an add group command. - + Status @@ -65,7 +66,7 @@ View Group Response The view group response command is sent by the groups cluster server in response to a view group command. - + Status @@ -84,14 +85,15 @@ Group Count - + Group List + groupCount Remove Group Response The remove group response command is generated by an application entity in response to the receipt of a remove group command. - + Status diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0005_Scenes.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0005_Scenes.xml index efa4939e..7bf3d7e6 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/0005_Scenes.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0005_Scenes.xml @@ -68,6 +68,10 @@ Scene ID + + Transition Time + If the Transition Time field is present in the command payload and its value is not equal to 0xFFFF, this field SHALL indicate the transition time in 1/10ths of a second. In all other cases (command payload field not present or value equal to 0xFFFF), The scene transition time field of the Scene Table entry SHALL indicate the transition time. The transition time determines how long the transition takes from the old cluster state to the new cluster state. + Get Scene Membership Command @@ -127,7 +131,7 @@ Add Scene Response - + Status @@ -139,7 +143,7 @@ View Scene Response - + Status @@ -160,7 +164,7 @@ Remove Scene Response - + Status @@ -172,7 +176,7 @@ Remove All Scenes Response - + Status @@ -181,7 +185,7 @@ Store Scene Response - + Status @@ -193,7 +197,7 @@ Get Scene Membership Response - + Status @@ -211,7 +215,7 @@ Enhanced Add Scene Response - + Status @@ -223,7 +227,7 @@ Enhanced View Scene Response - + Status @@ -244,7 +248,7 @@ Copy Scene Response - + Status diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0006_OnOff.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0006_OnOff.xml index d4835c45..a8686a78 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/0006_OnOff.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0006_OnOff.xml @@ -65,9 +65,26 @@ Off Wait Time The OffWaitTime attribute specifies the length of time (in 1/10ths second) that the “off” state SHALL be guarded to prevent an on command turning the device back to its “on” state (e.g., when leaving a room, the lights are turned off but an occupancy sensor detects the leaving person and attempts to turn the lights back on). If this attribute is set to 0x0000, the device SHALL remain in its current state. - + Start Up On Off + + Status + + + + + + + + + + + + + On Off + + diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0008_LevelControl.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0008_LevelControl.xml index 30fb87fd..0241db85 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/0008_LevelControl.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0008_LevelControl.xml @@ -72,7 +72,7 @@ - Stop 2 Command + Stop (with On/Off) Command @@ -83,6 +83,26 @@ Remaining Time The RemainingTime attribute represents the time remaining until the current command is complete - it is specified in 1/10ths of a second. + + Minimum Level + The MinLevel attribute indicates the minimum value of CurrentLevel that is capable of being assigned. + + + Maximum Level + The MaxLevel attribute indicates the maximum value of CurrentLevel that is capable of being assigned. + + + Current Frequency + The CurrentFrequency attribute represents the frequency that the devices is at CurrentLevel. A CurrentFrequency of 0 is unknown. + + + Minimum Frequency + The MinFrequency attribute indicates the minimum value of CurrentFrequency that is capable of being assigned. MinFrequency shall be less than or equal to MaxFrequency. A value of 0 indicates undefined. + + + Maximum Frequency + The MaxFrequency attribute indicates the maximum value of CurrentFrequency that is capable of being assigned. MaxFrequency shall be greater than or equal to MinFrequency. A value of 0 indicates undefined. + Options @@ -113,4 +133,10 @@ + + + Current Level + Current Frequency + + diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0020_PollControl.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0020_PollControl.xml index db153ea2..011a9d86 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/0020_PollControl.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0020_PollControl.xml @@ -23,7 +23,7 @@ Set Long Poll Interval Command The Set Long Poll Interval command is used to set the Read Only LongPollInterval attribute. <br> When the Poll Control Server receives the Set Long Poll Interval Command, it SHOULD check its internal minimal limit and the attributes relationship if the new Long Poll Interval is acceptable. If the new value is acceptable, the new value SHALL be saved to the LongPollInterval attribute. If the new value is not acceptable, the Poll Control Server SHALL send a default response of INVALID_VALUE and the LongPollInterval attribute value is not updated. - + New Long Poll Interval @@ -63,8 +63,8 @@ Long Poll Interval Min The Poll Control Server MAYoptionally provide its own minimum value for the LongPollIntervalto protect against another device setting the value to too short a time resulting in an inadvertent power drain on the device. - - Fast Poll Timeout Min + + Fast Poll Timeout Max The Poll Control Server MAY optionally provide its own maximum value for the FastPollTimeout to avoid it being set to too high a value resulting in an inadvertent power drain on the device. diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0201_Thermostat.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0201_Thermostat.xml index fca47ab2..8a792e93 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/0201_Thermostat.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0201_Thermostat.xml @@ -17,10 +17,10 @@ Number Of Transitions - + Day Of Week - + Mode @@ -54,10 +54,10 @@ Number Of Transitions - + Day Of Week - + Mode @@ -131,7 +131,7 @@ Hvac System Type Configuration - + Local Temperature Calibration @@ -158,7 +158,7 @@ Max Cool Setpoint Limit - + Min Setpoint Dead Band @@ -170,12 +170,87 @@ System Mode - + Alarm Mask Thermostat Running Mode + + Start Of Week + + + Numer Of Weekly Transitions + + + Numer Of Daily Transitions + + + Temperature Setpoint Hold + + + Temperature Setpoint Hold Duration + + + Thermostat Programming Operation Mode + + + Thermostat Running State + + + Setpoint Change Source + + + Setpoint Change Amount + + + Setpoint Change Source Timestamp + + + Occupied Setback + + + Occupied Setback Min + + + Occupied Setback Max + + + Unoccupied Setback + + + Unoccupied Setback Min + + + Unoccupied Setback Max + + + Emergency Heat Delta + + + AC Type + + + AC Capacity + + + AC Refrigerant Type + + + AC Compressor Type + + + AC Error Code + + + AC Louver Position + + + AC Coil Temperature + + + AC Capacity Format + Day Of Week @@ -212,4 +287,90 @@ + + Start Of Week + + + + + + + + + + + + + + + + + Temperature Setpoint Hold + + + + + + + Setpoint Change Source + + + + + + + + + AC Type + + + + + + + + + + + + + AC Refrigerant Type + + + + + + + + + + + AC Compressor Type + + + + + + + + + + + AC Louver Position + + + + + + + + + + + + + AC Capacity Format + + + diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0300_ColorControl.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0300_ColorControl.xml index 1c2f7803..848ef8fa 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/0300_ColorControl.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0300_ColorControl.xml @@ -2,7 +2,7 @@ xsi:noNamespaceSchemaLocation="zigbee-description.xsd" code="0x0300"> Color Control This cluster provides an interface for changing the color of a light. Color is specified according to the Commission Internationale de l'Éclairage (CIE) specification CIE 1931 Color Space. Color control is carried out in terms of x,y values, as defined by this specification. - Additionally, color MAY optionally be controlled in terms of color temperature, or as hue and saturation values based on optionally variable RGB and W color points. It is recommended that the hue and saturation are interpreted according to the HSV (aka HSB) color model. + Additionally, color may optionally be controlled in terms of color temperature, or as hue and saturation values based on optionally variable RGB and W color points. It is recommended that the hue and saturation are interpreted according to the HSV (aka HSB) color model. Control over luminance is not included, as this is provided by means of the Level Control cluster of the General library. It is recommended that the level provided by this cluster be interpreted as representing a proportion of the maximum intensity achievable at the current color. Move To Hue Command @@ -291,7 +291,7 @@ Color Loop Active - The ColorLoopActive attribute specifies the current active status of the color loop. If this attribute has the value 0x00, the color loop SHALLnot be active. If this attribute has the value 0x01, the color loop SHALL be active. All other values (0x02 – 0xff) are reserved. + The ColorLoopActive attribute specifies the current active status of the color loop. If this attribute has the value 0x00, the color loop SHALL not be active. If this attribute has the value 0x01, the color loop SHALL be active. All other values (0x02 – 0xff) are reserved. Color Loop Direction @@ -361,4 +361,17 @@ + + + + Current X + Current Y + Enhanced Current Hue + Current Saturation + Color Loop Active + Color Loop Direction + Color Loop Time + Color Temperature + + diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0406_OccupancySensing.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0406_OccupancySensing.xml index 17283917..d35bfa49 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/0406_OccupancySensing.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0406_OccupancySensing.xml @@ -11,11 +11,11 @@ Occupancy Sensor Type The OccupancySensorType attribute specifies the type of the occupancy sensor. - + PIR Occupied To Unoccupied Delay The PIROccupiedToUnoccupiedDelay attribute is 8-bits in length and specifies the time delay, in seconds, before the PIR sensor changes to its occupied state when the sensed area becomes unoccupied. This attribute, along with PIRUnoccupiedToOccupiedTime, may be used to reduce sensor 'chatter' when used in an area where occupation changes frequently. - + PIR Unoccupied To Occupied Delay The PIRUnoccupiedToOccupiedDelay attribute is 8-bits in length and specifies the time delay, in seconds, before the PIR sensor changes to its unoccupied state when the sensed area becomes occupied. diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0B01_MeterIdentification.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0B01_MeterIdentification.xml new file mode 100644 index 00000000..e6d0f520 --- /dev/null +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0B01_MeterIdentification.xml @@ -0,0 +1,82 @@ + + Meter Identification + This cluster provides attributes and commands for determining advanced information about utility metering device. + + + Company Name + This attribute defines the meter manufacturer name, decided by manufacturer. + + + Meter Type ID + This attribute defines the Meter installation features, decided by manufacturer. + + + Data Quality ID + This attribute defines the Meter Simple Metering information certification type, decided by manufacturer. + + + Customer Name + + + Model + This attribute defines the meter model name, decided by manufacturer. + + + Part Number + This attribute defines the meter part number, decided by manufacturer. + + + Product Revision + This attribute defines the meter revision code, decided by manufacturer. + + + Software Revision + This attribute defines the meter software revision code, decided by manufacturer. + + + Utility Name + + + POD + This attribute is the unique identification ID of the premise connection point. It is also a contractual information known by the clients and indicated in the bill. + + + Available Power + This attribute represents the InstantaneousDemand that can be distributed to the customer (e.g., 3.3KW power) without any risk of overload. The Available Power SHALL use the same formatting conventions as the one used in the simple metering cluster formatting attribute set for the InstantaneousDemand attribute, i.e., the UnitOfMeasure and DemandFormatting. + + + Power Threshold + This attribute represents a threshold of InstantaneousDemand distributed to the customer (e.g., 4.191KW) that will lead to an imminent risk of overload. The PowerThreshold SHALL use the same formatting conventions as the one used in the AvailablePower attributes and therefore in the simple metering cluster formatting attribute set for the InstantaneousDemand attribute, i.e., the UnitOfMeasure and DemandFormatting. + + + + Meter Type + + + + + + + + + + + + + + + + + + Data Quality + + + + + + + + + + diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/zigbee-description.xsd b/autocode/ZigBeeNet.CodeGenerator/Resources/zigbee-description.xsd index 05866fc2..49574e7c 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/zigbee-description.xsd +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/zigbee-description.xsd @@ -25,6 +25,7 @@ + @@ -32,21 +33,6 @@ - - - - - - - - - - - - - - - @@ -79,12 +65,12 @@ - + - - + + @@ -111,6 +97,20 @@ + + + + + + + + + + + + + + @@ -127,8 +127,9 @@ - - + + + diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/zigbee_constants.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/zigbee_constants.xml index 02eba6a5..7c559571 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/zigbee_constants.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/zigbee_constants.xml @@ -2,104 +2,129 @@ xsi:noNamespaceSchemaLocation="zigbee-description.xsd"> ZigBee Device Type - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ZigBee Profile Type @@ -110,6 +135,7 @@ + ZigBee Stack Type diff --git a/autocode/ZigBeeNet.CodeGenerator/ZigBeeBaseClassGenerator.cs b/autocode/ZigBeeNet.CodeGenerator/ZigBeeBaseClassGenerator.cs index 9c1171f4..22cc4a54 100644 --- a/autocode/ZigBeeNet.CodeGenerator/ZigBeeBaseClassGenerator.cs +++ b/autocode/ZigBeeNet.CodeGenerator/ZigBeeBaseClassGenerator.cs @@ -487,5 +487,21 @@ protected string GetZclClusterCommandPackage(ZigBeeXmlCluster cluster) return packageRoot + packageZclProtocolCommand + "." + StringToUpperCamelCase(cluster.Name).Replace("_", ""); } } + + protected virtual ZigBeeXmlField GetAutoSized(List fields, string name) + { + foreach (ZigBeeXmlField field in fields) + { + if (field.Sizer != null) + { + //Console.WriteLine(); + } + if (name.Equals(field.Sizer)) + { + return field; + } + } + return null; + } } } \ No newline at end of file diff --git a/autocode/ZigBeeNet.CodeGenerator/ZigBeeBaseFieldGenerator.cs b/autocode/ZigBeeNet.CodeGenerator/ZigBeeBaseFieldGenerator.cs index 52c48bee..3ce4b07e 100644 --- a/autocode/ZigBeeNet.CodeGenerator/ZigBeeBaseFieldGenerator.cs +++ b/autocode/ZigBeeNet.CodeGenerator/ZigBeeBaseFieldGenerator.cs @@ -292,7 +292,7 @@ private string GetOperator(string @operator) } } - protected ZigBeeXmlField GetAutoSized(List fields, string name) + protected override ZigBeeXmlField GetAutoSized(List fields, string name) { foreach (ZigBeeXmlField field in fields) { diff --git a/autocode/ZigBeeNet.CodeGenerator/ZigBeeCodeGenerator.cs b/autocode/ZigBeeNet.CodeGenerator/ZigBeeCodeGenerator.cs index 2f9220ed..ab08d168 100644 --- a/autocode/ZigBeeNet.CodeGenerator/ZigBeeCodeGenerator.cs +++ b/autocode/ZigBeeNet.CodeGenerator/ZigBeeCodeGenerator.cs @@ -65,7 +65,8 @@ public static void Generate(string outputPath) //zclParser.AddFile("./Resources/0704_SmartEnergyTunneling.xml"); zclParser.AddFile("./Resources/0705_Prepayment.xml"); zclParser.AddFile("./Resources/0800_KeyEstablishment.xml"); - + + zclParser.AddFile("./Resources/0B01_MeterIdentification.xml"); zclParser.AddFile("./Resources/0B04_ElectricalMeasurement.xml"); zclParser.AddFile("./Resources/0B05_Diagnostics.xml"); diff --git a/autocode/ZigBeeNet.CodeGenerator/ZigBeeNet.CodeGenerator.csproj b/autocode/ZigBeeNet.CodeGenerator/ZigBeeNet.CodeGenerator.csproj index 0f373a91..35ebbdff 100644 --- a/autocode/ZigBeeNet.CodeGenerator/ZigBeeNet.CodeGenerator.csproj +++ b/autocode/ZigBeeNet.CodeGenerator/ZigBeeNet.CodeGenerator.csproj @@ -148,6 +148,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/autocode/ZigBeeNet.CodeGenerator/ZigBeeZclClusterGenerator.cs b/autocode/ZigBeeNet.CodeGenerator/ZigBeeZclClusterGenerator.cs index c9939128..8243f9c2 100644 --- a/autocode/ZigBeeNet.CodeGenerator/ZigBeeZclClusterGenerator.cs +++ b/autocode/ZigBeeNet.CodeGenerator/ZigBeeZclClusterGenerator.cs @@ -234,9 +234,13 @@ private void GenerateZclClusterClasses(ZigBeeXmlCluster cluster) } @out.WriteLine(" ///"); - LinkedList fields = new LinkedList(command.Fields); + List fields = new List(command.Fields); foreach (ZigBeeXmlField field in fields) { + if (GetAutoSized(fields, StringToLowerCamelCase(field.Name)) != null) + { + continue; + } @out.WriteLine(" /// " + field.Name + ""); } @@ -247,6 +251,10 @@ private void GenerateZclClusterClasses(ZigBeeXmlCluster cluster) bool first = true; foreach (ZigBeeXmlField field in fields) { + if (GetAutoSized(fields, StringToLowerCamelCase(field.Name)) != null) + { + continue; + } if (first == false) { @out.Write(", "); @@ -269,6 +277,10 @@ private void GenerateZclClusterClasses(ZigBeeXmlCluster cluster) foreach (ZigBeeXmlField field in fields) { + if (GetAutoSized(fields, StringToLowerCamelCase(field.Name)) != null) + { + continue; + } @out.WriteLine(" command." + StringToUpperCamelCase(field.Name) + " = " + StringToLowerCamelCase(field.Name) + ";"); } @out.WriteLine(); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Basic/GenericDeviceTypeEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/Basic/GenericDeviceTypeEnum.cs new file mode 100644 index 00000000..3fb5c52c --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/Basic/GenericDeviceTypeEnum.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.Basic +{ + /// + /// Generic Device Type value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum GenericDeviceTypeEnum + { + // Incandescent + INCANDESCENT = 0x0000, + // Spotlight Halogen + SPOTLIGHT_HALOGEN = 0x0001, + // Halogen bulb + HALOGEN_BULB = 0x0002, + // CFL + CFL = 0x0003, + // Linear Fluorescent + LINEAR_FLUORESCENT = 0x0004, + // LED bulb + LED_BULB = 0x0005, + // Spotlight LED + SPOTLIGHT_LED = 0x0006, + // LED strip + LED_STRIP = 0x0007, + // LED tube + LED_TUBE = 0x0008, + // Generic indoor luminaire + GENERIC_INDOOR_LUMINAIRE = 0x0009, + // Generic outdoor luminaire + GENERIC_OUTDOOR_LUMINAIRE = 0x000A, + // Pendant luminaire + PENDANT_LUMINAIRE = 0x000B, + // Floor standing luminaire + FLOOR_STANDING_LUMINAIRE = 0x000C, + // Generic Controller + GENERIC_CONTROLLER = 0x00E0, + // Wall Switch + WALL_SWITCH = 0x00E1, + // Portable remote controller + PORTABLE_REMOTE_CONTROLLER = 0x00E2, + // Motion sensor / light sensor + MOTION_SENSOR_LIGHT_SENSOR = 0x00E3, + // Generic actuator + GENERIC_ACTUATOR = 0x00F0, + // Wall socket + WALL_SOCKET = 0x00F1, + // Gateway/Bridge + GATEWAY_BRIDGE = 0x00F2, + // Plug-in unit + PLUG_IN_UNIT = 0x00F3, + // Retrofit actuator + RETROFIT_ACTUATOR = 0x00F4, + // Unspecified + UNSPECIFIED = 0x00FF + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Groups/AddGroupResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Groups/AddGroupResponse.cs index 05176f2e..f1aca85f 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Groups/AddGroupResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Groups/AddGroupResponse.cs @@ -36,7 +36,7 @@ public class AddGroupResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -56,13 +56,13 @@ public AddGroupResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); } diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Groups/GetGroupMembershipCommand.cs b/libraries/ZigBeeNet/ZCL/Clusters/Groups/GetGroupMembershipCommand.cs index a9a59175..ffe09777 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Groups/GetGroupMembershipCommand.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Groups/GetGroupMembershipCommand.cs @@ -33,11 +33,6 @@ public class GetGroupMembershipCommand : ZclCommand /// public const byte COMMAND_ID = 0x02; - /// - /// Group Count command message field. - /// - public byte GroupCount { get; set; } - /// /// Group List command message field. /// @@ -56,14 +51,26 @@ public GetGroupMembershipCommand() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(GroupCount, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); - serializer.Serialize(GroupList, ZclDataType.Get(DataType.N_X_UNSIGNED_16_BIT_INTEGER)); + serializer.Serialize(GroupList.Count, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); + for (int cnt = 0; cnt < GroupList.Count; cnt++) + { + serializer.Serialize(GroupList[cnt], ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); + } } internal override void Deserialize(ZclFieldDeserializer deserializer) { - GroupCount = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); - GroupList = deserializer.Deserialize>(ZclDataType.Get(DataType.N_X_UNSIGNED_16_BIT_INTEGER)); + // Create lists + GroupList = new List(); + + byte? groupCount = (byte?) deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); + if (groupCount != null) + { + for (int cnt = 0; cnt < groupCount; cnt++) + { + GroupList.Add((ushort) deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER))); + } + } } public override string ToString() @@ -72,8 +79,6 @@ public override string ToString() builder.Append("GetGroupMembershipCommand ["); builder.Append(base.ToString()); - builder.Append(", GroupCount="); - builder.Append(GroupCount); builder.Append(", GroupList="); builder.Append(GroupList == null? "" : string.Join(", ", GroupList)); builder.Append(']'); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Groups/GetGroupMembershipResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Groups/GetGroupMembershipResponse.cs index d280af8c..8b5ac4d4 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Groups/GetGroupMembershipResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Groups/GetGroupMembershipResponse.cs @@ -38,11 +38,6 @@ public class GetGroupMembershipResponse : ZclCommand /// public byte Capacity { get; set; } - /// - /// Group Count command message field. - /// - public byte GroupCount { get; set; } - /// /// Group List command message field. /// @@ -62,15 +57,27 @@ public GetGroupMembershipResponse() internal override void Serialize(ZclFieldSerializer serializer) { serializer.Serialize(Capacity, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); - serializer.Serialize(GroupCount, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); - serializer.Serialize(GroupList, ZclDataType.Get(DataType.N_X_UNSIGNED_16_BIT_INTEGER)); + serializer.Serialize(GroupList.Count, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); + for (int cnt = 0; cnt < GroupList.Count; cnt++) + { + serializer.Serialize(GroupList[cnt], ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); + } } internal override void Deserialize(ZclFieldDeserializer deserializer) { + // Create lists + GroupList = new List(); + Capacity = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); - GroupCount = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); - GroupList = deserializer.Deserialize>(ZclDataType.Get(DataType.N_X_UNSIGNED_16_BIT_INTEGER)); + byte? groupCount = (byte?) deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); + if (groupCount != null) + { + for (int cnt = 0; cnt < groupCount; cnt++) + { + GroupList.Add((ushort) deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER))); + } + } } public override string ToString() @@ -81,8 +88,6 @@ public override string ToString() builder.Append(base.ToString()); builder.Append(", Capacity="); builder.Append(Capacity); - builder.Append(", GroupCount="); - builder.Append(GroupCount); builder.Append(", GroupList="); builder.Append(GroupList == null? "" : string.Join(", ", GroupList)); builder.Append(']'); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Groups/RemoveGroupResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Groups/RemoveGroupResponse.cs index db6348df..6355fab8 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Groups/RemoveGroupResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Groups/RemoveGroupResponse.cs @@ -36,7 +36,7 @@ public class RemoveGroupResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -56,13 +56,13 @@ public RemoveGroupResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); } diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Groups/ViewGroupResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Groups/ViewGroupResponse.cs index 0edd3b02..4cdd98c8 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Groups/ViewGroupResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Groups/ViewGroupResponse.cs @@ -36,7 +36,7 @@ public class ViewGroupResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -61,14 +61,14 @@ public ViewGroupResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(GroupName, ZclDataType.Get(DataType.CHARACTER_STRING)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); GroupName = deserializer.Deserialize(ZclDataType.Get(DataType.CHARACTER_STRING)); } diff --git a/libraries/ZigBeeNet/ZCL/Clusters/LevelControl/Stop2Command.cs b/libraries/ZigBeeNet/ZCL/Clusters/LevelControl/StopWithOnOffCommand.cs similarity index 86% rename from libraries/ZigBeeNet/ZCL/Clusters/LevelControl/Stop2Command.cs rename to libraries/ZigBeeNet/ZCL/Clusters/LevelControl/StopWithOnOffCommand.cs index 724b4680..3e467a0a 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/LevelControl/Stop2Command.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/LevelControl/StopWithOnOffCommand.cs @@ -11,14 +11,14 @@ namespace ZigBeeNet.ZCL.Clusters.LevelControl { /// - /// Stop 2 Command value object class. + /// Stop (with On/Off) Command value object class. /// /// Cluster: Level Control. Command ID 0x07 is sent TO the server. /// This command is a specific command used for the Level Control cluster. /// /// Code is auto-generated. Modifications may be overwritten! /// - public class Stop2Command : ZclCommand + public class StopWithOnOffCommand : ZclCommand { /// /// The cluster ID to which this command belongs. @@ -33,7 +33,7 @@ public class Stop2Command : ZclCommand /// /// Default constructor. /// - public Stop2Command() + public StopWithOnOffCommand() { ClusterId = CLUSTER_ID; CommandId = COMMAND_ID; @@ -45,7 +45,7 @@ public override string ToString() { var builder = new StringBuilder(); - builder.Append("Stop2Command ["); + builder.Append("StopWithOnOffCommand ["); builder.Append(base.ToString()); builder.Append(']'); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/MeterIdentification/DataQualityEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/MeterIdentification/DataQualityEnum.cs new file mode 100644 index 00000000..7588bd6e --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/MeterIdentification/DataQualityEnum.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.MeterIdentification +{ + /// + /// Data Quality value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum DataQualityEnum + { + // All Data Certified + ALL_DATA_CERTIFIED = 0x0000, + // Only Instantaneous Power not Certified + ONLY_INSTANTANEOUS_POWER_NOT_CERTIFIED = 0x0001, + // Only Cumulated Consumption not Certified + ONLY_CUMULATED_CONSUMPTION_NOT_CERTIFIED = 0x0002, + // Not Certified data + NOT_CERTIFIED_DATA = 0x0003 + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/MeterIdentification/MeterTypeEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/MeterIdentification/MeterTypeEnum.cs new file mode 100644 index 00000000..beb1e12f --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/MeterIdentification/MeterTypeEnum.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.MeterIdentification +{ + /// + /// Meter Type value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum MeterTypeEnum + { + // Utility Primary Meter + UTILITY_PRIMARY_METER = 0x0000, + // Utility Production Meter + UTILITY_PRODUCTION_METER = 0x0001, + // Utility Secondary Meter + UTILITY_SECONDARY_METER = 0x0002, + // Private Primary Meter + PRIVATE_PRIMARY_METER = 0x0100, + // Private Production Meter + PRIVATE_PRODUCTION_METER = 0x0101, + // Private Secondary Meters + PRIVATE_SECONDARY_METERS = 0x0102, + // Generic Meter + GENERIC_METER = 0x0110 + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/OnOff/StartUpOnOffEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/OnOff/StartUpOnOffEnum.cs new file mode 100644 index 00000000..8fb43a31 --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/OnOff/StartUpOnOffEnum.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.OnOff +{ + /// + /// Status value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum StartUpOnOffEnum + { + // Off + OFF = 0x0000, + // On + ON = 0x0001, + // Toggle + TOGGLE = 0x0002, + // Previous + PREVIOUS = 0x00FF + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/PollControl/SetLongPollIntervalCommand.cs b/libraries/ZigBeeNet/ZCL/Clusters/PollControl/SetLongPollIntervalCommand.cs index 13e66cce..be9a91e9 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/PollControl/SetLongPollIntervalCommand.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/PollControl/SetLongPollIntervalCommand.cs @@ -41,7 +41,7 @@ public class SetLongPollIntervalCommand : ZclCommand /// /// New Long Poll Interval command message field. /// - public ushort NewLongPollInterval { get; set; } + public uint NewLongPollInterval { get; set; } /// /// Default constructor. @@ -56,12 +56,12 @@ public SetLongPollIntervalCommand() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(NewLongPollInterval, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); + serializer.Serialize(NewLongPollInterval, ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { - NewLongPollInterval = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); + NewLongPollInterval = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER)); } public override string ToString() diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/AddSceneResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/AddSceneResponse.cs index e613d933..aefb9dd7 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/AddSceneResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/AddSceneResponse.cs @@ -33,7 +33,7 @@ public class AddSceneResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -58,14 +58,14 @@ public AddSceneResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(SceneId, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); SceneId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); } diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/CopySceneResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/CopySceneResponse.cs index b5242fe8..0e23672f 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/CopySceneResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/CopySceneResponse.cs @@ -33,7 +33,7 @@ public class CopySceneResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -58,14 +58,14 @@ public CopySceneResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(SceneId, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); SceneId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); } diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/EnhancedAddSceneResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/EnhancedAddSceneResponse.cs index f97ee022..51ede054 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/EnhancedAddSceneResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/EnhancedAddSceneResponse.cs @@ -33,7 +33,7 @@ public class EnhancedAddSceneResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -58,14 +58,14 @@ public EnhancedAddSceneResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(SceneId, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); SceneId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); } diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/EnhancedViewSceneResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/EnhancedViewSceneResponse.cs index 7cbaaef3..63f84de2 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/EnhancedViewSceneResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/EnhancedViewSceneResponse.cs @@ -33,7 +33,7 @@ public class EnhancedViewSceneResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -73,7 +73,7 @@ public EnhancedViewSceneResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(SceneId, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); serializer.Serialize(TransitionTime, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); @@ -83,7 +83,7 @@ internal override void Serialize(ZclFieldSerializer serializer) internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); SceneId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); TransitionTime = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/GetSceneMembershipResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/GetSceneMembershipResponse.cs index ca881200..13ceba2b 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/GetSceneMembershipResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/GetSceneMembershipResponse.cs @@ -33,7 +33,7 @@ public class GetSceneMembershipResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Capacity command message field. @@ -68,7 +68,7 @@ public GetSceneMembershipResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(Capacity, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(SceneCount, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); @@ -77,7 +77,7 @@ internal override void Serialize(ZclFieldSerializer serializer) internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); Capacity = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); SceneCount = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RecallSceneCommand.cs b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RecallSceneCommand.cs index 1669ed6b..5cd8f36f 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RecallSceneCommand.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RecallSceneCommand.cs @@ -42,6 +42,18 @@ public class RecallSceneCommand : ZclCommand /// public byte SceneId { get; set; } + /// + /// Transition Time command message field. + /// + /// If the Transition Time field is present in the command payload and its value is not + /// equal to 0xFFFF, this field shall indicate the transition time in 1/10ths of a + /// second. In all other cases (command payload field not present or value equal to + /// 0xFFFF), The scene transition time field of the Scene Table entry shall indicate + /// the transition time. The transition time determines how long the transition takes + /// from the old cluster state to the new cluster state. + /// + public ushort TransitionTime { get; set; } + /// /// Default constructor. /// @@ -57,12 +69,14 @@ internal override void Serialize(ZclFieldSerializer serializer) { serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(SceneId, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); + serializer.Serialize(TransitionTime, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); SceneId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); + TransitionTime = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); } public override string ToString() @@ -75,6 +89,8 @@ public override string ToString() builder.Append(GroupId); builder.Append(", SceneId="); builder.Append(SceneId); + builder.Append(", TransitionTime="); + builder.Append(TransitionTime); builder.Append(']'); return builder.ToString(); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RemoveAllScenesResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RemoveAllScenesResponse.cs index 6d9d2947..b077b080 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RemoveAllScenesResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RemoveAllScenesResponse.cs @@ -33,7 +33,7 @@ public class RemoveAllScenesResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -53,13 +53,13 @@ public RemoveAllScenesResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); } diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RemoveSceneResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RemoveSceneResponse.cs index 7789a97f..f018b159 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RemoveSceneResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/RemoveSceneResponse.cs @@ -33,7 +33,7 @@ public class RemoveSceneResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -58,14 +58,14 @@ public RemoveSceneResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(SceneId, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); SceneId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); } diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/StoreSceneResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/StoreSceneResponse.cs index 1013de0a..4f98207b 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/StoreSceneResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/StoreSceneResponse.cs @@ -33,7 +33,7 @@ public class StoreSceneResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -58,14 +58,14 @@ public StoreSceneResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(SceneId, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); } internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); SceneId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); } diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/ViewSceneResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/ViewSceneResponse.cs index d0f34308..a549da75 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Scenes/ViewSceneResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Scenes/ViewSceneResponse.cs @@ -33,7 +33,7 @@ public class ViewSceneResponse : ZclCommand /// /// Status command message field. /// - public byte Status { get; set; } + public ZclStatus Status { get; set; } /// /// Group ID command message field. @@ -73,7 +73,7 @@ public ViewSceneResponse() internal override void Serialize(ZclFieldSerializer serializer) { - serializer.Serialize(Status, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(Status, ZclDataType.Get(DataType.ZCL_STATUS)); serializer.Serialize(GroupId, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(SceneId, ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); serializer.Serialize(TransitionTime, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); @@ -83,7 +83,7 @@ internal override void Serialize(ZclFieldSerializer serializer) internal override void Deserialize(ZclFieldDeserializer deserializer) { - Status = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + Status = deserializer.Deserialize(ZclDataType.Get(DataType.ZCL_STATUS)); GroupId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); SceneId = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER)); TransitionTime = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACCapacityFormatEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACCapacityFormatEnum.cs new file mode 100644 index 00000000..66337a74 --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACCapacityFormatEnum.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.Thermostat +{ + /// + /// AC Capacity Format value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum ACCapacityFormatEnum + { + // BTUh + BTUH = 0x0000 + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACCompressorTypeEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACCompressorTypeEnum.cs new file mode 100644 index 00000000..1f4205de --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACCompressorTypeEnum.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.Thermostat +{ + /// + /// AC Compressor Type value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum ACCompressorTypeEnum + { + // Reserved + RESERVED = 0x0000, + // T1 + T1 = 0x0001, + // T2 + T2 = 0x0002, + // T3 + T3 = 0x0003 + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACLouverPositionEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACLouverPositionEnum.cs new file mode 100644 index 00000000..d94983d6 --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACLouverPositionEnum.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.Thermostat +{ + /// + /// AC Louver Position value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum ACLouverPositionEnum + { + // Fully Closed + FULLY_CLOSED = 0x0001, + // Fully Open + FULLY_OPEN = 0x0002, + // Quarter Open + QUARTER_OPEN = 0x0003, + // Half Open + HALF_OPEN = 0x0004, + // Three Quarters Open + THREE_QUARTERS_OPEN = 0x0005 + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACRefrigerantTypeEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACRefrigerantTypeEnum.cs new file mode 100644 index 00000000..d4602281 --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACRefrigerantTypeEnum.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.Thermostat +{ + /// + /// AC Refrigerant Type value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum ACRefrigerantTypeEnum + { + // Reserved + RESERVED = 0x0000, + // R22 + R22 = 0x0001, + // R410a + R410A = 0x0002, + // R407c + R407C = 0x0003 + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACTypeEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACTypeEnum.cs new file mode 100644 index 00000000..9d53cd4e --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/ACTypeEnum.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.Thermostat +{ + /// + /// AC Type value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum ACTypeEnum + { + // Reserved + RESERVED = 0x0000, + // Cooling and Fixed Speed + COOLING_AND_FIXED_SPEED = 0x0001, + // Heat Pump and Fixed Speed + HEAT_PUMP_AND_FIXED_SPEED = 0x0002, + // Cooling and Inverter + COOLING_AND_INVERTER = 0x0003, + // Heat Pump and Inverter + HEAT_PUMP_AND_INVERTER = 0x0004 + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/GetWeeklyScheduleResponse.cs b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/GetWeeklyScheduleResponse.cs index b9f050fd..a3a06c19 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/GetWeeklyScheduleResponse.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/GetWeeklyScheduleResponse.cs @@ -74,8 +74,8 @@ public GetWeeklyScheduleResponse() internal override void Serialize(ZclFieldSerializer serializer) { serializer.Serialize(NumberOfTransitions, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); - serializer.Serialize(DayOfWeek, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); - serializer.Serialize(Mode, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(DayOfWeek, ZclDataType.Get(DataType.BITMAP_8_BIT)); + serializer.Serialize(Mode, ZclDataType.Get(DataType.BITMAP_8_BIT)); serializer.Serialize(Transition, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(HeatSet, ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER)); serializer.Serialize(CoolSet, ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER)); @@ -84,8 +84,8 @@ internal override void Serialize(ZclFieldSerializer serializer) internal override void Deserialize(ZclFieldDeserializer deserializer) { NumberOfTransitions = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); - DayOfWeek = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); - Mode = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + DayOfWeek = deserializer.Deserialize(ZclDataType.Get(DataType.BITMAP_8_BIT)); + Mode = deserializer.Deserialize(ZclDataType.Get(DataType.BITMAP_8_BIT)); Transition = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); HeatSet = deserializer.Deserialize(ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER)); CoolSet = deserializer.Deserialize(ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER)); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/SetWeeklySchedule.cs b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/SetWeeklySchedule.cs index f0286645..80ec87f5 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/SetWeeklySchedule.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/SetWeeklySchedule.cs @@ -84,8 +84,8 @@ public SetWeeklySchedule() internal override void Serialize(ZclFieldSerializer serializer) { serializer.Serialize(NumberOfTransitions, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); - serializer.Serialize(DayOfWeek, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); - serializer.Serialize(Mode, ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + serializer.Serialize(DayOfWeek, ZclDataType.Get(DataType.BITMAP_8_BIT)); + serializer.Serialize(Mode, ZclDataType.Get(DataType.BITMAP_8_BIT)); serializer.Serialize(Transition, ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); serializer.Serialize(HeatSet, ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER)); serializer.Serialize(CoolSet, ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER)); @@ -94,8 +94,8 @@ internal override void Serialize(ZclFieldSerializer serializer) internal override void Deserialize(ZclFieldDeserializer deserializer) { NumberOfTransitions = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); - DayOfWeek = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); - Mode = deserializer.Deserialize(ZclDataType.Get(DataType.ENUMERATION_8_BIT)); + DayOfWeek = deserializer.Deserialize(ZclDataType.Get(DataType.BITMAP_8_BIT)); + Mode = deserializer.Deserialize(ZclDataType.Get(DataType.BITMAP_8_BIT)); Transition = deserializer.Deserialize(ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER)); HeatSet = deserializer.Deserialize(ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER)); CoolSet = deserializer.Deserialize(ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER)); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/SetpointChangeSourceEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/SetpointChangeSourceEnum.cs new file mode 100644 index 00000000..9254f49a --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/SetpointChangeSourceEnum.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.Thermostat +{ + /// + /// Setpoint Change Source value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum SetpointChangeSourceEnum + { + // Manual user-initiated + MANUAL_USER_INITIATED = 0x0000, + // Schedule/internal programming-initiated + SCHEDULE_INTERNAL_PROGRAMMING_INITIATED = 0x0001, + // Externally-initiated + EXTERNALLY_INITIATED = 0x0002 + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/StartOfWeekEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/StartOfWeekEnum.cs new file mode 100644 index 00000000..d3119e7d --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/StartOfWeekEnum.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.Thermostat +{ + /// + /// Start Of Week value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum StartOfWeekEnum + { + // Sunday + SUNDAY = 0x0000, + // Monday + MONDAY = 0x0001, + // Tuesday + TUESDAY = 0x0002, + // Wednesday + WEDNESDAY = 0x0003, + // Thursday + THURSDAY = 0x0004, + // Friday + FRIDAY = 0x0005, + // Saturday + SATURDAY = 0x0006 + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/TemperatureSetpointHoldEnum.cs b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/TemperatureSetpointHoldEnum.cs new file mode 100644 index 00000000..e68c845a --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/Thermostat/TemperatureSetpointHoldEnum.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZigBeeNet.ZCL.Clusters.Thermostat +{ + /// + /// Temperature Setpoint Hold value enumeration + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public enum TemperatureSetpointHoldEnum + { + // Setpoint Hold Off + SETPOINT_HOLD_OFF = 0x0000, + // Setpoint Hold On + SETPOINT_HOLD_ON = 0x0001 + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/ZclColorControlCluster.cs b/libraries/ZigBeeNet/ZCL/Clusters/ZclColorControlCluster.cs index 32b9dc42..23f6fe48 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/ZclColorControlCluster.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/ZclColorControlCluster.cs @@ -145,7 +145,7 @@ public class ZclColorControlCluster : ZclCluster /// /// The ColorLoopActive attribute specifies the current active status of the color - /// loop. If this attribute has the value 0x00, the color loop SHALLnot be active. If + /// loop. If this attribute has the value 0x00, the color loop shall not be active. If /// this attribute has the value 0x01, the color loop shall be active. All other values /// (0x02 – 0xff) are reserved. /// diff --git a/libraries/ZigBeeNet/ZCL/Clusters/ZclGroupsCluster.cs b/libraries/ZigBeeNet/ZCL/Clusters/ZclGroupsCluster.cs index 35bcac6a..18bf75a2 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/ZclGroupsCluster.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/ZclGroupsCluster.cs @@ -162,16 +162,14 @@ public Task ViewGroupCommand(ushort groupId) /// The get group membership command allows the sending device to inquire about the /// group membership of the receiving device and endpoint in a number of ways. /// - /// Group Count /// Group List /// the command result Task /// - public Task GetGroupMembershipCommand(byte groupCount, List groupList) + public Task GetGroupMembershipCommand(List groupList) { GetGroupMembershipCommand command = new GetGroupMembershipCommand(); // Set the fields - command.GroupCount = groupCount; command.GroupList = groupList; return Send(command); @@ -238,11 +236,11 @@ public Task AddGroupIfIdentifyingCommand(ushort groupId, string g /// The add group response is sent by the groups cluster server in response to an add /// group command. /// - /// Status + /// Status /// Group ID /// the command result Task /// - public Task AddGroupResponse(byte status, ushort groupId) + public Task AddGroupResponse(ZclStatus status, ushort groupId) { AddGroupResponse command = new AddGroupResponse(); @@ -259,12 +257,12 @@ public Task AddGroupResponse(byte status, ushort groupId) /// The view group response command is sent by the groups cluster server in response to a /// view group command. /// - /// Status + /// Status /// Group ID /// Group Name /// the command result Task /// - public Task ViewGroupResponse(byte status, ushort groupId, string groupName) + public Task ViewGroupResponse(ZclStatus status, ushort groupId, string groupName) { ViewGroupResponse command = new ViewGroupResponse(); @@ -283,17 +281,15 @@ public Task ViewGroupResponse(byte status, ushort groupId, string /// response to a get group membership command. /// /// Capacity - /// Group Count /// Group List /// the command result Task /// - public Task GetGroupMembershipResponse(byte capacity, byte groupCount, List groupList) + public Task GetGroupMembershipResponse(byte capacity, List groupList) { GetGroupMembershipResponse command = new GetGroupMembershipResponse(); // Set the fields command.Capacity = capacity; - command.GroupCount = groupCount; command.GroupList = groupList; return Send(command); @@ -305,11 +301,11 @@ public Task GetGroupMembershipResponse(byte capacity, byte groupC /// The remove group response command is generated by an application entity in /// response to the receipt of a remove group command. /// - /// Status + /// Status /// Group ID /// the command result Task /// - public Task RemoveGroupResponse(byte status, ushort groupId) + public Task RemoveGroupResponse(ZclStatus status, ushort groupId) { RemoveGroupResponse command = new RemoveGroupResponse(); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/ZclLevelControlCluster.cs b/libraries/ZigBeeNet/ZCL/Clusters/ZclLevelControlCluster.cs index e7ffff4b..9353c361 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/ZclLevelControlCluster.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/ZclLevelControlCluster.cs @@ -61,6 +61,38 @@ public class ZclLevelControlCluster : ZclCluster /// public const ushort ATTR_REMAININGTIME = 0x0001; + /// + /// The MinLevel attribute indicates the minimum value of CurrentLevel that is + /// capable of being assigned. + /// + public const ushort ATTR_MINIMUMLEVEL = 0x0002; + + /// + /// The MaxLevel attribute indicates the maximum value of CurrentLevel that is + /// capable of being assigned. + /// + public const ushort ATTR_MAXIMUMLEVEL = 0x0003; + + /// + /// The CurrentFrequency attribute represents the frequency that the devices is at + /// CurrentLevel. A CurrentFrequency of 0 is unknown. + /// + public const ushort ATTR_CURRENTFREQUENCY = 0x0004; + + /// + /// The MinFrequency attribute indicates the minimum value of CurrentFrequency that + /// is capable of being assigned. MinFrequency shall be less than or equal to + /// MaxFrequency. A value of 0 indicates undefined. + /// + public const ushort ATTR_MINIMUMFREQUENCY = 0x0005; + + /// + /// The MaxFrequency attribute indicates the maximum value of CurrentFrequency that + /// is capable of being assigned. MaxFrequency shall be greater than or equal to + /// MinFrequency. A value of 0 indicates undefined. + /// + public const ushort ATTR_MAXIMUMFREQUENCY = 0x0006; + /// /// /// public const ushort ATTR_OPTIONS = 0x000F; @@ -119,10 +151,15 @@ protected override Dictionary InitializeClientAttributes() protected override Dictionary InitializeServerAttributes() { - Dictionary attributeMap = new Dictionary(9); + Dictionary attributeMap = new Dictionary(14); attributeMap.Add(ATTR_CURRENTLEVEL, new ZclAttribute(this, ATTR_CURRENTLEVEL, "Current Level", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), true, true, false, true)); attributeMap.Add(ATTR_REMAININGTIME, new ZclAttribute(this, ATTR_REMAININGTIME, "Remaining Time", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_MINIMUMLEVEL, new ZclAttribute(this, ATTR_MINIMUMLEVEL, "Minimum Level", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_MAXIMUMLEVEL, new ZclAttribute(this, ATTR_MAXIMUMLEVEL, "Maximum Level", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_CURRENTFREQUENCY, new ZclAttribute(this, ATTR_CURRENTFREQUENCY, "Current Frequency", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, true)); + attributeMap.Add(ATTR_MINIMUMFREQUENCY, new ZclAttribute(this, ATTR_MINIMUMFREQUENCY, "Minimum Frequency", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_MAXIMUMFREQUENCY, new ZclAttribute(this, ATTR_MAXIMUMFREQUENCY, "Maximum Frequency", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false)); attributeMap.Add(ATTR_OPTIONS, new ZclAttribute(this, ATTR_OPTIONS, "Options", ZclDataType.Get(DataType.BITMAP_8_BIT), false, true, false, false)); attributeMap.Add(ATTR_ONOFFTRANSITIONTIME, new ZclAttribute(this, ATTR_ONOFFTRANSITIONTIME, "On Off Transition Time", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, true, false)); attributeMap.Add(ATTR_ONLEVEL, new ZclAttribute(this, ATTR_ONLEVEL, "On Level", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false)); @@ -145,7 +182,7 @@ protected override Dictionary> InitializeClientCommands commandMap.Add(0x0004, () => new MoveToLevelWithOnOffCommand()); commandMap.Add(0x0005, () => new MoveWithOnOffCommand()); commandMap.Add(0x0006, () => new StepWithOnOffCommand()); - commandMap.Add(0x0007, () => new Stop2Command()); + commandMap.Add(0x0007, () => new StopWithOnOffCommand()); return commandMap; } @@ -310,13 +347,13 @@ public Task StepWithOnOffCommand(byte stepMode, byte stepSize, us } /// - /// The Stop 2 Command + /// The Stop (with On/Off) Command /// /// the command result Task /// - public Task Stop2Command() + public Task StopWithOnOffCommand() { - return Send(new Stop2Command()); + return Send(new StopWithOnOffCommand()); } } } diff --git a/libraries/ZigBeeNet/ZCL/Clusters/ZclMeterIdentificationCluster.cs b/libraries/ZigBeeNet/ZCL/Clusters/ZclMeterIdentificationCluster.cs new file mode 100644 index 00000000..546be97c --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/Clusters/ZclMeterIdentificationCluster.cs @@ -0,0 +1,140 @@ + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using ZigBeeNet.Security; +using ZigBeeNet.ZCL.Field; +using ZigBeeNet.ZCL.Protocol; + + +namespace ZigBeeNet.ZCL.Clusters +{ + /// + /// Meter Identification cluster implementation (Cluster ID 0x0B01). + /// + /// This cluster provides attributes and commands for determining advanced information + /// about utility metering device. + /// + /// Code is auto-generated. Modifications may be overwritten! + /// + public class ZclMeterIdentificationCluster : ZclCluster + { + /// + /// The ZigBee Cluster Library Cluster ID + /// + public const ushort CLUSTER_ID = 0x0B01; + + /// + /// The ZigBee Cluster Library Cluster Name + /// + public const string CLUSTER_NAME = "Meter Identification"; + + // Attribute constants + + /// + /// This attribute defines the meter manufacturer name, decided by manufacturer. + /// + public const ushort ATTR_COMPANYNAME = 0x0000; + + /// + /// This attribute defines the Meter installation features, decided by + /// manufacturer. + /// + public const ushort ATTR_METERTYPEID = 0x0001; + + /// + /// This attribute defines the Meter Simple Metering information certification + /// type, decided by manufacturer. + /// + public const ushort ATTR_DATAQUALITYID = 0x0004; + public const ushort ATTR_CUSTOMERNAME = 0x0005; + + /// + /// This attribute defines the meter model name, decided by manufacturer. + /// + public const ushort ATTR_MODEL = 0x0006; + + /// + /// This attribute defines the meter part number, decided by manufacturer. + /// + public const ushort ATTR_PARTNUMBER = 0x0007; + + /// + /// This attribute defines the meter revision code, decided by manufacturer. + /// + public const ushort ATTR_PRODUCTREVISION = 0x0008; + + /// + /// This attribute defines the meter software revision code, decided by + /// manufacturer. + /// + public const ushort ATTR_SOFTWAREREVISION = 0x000A; + public const ushort ATTR_UTILITYNAME = 0x000B; + + /// + /// This attribute is the unique identification ID of the premise connection point. It + /// is also a contractual information known by the clients and indicated in the bill. + /// + public const ushort ATTR_POD = 0x000C; + + /// + /// This attribute represents the InstantaneousDemand that can be distributed to the + /// customer (e.g., 3.3KW power) without any risk of overload. The Available Power + /// shall use the same formatting conventions as the one used in the simple metering + /// cluster formatting attribute set for the InstantaneousDemand attribute, i.e., + /// the UnitOfMeasure and DemandFormatting. + /// + public const ushort ATTR_AVAILABLEPOWER = 0x000D; + + /// + /// This attribute represents a threshold of InstantaneousDemand distributed to the + /// customer (e.g., 4.191KW) that will lead to an imminent risk of overload. The + /// PowerThreshold shall use the same formatting conventions as the one used in the + /// AvailablePower attributes and therefore in the simple metering cluster + /// formatting attribute set for the InstantaneousDemand attribute, i.e., the + /// UnitOfMeasure and DemandFormatting. + /// + public const ushort ATTR_POWERTHRESHOLD = 0x000E; + + protected override Dictionary InitializeClientAttributes() + { + Dictionary attributeMap = new Dictionary(0); + + return attributeMap; + } + + protected override Dictionary InitializeServerAttributes() + { + Dictionary attributeMap = new Dictionary(12); + + attributeMap.Add(ATTR_COMPANYNAME, new ZclAttribute(this, ATTR_COMPANYNAME, "Company Name", ZclDataType.Get(DataType.CHARACTER_STRING), true, true, false, false)); + attributeMap.Add(ATTR_METERTYPEID, new ZclAttribute(this, ATTR_METERTYPEID, "Meter Type ID", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false)); + attributeMap.Add(ATTR_DATAQUALITYID, new ZclAttribute(this, ATTR_DATAQUALITYID, "Data Quality ID", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false)); + attributeMap.Add(ATTR_CUSTOMERNAME, new ZclAttribute(this, ATTR_CUSTOMERNAME, "Customer Name", ZclDataType.Get(DataType.CHARACTER_STRING), false, true, true, false)); + attributeMap.Add(ATTR_MODEL, new ZclAttribute(this, ATTR_MODEL, "Model", ZclDataType.Get(DataType.CHARACTER_STRING), false, true, false, false)); + attributeMap.Add(ATTR_PARTNUMBER, new ZclAttribute(this, ATTR_PARTNUMBER, "Part Number", ZclDataType.Get(DataType.CHARACTER_STRING), false, true, false, false)); + attributeMap.Add(ATTR_PRODUCTREVISION, new ZclAttribute(this, ATTR_PRODUCTREVISION, "Product Revision", ZclDataType.Get(DataType.CHARACTER_STRING), false, true, false, false)); + attributeMap.Add(ATTR_SOFTWAREREVISION, new ZclAttribute(this, ATTR_SOFTWAREREVISION, "Software Revision", ZclDataType.Get(DataType.CHARACTER_STRING), false, true, false, false)); + attributeMap.Add(ATTR_UTILITYNAME, new ZclAttribute(this, ATTR_UTILITYNAME, "Utility Name", ZclDataType.Get(DataType.CHARACTER_STRING), false, true, false, false)); + attributeMap.Add(ATTR_POD, new ZclAttribute(this, ATTR_POD, "POD", ZclDataType.Get(DataType.CHARACTER_STRING), true, true, false, false)); + attributeMap.Add(ATTR_AVAILABLEPOWER, new ZclAttribute(this, ATTR_AVAILABLEPOWER, "Available Power", ZclDataType.Get(DataType.SIGNED_24_BIT_INTEGER), true, true, false, false)); + attributeMap.Add(ATTR_POWERTHRESHOLD, new ZclAttribute(this, ATTR_POWERTHRESHOLD, "Power Threshold", ZclDataType.Get(DataType.SIGNED_24_BIT_INTEGER), true, true, false, false)); + + return attributeMap; + } + + /// + /// Default constructor to create a Meter Identification cluster. + /// + /// the ZigBeeEndpoint this cluster is contained within + /// + public ZclMeterIdentificationCluster(ZigBeeEndpoint zigbeeEndpoint) + :base(zigbeeEndpoint, CLUSTER_ID, CLUSTER_NAME) + { + } + } +} diff --git a/libraries/ZigBeeNet/ZCL/Clusters/ZclOccupancySensingCluster.cs b/libraries/ZigBeeNet/ZCL/Clusters/ZclOccupancySensingCluster.cs index 3529a4e3..d65fce94 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/ZclOccupancySensingCluster.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/ZclOccupancySensingCluster.cs @@ -110,8 +110,8 @@ protected override Dictionary InitializeServerAttributes() attributeMap.Add(ATTR_OCCUPANCY, new ZclAttribute(this, ATTR_OCCUPANCY, "Occupancy", ZclDataType.Get(DataType.BITMAP_8_BIT), true, true, false, true)); attributeMap.Add(ATTR_OCCUPANCYSENSORTYPE, new ZclAttribute(this, ATTR_OCCUPANCYSENSORTYPE, "Occupancy Sensor Type", ZclDataType.Get(DataType.ENUMERATION_8_BIT), true, true, false, false)); - attributeMap.Add(ATTR_PIROCCUPIEDTOUNOCCUPIEDDELAY, new ZclAttribute(this, ATTR_PIROCCUPIEDTOUNOCCUPIEDDELAY, "PIR Occupied To Unoccupied Delay", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false)); - attributeMap.Add(ATTR_PIRUNOCCUPIEDTOOCCUPIEDDELAY, new ZclAttribute(this, ATTR_PIRUNOCCUPIEDTOOCCUPIEDDELAY, "PIR Unoccupied To Occupied Delay", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false)); + attributeMap.Add(ATTR_PIROCCUPIEDTOUNOCCUPIEDDELAY, new ZclAttribute(this, ATTR_PIROCCUPIEDTOUNOCCUPIEDDELAY, "PIR Occupied To Unoccupied Delay", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, true, false)); + attributeMap.Add(ATTR_PIRUNOCCUPIEDTOOCCUPIEDDELAY, new ZclAttribute(this, ATTR_PIRUNOCCUPIEDTOOCCUPIEDDELAY, "PIR Unoccupied To Occupied Delay", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, true, false)); attributeMap.Add(ATTR_PIRUNOCCUPIEDTOOCCUPIEDTHRESHOLD, new ZclAttribute(this, ATTR_PIRUNOCCUPIEDTOOCCUPIEDTHRESHOLD, "PIR Unoccupied To Occupied Threshold", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, true)); attributeMap.Add(ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY, new ZclAttribute(this, ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY, "Ultra Sonic Occupied To Unoccupied Delay", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false)); attributeMap.Add(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY, new ZclAttribute(this, ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY, "Ultra Sonic Unoccupied To Occupied Delay", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false)); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/ZclPollControlCluster.cs b/libraries/ZigBeeNet/ZCL/Clusters/ZclPollControlCluster.cs index 30de23f8..82df3338 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/ZclPollControlCluster.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/ZclPollControlCluster.cs @@ -126,7 +126,7 @@ public class ZclPollControlCluster : ZclCluster /// FastPollTimeout to avoid it being set to too high a value resulting in an /// inadvertent power drain on the device. /// - public const ushort ATTR_FASTPOLLTIMEOUTMIN = 0x0006; + public const ushort ATTR_FASTPOLLTIMEOUTMAX = 0x0006; protected override Dictionary InitializeClientAttributes() { @@ -145,7 +145,7 @@ protected override Dictionary InitializeServerAttributes() attributeMap.Add(ATTR_FASTPOLLTIMEOUT, new ZclAttribute(this, ATTR_FASTPOLLTIMEOUT, "Fast Poll Timeout", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, true)); attributeMap.Add(ATTR_CHECKININTERVALMIN, new ZclAttribute(this, ATTR_CHECKININTERVALMIN, "Checkin Interval Min", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), true, true, false, false)); attributeMap.Add(ATTR_LONGPOLLINTERVALMIN, new ZclAttribute(this, ATTR_LONGPOLLINTERVALMIN, "Long Poll Interval Min", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), true, true, false, false)); - attributeMap.Add(ATTR_FASTPOLLTIMEOUTMIN, new ZclAttribute(this, ATTR_FASTPOLLTIMEOUTMIN, "Fast Poll Timeout Min", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), true, true, false, false)); + attributeMap.Add(ATTR_FASTPOLLTIMEOUTMAX, new ZclAttribute(this, ATTR_FASTPOLLTIMEOUTMAX, "Fast Poll Timeout Max", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false)); return attributeMap; } @@ -248,10 +248,10 @@ public Task FastPollStopCommand() /// new value is not acceptable, the Poll Control Server shall send a default response /// of INVALID_VALUE and the LongPollInterval attribute value is not updated. /// - /// New Long Poll Interval + /// New Long Poll Interval /// the command result Task /// - public Task SetLongPollIntervalCommand(ushort newLongPollInterval) + public Task SetLongPollIntervalCommand(uint newLongPollInterval) { SetLongPollIntervalCommand command = new SetLongPollIntervalCommand(); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/ZclScenesCluster.cs b/libraries/ZigBeeNet/ZCL/Clusters/ZclScenesCluster.cs index 471348e2..62969ce4 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/ZclScenesCluster.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/ZclScenesCluster.cs @@ -264,15 +264,17 @@ public Task StoreSceneCommand(ushort groupId, byte sceneId) /// /// Group ID /// Scene ID + /// Transition Time /// the command result Task /// - public Task RecallSceneCommand(ushort groupId, byte sceneId) + public Task RecallSceneCommand(ushort groupId, byte sceneId, ushort transitionTime) { RecallSceneCommand command = new RecallSceneCommand(); // Set the fields command.GroupId = groupId; command.SceneId = sceneId; + command.TransitionTime = transitionTime; return Send(command); } @@ -375,12 +377,12 @@ public Task CopySceneCommand(byte mode, ushort groupIdFrom, byte /// /// The Add Scene Response /// - /// Status + /// Status /// Group ID /// Scene ID /// the command result Task /// - public Task AddSceneResponse(byte status, ushort groupId, byte sceneId) + public Task AddSceneResponse(ZclStatus status, ushort groupId, byte sceneId) { AddSceneResponse command = new AddSceneResponse(); @@ -395,7 +397,7 @@ public Task AddSceneResponse(byte status, ushort groupId, byte sc /// /// The View Scene Response /// - /// Status + /// Status /// Group ID /// Scene ID /// Transition Time @@ -403,7 +405,7 @@ public Task AddSceneResponse(byte status, ushort groupId, byte sc /// Extension Field Sets /// the command result Task /// - public Task ViewSceneResponse(byte status, ushort groupId, byte sceneId, ushort transitionTime, string sceneName, List extensionFieldSets) + public Task ViewSceneResponse(ZclStatus status, ushort groupId, byte sceneId, ushort transitionTime, string sceneName, List extensionFieldSets) { ViewSceneResponse command = new ViewSceneResponse(); @@ -421,12 +423,12 @@ public Task ViewSceneResponse(byte status, ushort groupId, byte s /// /// The Remove Scene Response /// - /// Status + /// Status /// Group ID /// Scene ID /// the command result Task /// - public Task RemoveSceneResponse(byte status, ushort groupId, byte sceneId) + public Task RemoveSceneResponse(ZclStatus status, ushort groupId, byte sceneId) { RemoveSceneResponse command = new RemoveSceneResponse(); @@ -441,11 +443,11 @@ public Task RemoveSceneResponse(byte status, ushort groupId, byte /// /// The Remove All Scenes Response /// - /// Status + /// Status /// Group ID /// the command result Task /// - public Task RemoveAllScenesResponse(byte status, ushort groupId) + public Task RemoveAllScenesResponse(ZclStatus status, ushort groupId) { RemoveAllScenesResponse command = new RemoveAllScenesResponse(); @@ -459,12 +461,12 @@ public Task RemoveAllScenesResponse(byte status, ushort groupId) /// /// The Store Scene Response /// - /// Status + /// Status /// Group ID /// Scene ID /// the command result Task /// - public Task StoreSceneResponse(byte status, ushort groupId, byte sceneId) + public Task StoreSceneResponse(ZclStatus status, ushort groupId, byte sceneId) { StoreSceneResponse command = new StoreSceneResponse(); @@ -479,14 +481,14 @@ public Task StoreSceneResponse(byte status, ushort groupId, byte /// /// The Get Scene Membership Response /// - /// Status + /// Status /// Capacity /// Group ID /// Scene Count /// Scene List /// the command result Task /// - public Task GetSceneMembershipResponse(byte status, byte capacity, ushort groupId, byte sceneCount, List sceneList) + public Task GetSceneMembershipResponse(ZclStatus status, byte capacity, ushort groupId, byte sceneCount, List sceneList) { GetSceneMembershipResponse command = new GetSceneMembershipResponse(); @@ -503,12 +505,12 @@ public Task GetSceneMembershipResponse(byte status, byte capacity /// /// The Enhanced Add Scene Response /// - /// Status + /// Status /// Group ID /// Scene ID /// the command result Task /// - public Task EnhancedAddSceneResponse(byte status, ushort groupId, byte sceneId) + public Task EnhancedAddSceneResponse(ZclStatus status, ushort groupId, byte sceneId) { EnhancedAddSceneResponse command = new EnhancedAddSceneResponse(); @@ -523,7 +525,7 @@ public Task EnhancedAddSceneResponse(byte status, ushort groupId, /// /// The Enhanced View Scene Response /// - /// Status + /// Status /// Group ID /// Scene ID /// Transition Time @@ -531,7 +533,7 @@ public Task EnhancedAddSceneResponse(byte status, ushort groupId, /// Extension Field Sets /// the command result Task /// - public Task EnhancedViewSceneResponse(byte status, ushort groupId, byte sceneId, ushort transitionTime, string sceneName, List extensionFieldSets) + public Task EnhancedViewSceneResponse(ZclStatus status, ushort groupId, byte sceneId, ushort transitionTime, string sceneName, List extensionFieldSets) { EnhancedViewSceneResponse command = new EnhancedViewSceneResponse(); @@ -549,12 +551,12 @@ public Task EnhancedViewSceneResponse(byte status, ushort groupId /// /// The Copy Scene Response /// - /// Status + /// Status /// Group ID /// Scene ID /// the command result Task /// - public Task CopySceneResponse(byte status, ushort groupId, byte sceneId) + public Task CopySceneResponse(ZclStatus status, ushort groupId, byte sceneId) { CopySceneResponse command = new CopySceneResponse(); diff --git a/libraries/ZigBeeNet/ZCL/Clusters/ZclThermostatCluster.cs b/libraries/ZigBeeNet/ZCL/Clusters/ZclThermostatCluster.cs index 868e773b..3ddcbe8e 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/ZclThermostatCluster.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/ZclThermostatCluster.cs @@ -111,6 +111,31 @@ public class ZclThermostatCluster : ZclCluster public const ushort ATTR_SYSTEMMODE = 0x001C; public const ushort ATTR_ALARMMASK = 0x001D; public const ushort ATTR_THERMOSTATRUNNINGMODE = 0x001E; + public const ushort ATTR_STARTOFWEEK = 0x0020; + public const ushort ATTR_NUMEROFWEEKLYTRANSITIONS = 0x0021; + public const ushort ATTR_NUMEROFDAILYTRANSITIONS = 0x0022; + public const ushort ATTR_TEMPERATURESETPOINTHOLD = 0x0023; + public const ushort ATTR_TEMPERATURESETPOINTHOLDDURATION = 0x0024; + public const ushort ATTR_THERMOSTATPROGRAMMINGOPERATIONMODE = 0x0025; + public const ushort ATTR_THERMOSTATRUNNINGSTATE = 0x0029; + public const ushort ATTR_SETPOINTCHANGESOURCE = 0x0030; + public const ushort ATTR_SETPOINTCHANGEAMOUNT = 0x0031; + public const ushort ATTR_SETPOINTCHANGESOURCETIMESTAMP = 0x0032; + public const ushort ATTR_OCCUPIEDSETBACK = 0x0034; + public const ushort ATTR_OCCUPIEDSETBACKMIN = 0x0035; + public const ushort ATTR_OCCUPIEDSETBACKMAX = 0x0036; + public const ushort ATTR_UNOCCUPIEDSETBACK = 0x0037; + public const ushort ATTR_UNOCCUPIEDSETBACKMIN = 0x0038; + public const ushort ATTR_UNOCCUPIEDSETBACKMAX = 0x0039; + public const ushort ATTR_EMERGENCYHEATDELTA = 0x003A; + public const ushort ATTR_ACTYPE = 0x0040; + public const ushort ATTR_ACCAPACITY = 0x0041; + public const ushort ATTR_ACREFRIGERANTTYPE = 0x0042; + public const ushort ATTR_ACCOMPRESSORTYPE = 0x0043; + public const ushort ATTR_ACERRORCODE = 0x0044; + public const ushort ATTR_ACLOUVERPOSITION = 0x0045; + public const ushort ATTR_ACCOILTEMPERATURE = 0x0046; + public const ushort ATTR_ACCAPACITYFORMAT = 0x0047; protected override Dictionary InitializeClientAttributes() { @@ -121,7 +146,7 @@ protected override Dictionary InitializeClientAttributes() protected override Dictionary InitializeServerAttributes() { - Dictionary attributeMap = new Dictionary(25); + Dictionary attributeMap = new Dictionary(50); attributeMap.Add(ATTR_LOCALTEMPERATURE, new ZclAttribute(this, ATTR_LOCALTEMPERATURE, "Local Temperature", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), true, true, false, true)); attributeMap.Add(ATTR_OUTDOORTEMPERATURE, new ZclAttribute(this, ATTR_OUTDOORTEMPERATURE, "Outdoor Temperature", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false)); @@ -133,7 +158,7 @@ protected override Dictionary InitializeServerAttributes() attributeMap.Add(ATTR_PICOOLINGDEMAND, new ZclAttribute(this, ATTR_PICOOLINGDEMAND, "Pi Cooling Demand", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, true)); attributeMap.Add(ATTR_PIHEATINGDEMAND, new ZclAttribute(this, ATTR_PIHEATINGDEMAND, "Pi Heating Demand", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, true)); attributeMap.Add(ATTR_HVACSYSTEMTYPECONFIGURATION, new ZclAttribute(this, ATTR_HVACSYSTEMTYPECONFIGURATION, "Hvac System Type Configuration", ZclDataType.Get(DataType.BITMAP_8_BIT), false, true, false, false)); - attributeMap.Add(ATTR_LOCALTEMPERATURECALIBRATION, new ZclAttribute(this, ATTR_LOCALTEMPERATURECALIBRATION, "Local Temperature Calibration", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_LOCALTEMPERATURECALIBRATION, new ZclAttribute(this, ATTR_LOCALTEMPERATURECALIBRATION, "Local Temperature Calibration", ZclDataType.Get(DataType.SIGNED_8_BIT_INTEGER), false, true, false, false)); attributeMap.Add(ATTR_OCCUPIEDCOOLINGSETPOINT, new ZclAttribute(this, ATTR_OCCUPIEDCOOLINGSETPOINT, "Occupied Cooling Setpoint", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), true, true, false, false)); attributeMap.Add(ATTR_OCCUPIEDHEATINGSETPOINT, new ZclAttribute(this, ATTR_OCCUPIEDHEATINGSETPOINT, "Occupied Heating Setpoint", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), true, true, false, false)); attributeMap.Add(ATTR_UNOCCUPIEDCOOLINGSETPOINT, new ZclAttribute(this, ATTR_UNOCCUPIEDCOOLINGSETPOINT, "Unoccupied Cooling Setpoint", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false)); @@ -142,12 +167,37 @@ protected override Dictionary InitializeServerAttributes() attributeMap.Add(ATTR_MAXHEATSETPOINTLIMIT, new ZclAttribute(this, ATTR_MAXHEATSETPOINTLIMIT, "Max Heat Setpoint Limit", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false)); attributeMap.Add(ATTR_MINCOOLSETPOINTLIMIT, new ZclAttribute(this, ATTR_MINCOOLSETPOINTLIMIT, "Min Cool Setpoint Limit", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false)); attributeMap.Add(ATTR_MAXCOOLSETPOINTLIMIT, new ZclAttribute(this, ATTR_MAXCOOLSETPOINTLIMIT, "Max Cool Setpoint Limit", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false)); - attributeMap.Add(ATTR_MINSETPOINTDEADBAND, new ZclAttribute(this, ATTR_MINSETPOINTDEADBAND, "Min Setpoint Dead Band", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_MINSETPOINTDEADBAND, new ZclAttribute(this, ATTR_MINSETPOINTDEADBAND, "Min Setpoint Dead Band", ZclDataType.Get(DataType.SIGNED_8_BIT_INTEGER), false, true, false, false)); attributeMap.Add(ATTR_REMOTESENSING, new ZclAttribute(this, ATTR_REMOTESENSING, "Remote Sensing", ZclDataType.Get(DataType.BITMAP_8_BIT), false, true, false, false)); attributeMap.Add(ATTR_CONTROLSEQUENCEOFOPERATION, new ZclAttribute(this, ATTR_CONTROLSEQUENCEOFOPERATION, "Control Sequence Of Operation", ZclDataType.Get(DataType.ENUMERATION_8_BIT), true, true, false, false)); attributeMap.Add(ATTR_SYSTEMMODE, new ZclAttribute(this, ATTR_SYSTEMMODE, "System Mode", ZclDataType.Get(DataType.ENUMERATION_8_BIT), true, true, false, false)); - attributeMap.Add(ATTR_ALARMMASK, new ZclAttribute(this, ATTR_ALARMMASK, "Alarm Mask", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, false, false)); + attributeMap.Add(ATTR_ALARMMASK, new ZclAttribute(this, ATTR_ALARMMASK, "Alarm Mask", ZclDataType.Get(DataType.BITMAP_8_BIT), false, true, false, false)); attributeMap.Add(ATTR_THERMOSTATRUNNINGMODE, new ZclAttribute(this, ATTR_THERMOSTATRUNNINGMODE, "Thermostat Running Mode", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, false, false)); + attributeMap.Add(ATTR_STARTOFWEEK, new ZclAttribute(this, ATTR_STARTOFWEEK, "Start Of Week", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, false, false)); + attributeMap.Add(ATTR_NUMEROFWEEKLYTRANSITIONS, new ZclAttribute(this, ATTR_NUMEROFWEEKLYTRANSITIONS, "Numer Of Weekly Transitions", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_NUMEROFDAILYTRANSITIONS, new ZclAttribute(this, ATTR_NUMEROFDAILYTRANSITIONS, "Numer Of Daily Transitions", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_TEMPERATURESETPOINTHOLD, new ZclAttribute(this, ATTR_TEMPERATURESETPOINTHOLD, "Temperature Setpoint Hold", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, true, false)); + attributeMap.Add(ATTR_TEMPERATURESETPOINTHOLDDURATION, new ZclAttribute(this, ATTR_TEMPERATURESETPOINTHOLDDURATION, "Temperature Setpoint Hold Duration", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, true, false)); + attributeMap.Add(ATTR_THERMOSTATPROGRAMMINGOPERATIONMODE, new ZclAttribute(this, ATTR_THERMOSTATPROGRAMMINGOPERATIONMODE, "Thermostat Programming Operation Mode", ZclDataType.Get(DataType.BITMAP_8_BIT), false, true, true, false)); + attributeMap.Add(ATTR_THERMOSTATRUNNINGSTATE, new ZclAttribute(this, ATTR_THERMOSTATRUNNINGSTATE, "Thermostat Running State", ZclDataType.Get(DataType.BITMAP_16_BIT), false, true, false, false)); + attributeMap.Add(ATTR_SETPOINTCHANGESOURCE, new ZclAttribute(this, ATTR_SETPOINTCHANGESOURCE, "Setpoint Change Source", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, false, false)); + attributeMap.Add(ATTR_SETPOINTCHANGEAMOUNT, new ZclAttribute(this, ATTR_SETPOINTCHANGEAMOUNT, "Setpoint Change Amount", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_SETPOINTCHANGESOURCETIMESTAMP, new ZclAttribute(this, ATTR_SETPOINTCHANGESOURCETIMESTAMP, "Setpoint Change Source Timestamp", ZclDataType.Get(DataType.UTCTIME), false, true, false, false)); + attributeMap.Add(ATTR_OCCUPIEDSETBACK, new ZclAttribute(this, ATTR_OCCUPIEDSETBACK, "Occupied Setback", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false)); + attributeMap.Add(ATTR_OCCUPIEDSETBACKMIN, new ZclAttribute(this, ATTR_OCCUPIEDSETBACKMIN, "Occupied Setback Min", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_OCCUPIEDSETBACKMAX, new ZclAttribute(this, ATTR_OCCUPIEDSETBACKMAX, "Occupied Setback Max", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_UNOCCUPIEDSETBACK, new ZclAttribute(this, ATTR_UNOCCUPIEDSETBACK, "Unoccupied Setback", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false)); + attributeMap.Add(ATTR_UNOCCUPIEDSETBACKMIN, new ZclAttribute(this, ATTR_UNOCCUPIEDSETBACKMIN, "Unoccupied Setback Min", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_UNOCCUPIEDSETBACKMAX, new ZclAttribute(this, ATTR_UNOCCUPIEDSETBACKMAX, "Unoccupied Setback Max", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_EMERGENCYHEATDELTA, new ZclAttribute(this, ATTR_EMERGENCYHEATDELTA, "Emergency Heat Delta", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false)); + attributeMap.Add(ATTR_ACTYPE, new ZclAttribute(this, ATTR_ACTYPE, "AC Type", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, true, false)); + attributeMap.Add(ATTR_ACCAPACITY, new ZclAttribute(this, ATTR_ACCAPACITY, "AC Capacity", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, true, false)); + attributeMap.Add(ATTR_ACREFRIGERANTTYPE, new ZclAttribute(this, ATTR_ACREFRIGERANTTYPE, "AC Refrigerant Type", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, true, false)); + attributeMap.Add(ATTR_ACCOMPRESSORTYPE, new ZclAttribute(this, ATTR_ACCOMPRESSORTYPE, "AC Compressor Type", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, true, false)); + attributeMap.Add(ATTR_ACERRORCODE, new ZclAttribute(this, ATTR_ACERRORCODE, "AC Error Code", ZclDataType.Get(DataType.BITMAP_32_BIT), false, true, true, false)); + attributeMap.Add(ATTR_ACLOUVERPOSITION, new ZclAttribute(this, ATTR_ACLOUVERPOSITION, "AC Louver Position", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, true, false)); + attributeMap.Add(ATTR_ACCOILTEMPERATURE, new ZclAttribute(this, ATTR_ACCOILTEMPERATURE, "AC Coil Temperature", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_ACCAPACITYFORMAT, new ZclAttribute(this, ATTR_ACCAPACITYFORMAT, "AC Capacity Format", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, true, false)); return attributeMap; } diff --git a/libraries/ZigBeeNet/ZCL/Protocol/ZclClusterType.cs b/libraries/ZigBeeNet/ZCL/Protocol/ZclClusterType.cs index 9f944c63..b1f20eb9 100644 --- a/libraries/ZigBeeNet/ZCL/Protocol/ZclClusterType.cs +++ b/libraries/ZigBeeNet/ZCL/Protocol/ZclClusterType.cs @@ -55,6 +55,7 @@ public enum ClusterType : ushort MESSAGING = 0x0703, PREPAYMENT = 0x0705, KEY_ESTABLISHMENT = 0x0800, + METER_IDENTIFICATION = 0x0B01, ELECTRICAL_MEASUREMENT = 0x0B04, DIAGNOSTICS = 0x0B05, } @@ -131,6 +132,7 @@ static ZclClusterType() { 0x0703, new ZclClusterType(0x0703, "Messaging", ClusterType.MESSAGING, (endpoint) => new ZclMessagingCluster(endpoint)) }, { 0x0705, new ZclClusterType(0x0705, "Prepayment", ClusterType.PREPAYMENT, (endpoint) => new ZclPrepaymentCluster(endpoint)) }, { 0x0800, new ZclClusterType(0x0800, "Key Establishment", ClusterType.KEY_ESTABLISHMENT, (endpoint) => new ZclKeyEstablishmentCluster(endpoint)) }, + { 0x0B01, new ZclClusterType(0x0B01, "Meter Identification", ClusterType.METER_IDENTIFICATION, (endpoint) => new ZclMeterIdentificationCluster(endpoint)) }, { 0x0B04, new ZclClusterType(0x0B04, "Electrical Measurement", ClusterType.ELECTRICAL_MEASUREMENT, (endpoint) => new ZclElectricalMeasurementCluster(endpoint)) }, { 0x0B05, new ZclClusterType(0x0B05, "Diagnostics", ClusterType.DIAGNOSTICS, (endpoint) => new ZclDiagnosticsCluster(endpoint)) }, }; From a25fa1546541f704b70ebc6ad2dd45f022a2320f Mon Sep 17 00:00:00 2001 From: spud Date: Fri, 19 Feb 2021 08:50:58 -0500 Subject: [PATCH 08/10] Fix Scale attribute type in ZCL Pressure Measurement cluster --- .../Resources/0403_PressureMeasurement.xml | 2 +- .../ZigBeeNet/ZCL/Clusters/ZclPressureMeasurementCluster.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/autocode/ZigBeeNet.CodeGenerator/Resources/0403_PressureMeasurement.xml b/autocode/ZigBeeNet.CodeGenerator/Resources/0403_PressureMeasurement.xml index 6ec21640..1a4c4e3a 100644 --- a/autocode/ZigBeeNet.CodeGenerator/Resources/0403_PressureMeasurement.xml +++ b/autocode/ZigBeeNet.CodeGenerator/Resources/0403_PressureMeasurement.xml @@ -40,7 +40,7 @@ Scaled Tolerance The ScaledTolerance attribute indicates the magnitude of the possible error that is associated with ScaledValue. The true value is located in the range (ScaledValue – ScaledTolerance) to (ScaledValue + ScaledTolerance). - + Scale The Scale attribute indicates the base 10 exponent used to obtain ScaledValue. diff --git a/libraries/ZigBeeNet/ZCL/Clusters/ZclPressureMeasurementCluster.cs b/libraries/ZigBeeNet/ZCL/Clusters/ZclPressureMeasurementCluster.cs index 52f92dbf..5a933db3 100644 --- a/libraries/ZigBeeNet/ZCL/Clusters/ZclPressureMeasurementCluster.cs +++ b/libraries/ZigBeeNet/ZCL/Clusters/ZclPressureMeasurementCluster.cs @@ -116,7 +116,7 @@ protected override Dictionary InitializeServerAttributes() attributeMap.Add(ATTR_MINSCALEDVALUE, new ZclAttribute(this, ATTR_MINSCALEDVALUE, "Min Scaled Value", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false)); attributeMap.Add(ATTR_MAXSCALEDVALUE, new ZclAttribute(this, ATTR_MAXSCALEDVALUE, "Max Scaled Value", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false)); attributeMap.Add(ATTR_SCALEDTOLERANCE, new ZclAttribute(this, ATTR_SCALEDTOLERANCE, "Scaled Tolerance", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, true)); - attributeMap.Add(ATTR_SCALE, new ZclAttribute(this, ATTR_SCALE, "Scale", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false)); + attributeMap.Add(ATTR_SCALE, new ZclAttribute(this, ATTR_SCALE, "Scale", ZclDataType.Get(DataType.SIGNED_8_BIT_INTEGER), false, true, false, false)); return attributeMap; } From 151ed7531b36f99304cfbddd5dd2a73d31c809fa Mon Sep 17 00:00:00 2001 From: spud Date: Fri, 19 Feb 2021 15:28:23 -0500 Subject: [PATCH 09/10] Create a custom placeholder cluster if system does not know the cluster --- libraries/ZigBeeNet/ZCL/ZclCluster.cs | 2 +- libraries/ZigBeeNet/ZCL/ZclCustomCluster.cs | 31 +++++++++++++++++++++ libraries/ZigBeeNet/ZigBeeEndpoint.cs | 18 +++++------- 3 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 libraries/ZigBeeNet/ZCL/ZclCustomCluster.cs diff --git a/libraries/ZigBeeNet/ZCL/ZclCluster.cs b/libraries/ZigBeeNet/ZCL/ZclCluster.cs index 424c3a94..f45b2c22 100644 --- a/libraries/ZigBeeNet/ZCL/ZclCluster.cs +++ b/libraries/ZigBeeNet/ZCL/ZclCluster.cs @@ -188,7 +188,7 @@ static ZclCluster() _genericCommands.Add(0x0016, () => new DiscoverAttributesExtendedResponse()); } - public ZclCluster(ZigBeeEndpoint zigbeeEndpoint, ushort clusterId, string clusterName) + protected ZclCluster(ZigBeeEndpoint zigbeeEndpoint, ushort clusterId, string clusterName) { _clientAttributes = InitializeClientAttributes(); _serverAttributes = InitializeServerAttributes(); diff --git a/libraries/ZigBeeNet/ZCL/ZclCustomCluster.cs b/libraries/ZigBeeNet/ZCL/ZclCustomCluster.cs new file mode 100644 index 00000000..72f1fdb9 --- /dev/null +++ b/libraries/ZigBeeNet/ZCL/ZclCustomCluster.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; + +namespace ZigBeeNet.ZCL +{ + /// + /// Custom cluster used as a placeholder for unknown clusters + /// + public class ZclCustomCluster : ZclCluster + { + protected override Dictionary InitializeClientAttributes() + { + return new Dictionary(0); + } + + protected override Dictionary InitializeServerAttributes() + { + return new Dictionary(0); + } + + /// + /// Default constructor to create a Basic cluster. + /// + /// the ZigBeeEndpoint this cluster is contained within + /// + public ZclCustomCluster(ZigBeeEndpoint zigbeeEndpoint, ushort clusterId) + : base(zigbeeEndpoint, clusterId, $"Custom Cluster #{clusterId}") + { + } + } +} diff --git a/libraries/ZigBeeNet/ZigBeeEndpoint.cs b/libraries/ZigBeeNet/ZigBeeEndpoint.cs index 7b7035ee..8e2ebba5 100644 --- a/libraries/ZigBeeNet/ZigBeeEndpoint.cs +++ b/libraries/ZigBeeNet/ZigBeeEndpoint.cs @@ -134,7 +134,7 @@ public void SetInputClusterIds(List inputClusterIds) { this._inputClusters.Clear(); - Log.Debug("{Endpoint}: Setting input clusters {Clusters}", GetEndpointAddress(), inputClusterIds.Select(c => ZclClusterType.GetValueById(c)?.Label)); + Log.Debug("{Endpoint}: Setting input clusters {Clusters}", GetEndpointAddress(), inputClusterIds.Select(c => ZclClusterType.GetValueById(c)?.Label ?? $"Cluster #{c}")); UpdateClusters(_inputClusters, inputClusterIds, true); } @@ -180,7 +180,7 @@ public void SetOutputClusterIds(List outputClusterIds) { this._outputClusters.Clear(); - Log.Debug("{Endpoint}: Setting output clusters {Clusters}", GetEndpointAddress(), outputClusterIds.Select(c => ZclClusterType.GetValueById(c)?.Label)); + Log.Debug("{Endpoint}: Setting output clusters {Clusters}", GetEndpointAddress(), outputClusterIds.Select(c => ZclClusterType.GetValueById(c)?.Label ?? $"Cluster #{c}")); UpdateClusters(_outputClusters, outputClusterIds, false); } @@ -216,16 +216,11 @@ public ZclCluster GetClusterClass(ushort clusterId) if (clusterType == null) { // Unsupported cluster - Log.Debug("{Endpoint}: Unsupported cluster {Cluster}", GetEndpointAddress(), clusterId); - return null; + Log.Debug("{Endpoint}: Unsupported cluster {Cluster} - using ZclCustomCluster", GetEndpointAddress(), clusterId); + return new ZclCustomCluster(this, clusterId); } // Create a cluster class - //if (clusterType.ClusterClass != null) - // return (ZclCluster)Activator.CreateInstance(clusterType.ClusterClass, this); - //else - // return null; - return clusterType.ClusterFactory(this); } @@ -261,17 +256,18 @@ private void UpdateClusters(ConcurrentDictionary clusters, List ZclCluster clusterClass = GetClusterClass(id); if (clusterClass == null) { + Log.Debug("{EndpointAddress}: Cluster {Cluster} not created", GetEndpointAddress(), id); continue; } if (isInput) { - Log.Debug("{EndpointAddress}: Setting cluster {Cluster} as server", GetEndpointAddress(), ZclClusterType.GetValueById(id)); + Log.Debug("{EndpointAddress}: Setting cluster {Cluster} as server", GetEndpointAddress(), clusterClass.GetClusterName()); clusterClass.SetServer(); } else { - Log.Debug("{EndpointAddress}: Setting cluster {Cluster} as client", GetEndpointAddress(), ZclClusterType.GetValueById(id)); + Log.Debug("{EndpointAddress}: Setting cluster {Cluster} as client", GetEndpointAddress(), clusterClass.GetClusterName()); clusterClass.SetClient(); } From 60d2fd04c10434ebd8980f902c26500f2c61595d Mon Sep 17 00:00:00 2001 From: Mr-Markus Date: Sun, 21 Feb 2021 12:11:18 +0100 Subject: [PATCH 10/10] Updated version --- .vscode/tasks.json | 14 ++++++++++++++ .../ZigBeeNet.Hardware.TI.CC2531.csproj | 2 +- libraries/ZigBeeNet/ZigBeeNet.csproj | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 528de116..7109b0a0 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -35,6 +35,20 @@ ], "problemMatcher": "$tsc" }, + { + "label": "publish_autocode_ubuntu", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/autocode/ZigBeeNet.CodeGenerator/ZigBeeNet.CodeGenerator.csproj", + "--self-contained", + "true", + "-r", + "ubuntu.20.04-x64" + ], + "problemMatcher": "$tsc" + }, { "label": "watch", "command": "dotnet", diff --git a/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeNet.Hardware.TI.CC2531.csproj b/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeNet.Hardware.TI.CC2531.csproj index a1d2dcc8..15945412 100644 --- a/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeNet.Hardware.TI.CC2531.csproj +++ b/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeNet.Hardware.TI.CC2531.csproj @@ -3,7 +3,7 @@ netstandard2.0 true - 1.2.2 + 1.2.3 ZigBeeNet Contributors ZigBeeNet EPL-1.0 diff --git a/libraries/ZigBeeNet/ZigBeeNet.csproj b/libraries/ZigBeeNet/ZigBeeNet.csproj index c3e1a24e..038410af 100644 --- a/libraries/ZigBeeNet/ZigBeeNet.csproj +++ b/libraries/ZigBeeNet/ZigBeeNet.csproj @@ -9,7 +9,7 @@ git EPL-1.0 ZigBeeNet Contributors - 1.3.3 + 1.4.0 ZigBeeNet With ZigBeeNet you can develop your own .NET application which communicates with zigbee devices.