public static async void checkTemp(XBeeController controller, NodeData node, PictureBox pic, int index, int status, int tempmax) { var address = node.getAddress(index); LongAddress x = new LongAddress(Convert.ToUInt32(address.Substring(0, 8), 16), Convert.ToUInt32(address.Substring(8, 8), 16)); NodeAddress a = new NodeAddress(x); //NodeAddress x = new NodeAddress(serialNumber1); var remoteNode = await controller.GetRemoteAsync(a); var serialNumber2 = await remoteNode.GetTemperature(); /*if (!checkOver9(serialNumber2.ToString())) * {*/ if (Convert.ToInt32(serialNumber2.ToString(), 16) >= tempmax) { node.statusUpdate(index, status); } /*} * else * { * node.statusUpdate(index, 3); * }*/ pic.Invalidate(); //MessageBox.Show(x.ToString()); }
public void RoundtripLong() { var address = new LongAddress(0x1000000000000000UL); Assert.AreEqual(0x1000000000000000UL, address.Value); Assert.AreEqual(0U, address.Low); Assert.AreEqual(0x10000000U, address.High); }
public void RoundtripShort() { var address = new LongAddress(1); Assert.AreEqual(1UL, address.Value); Assert.AreEqual(1U, address.Low); Assert.AreEqual(0U, address.High); }
public override async Task <NodeAddress> GetAddressAsync() { var high = await ExecuteAtQueryAsync <PrimitiveResponseData <uint> >(new DestinationAddressHighCommand()); var low = await ExecuteAtQueryAsync <PrimitiveResponseData <uint> >(new DestinationAddressLowCommand()); var address = new LongAddress(high.Value, low.Value); return(new NodeAddress(address)); }
public void ShouldFailIfIndexIsHigherFourOrLessZero() { byte manufacturerIdentificationCode = 0xDE; byte manufacturerDeviceTypeCode = 0x17; byte[] deviceIdentificationNumber = new byte[] { 0x00, 0x00, 0x01 }; LongAddress address = new LongAddress(manufacturerIdentificationCode, manufacturerDeviceTypeCode, deviceIdentificationNumber); Assert.Throws <IndexOutOfRangeException>(() => Console.WriteLine(address[5])); Assert.Throws <IndexOutOfRangeException>(() => Console.WriteLine(address[-1])); }
public void Usage() { HartCommunicationLite communication = new HartCommunicationLite("COM1"); Assert.That(communication.Address, Is.Null); LongAddress newAddress = new LongAddress(22, 22, new byte[] { 11, 22, 33 }); communication.SwitchAddressTo(newAddress); Assert.That(communication.Address.ToByteArray(), Is.EqualTo(newAddress.ToByteArray())); }
public void Usage() { byte manufacturerIdentificationCode = 0xDE; byte manufacturerDeviceTypeCode = 0x17; byte[] deviceIdentificationNumber = new byte[] { 0x00, 0x00, 0x01 }; byte[] address = new LongAddress(manufacturerIdentificationCode, manufacturerDeviceTypeCode, deviceIdentificationNumber).ToByteArray(); Assert.That(address[0], Is.EqualTo(0x9E)); Assert.That(address[1], Is.EqualTo(0x17)); Assert.That(address[2], Is.EqualTo(0x00)); Assert.That(address[3], Is.EqualTo(0x00)); Assert.That(address[4], Is.EqualTo(0x01)); }
public TxRequestFrame(LongAddress destination, byte[] data) { Destination = destination; Data = data; }
/// <summary> /// Not supported on XBee Cellular. /// </summary> public override Task SetDestinationAddressAsync(LongAddress address) { throw new NotSupportedException(NotSupportedMessage); }
public override int GetHashCode() { return(LongAddress != null?LongAddress.GetHashCode() : 0); }
public NodeAddress(LongAddress longAddress) : this(longAddress, ShortAddress.Disabled) { }
public NodeAddress(LongAddress longAddress, ShortAddress shortAddress) { LongAddress = longAddress; ShortAddress = shortAddress; }
public TxRequestExtFrame(LongAddress destination, ShortAddress shortDestination, byte[] data) { Destination = destination; ShortDestination = shortDestination; Data = data; }
protected bool Equals(LongAddress other) { return base.Equals(other) && string.Equals(StreetAddress2, other.StreetAddress2) && string.Equals(County, other.County) && string.Equals(Country, other.Country); }
protected bool Equals(LongAddress other) { return(base.Equals(other) && string.Equals(StreetAddress2, other.StreetAddress2) && string.Equals(County, other.County) && string.Equals(Country, other.Country)); }