/// <summary> /// The Zone Enroll Request Command /// /// The Zone Enroll Request command is generated when a device embodying the Zone /// server cluster wishes to be enrolled as an active alarm device. It must do this /// immediately it has joined the network (during commissioning). /// /// <param name="zoneType" <see cref="ushort"> Zone Type</ param > /// <param name="manufacturerCode" <see cref="ushort"> Manufacturer Code</ param > /// <returns> the command result Task </returns> /// </summary> public Task <CommandResult> ZoneEnrollRequestCommand(ushort zoneType, ushort manufacturerCode) { ZoneEnrollRequestCommand command = new ZoneEnrollRequestCommand(); // Set the fields command.ZoneType = zoneType; command.ManufacturerCode = manufacturerCode; return(Send(command)); }
/// <summary> /// Handle the received <see cref="ZoneEnrollRequestCommand"/> and send the <see cref="ZoneEnrollResponse"/>. /// This will register the zone number specified in the constructor <see cref="ZigBeeIasCieExtension"/>. /// </summary> /// <param name="command">the received <see cref="ZoneEnrollRequestCommand"/></param> /// <returns></returns> private bool HandleZoneEnrollRequestCommand(ZoneEnrollRequestCommand command) { if (_autoEnrollmentCancellationToken != null) { _autoEnrollmentCancellationToken.Cancel(); } ZoneType = command.ZoneType; _iasZoneCluster.ZoneEnrollResponse((byte)IasEnrollResponseCodeEnum.SUCCESS, ZoneId); return(true); }