/// <summary> /// Deserialise the contents of the EZSP structure. </summary> public void Deserialize(EzspDeserializer deserializer) { _bitmask = deserializer.DeserializeEmberKeyStructBitmask(); _type = deserializer.DeserializeEmberKeyType(); _key = deserializer.DeserializeEmberKeyData(); _outgoingFrameCounter = deserializer.DeserializeUInt32(); _incomingFrameCounter = deserializer.DeserializeUInt32(); _sequenceNumber = deserializer.DeserializeUInt8(); _partnerEUI64 = deserializer.DeserializeEmberEui64(); }
/** * Gets a Security Key based on the passed key type. * * @param keyType the {@link EmberKeyType} of the key to get * @return the {@link EmberKeyStruct} or null on error */ public EmberKeyStruct GetKey(EmberKeyType keyType) { EzspGetKeyRequest request = new EzspGetKeyRequest(); request.SetKeyType(keyType); IEzspTransaction transaction = _protocolHandler.SendEzspTransaction(new EzspSingleResponseTransaction(request, typeof(EzspGetKeyResponse))); EzspGetKeyResponse response = (EzspGetKeyResponse)transaction.GetResponse(); Log.Debug(response.ToString()); _lastStatus = response.GetStatus(); if (_lastStatus != EmberStatus.EMBER_SUCCESS) { return(null); } return(response.GetKeyStruct()); }
public void SerializeEmberKeyType(EmberKeyType keyType) { _buffer[_length++] = (int)keyType; }
/// <summary> /// The keyType to set as <see cref="EmberKeyType"/> </summary> public void SetKeyType(EmberKeyType keyType) { _keyType = keyType; }
/// <summary> /// The type to set as <see cref="EmberKeyType"/> </summary> public void SetType(EmberKeyType type) { _type = type; }