/// <summary> /// Used to determine if encryption is enabled on this node. /// </summary> /// <returns>True if encryption is enabled</returns> public async Task <bool> IsEncryptionEnabledAsync() { PrimitiveResponseData <bool> response = await ExecuteAtQueryAsync <PrimitiveResponseData <bool> >(new EncryptionEnableCommand()); return(response.Value); }
/// <summary> /// Gets the configured sleep mode for this node. /// </summary> /// <returns>The sleep mode</returns> public virtual async Task <SleepMode> GetSleepModeAsync() { PrimitiveResponseData <SleepMode> response = await ExecuteAtQueryAsync <PrimitiveResponseData <SleepMode> >(new SleepModeCommand()); return(response.Value); }
/// <summary> /// Get the operating channel used between nodes. /// </summary> /// <returns></returns> public virtual async Task <byte> GetChannelAsync() { PrimitiveResponseData <byte> response = await ExecuteAtQueryAsync <PrimitiveResponseData <byte> >(new OperatingChannelCommand()); return(response.Value); }
/// <summary> /// Gets the network association state for this node. /// </summary> public async Task <AssociationIndicator> GetAssociationAsync() { PrimitiveResponseData <AssociationIndicator> response = await Controller.ExecuteAtQueryAsync <PrimitiveResponseData <AssociationIndicator> >( new AssociationIndicationCommand()); return(response.Value); }
/// <summary> /// Gets the static serial number of this node. /// </summary> /// <returns>The serial number</returns> public async Task <LongAddress> GetSerialNumberAsync() { PrimitiveResponseData <uint> highAddress = await ExecuteAtQueryAsync <PrimitiveResponseData <UInt32> >(new SerialNumberHighCommand()); PrimitiveResponseData <uint> lowAddress = await ExecuteAtQueryAsync <PrimitiveResponseData <UInt32> >(new SerialNumberLowCommand()); return(new LongAddress(highAddress.Value, lowAddress.Value)); }
/// <summary> /// Queries the long network address for this node. /// </summary> /// <returns>The long network address</returns> public virtual async Task <NodeAddress> GetDestinationAddressAsync() { PrimitiveResponseData <uint> high = await ExecuteAtQueryAsync <PrimitiveResponseData <uint> >(new DestinationAddressHighCommand()); PrimitiveResponseData <uint> low = await ExecuteAtQueryAsync <PrimitiveResponseData <uint> >(new DestinationAddressLowCommand()); var address = new LongAddress(high.Value, low.Value); PrimitiveResponseData <ShortAddress> source = await ExecuteAtQueryAsync <PrimitiveResponseData <ShortAddress> >(new SourceAddressCommand()); return(new NodeAddress(address, source.Value)); }
/// <summary> /// Queries the long network address for this node. /// </summary> /// <returns>The long network address</returns> public virtual async Task <NodeAddress> GetAddressAsync() { PrimitiveResponseData <uint> high = await ExecuteAtQueryAsync <PrimitiveResponseData <uint> >(new DestinationAddressHighCommand()); PrimitiveResponseData <uint> low = await ExecuteAtQueryAsync <PrimitiveResponseData <uint> >(new DestinationAddressLowCommand()); var address = new LongAddress(high.Value, low.Value); // we have to do this nonsense because they decided to reuse "MY" for the cellular IP source address PrimitiveResponseData <byte[]> source = await ExecuteAtQueryAsync <PrimitiveResponseData <byte[]> >(new SourceAddressCommand()); var leValue = source.Value.Reverse().ToArray(); var sourceAddressValue = BitConverter.ToUInt16(leValue, 0); var sourceAddress = new ShortAddress(sourceAddressValue); return(new NodeAddress(address, sourceAddress)); }