XBee and XBee-PRO ZigBee RF modules provide cost-effective wireless connectivity to electronic devices. They are interoperable with other ZigBee PRO feature set devices, including devices from other vendors.

Dependencies:   BufferedArray

Dependents:   MBEDminiproject

Revision:
0:837e6c48e90d
Child:
6:5f31ddc17239
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Device/ExplicitAddress.cpp	Thu Oct 22 12:28:26 2015 +0000
@@ -0,0 +1,68 @@
+#include "ExplicitAddress.h"
+
+ExplicitAddress::ExplicitAddress()
+{ }
+
+ExplicitAddress::ExplicitAddress (const char * address, const char * explicitAddress )
+    : Address(address)
+{
+    memcpy(explicitValue, explicitAddress, 6);
+}
+
+ExplicitAddress::ExplicitAddress(long SerialNumberHigh, long SerialNumberLow, int NetworkAddress, int SourceEndpoint, int DestinationEndpoint, int ClusterID, int ProfileID)
+    : Address(SerialNumberHigh, SerialNumberLow, NetworkAddress)
+{
+    explicitValue[0] = SourceEndpoint;
+    explicitValue[1] = DestinationEndpoint;
+    explicitValue[2] = ClusterID >> 8;
+    explicitValue[3] = ClusterID;
+    explicitValue[4] = ProfileID >> 8;
+    explicitValue[5] = ProfileID;
+}
+
+char * ExplicitAddress::getExplicitValue()
+{
+    return explicitValue;
+}
+
+int ExplicitAddress::getSourceEndpoint()
+{
+    return explicitValue[0];
+}
+
+void ExplicitAddress::setSourceEndpoint(int SourceEndpoint)
+{
+    explicitValue[0] = SourceEndpoint;
+}
+
+int ExplicitAddress::getDestinationEndpoint()
+{
+    return explicitValue[1];
+}
+
+void ExplicitAddress::setDestinationEndpoint(int DestinationEndpoint)
+{
+    explicitValue[1] = DestinationEndpoint;
+}
+
+int ExplicitAddress::getClusterID()
+{
+    return (explicitValue[2] << 8) | explicitValue[3];
+}
+
+void ExplicitAddress::setClusterID(int ClusterID)
+{
+    explicitValue[2] = ClusterID >> 8;
+    explicitValue[3] = ClusterID;
+}
+
+int ExplicitAddress::getProfileID()
+{
+    return (explicitValue[4] << 8) | explicitValue[5];
+}
+
+void ExplicitAddress::setProfileID(int ProfileID)
+{
+    explicitValue[4] = ProfileID >> 8;
+    explicitValue[5] = ProfileID;
+}
\ No newline at end of file