public ZpiObject(CommandSubsystem commandSubsystem, byte cmdId) { CommandSubsystem = commandSubsystem; CommandId = cmdId; ZpiObject zpi = ZpiMeta.GetCommand(commandSubsystem, cmdId); if (zpi != null) { this.Type = zpi.Type; this.Name = zpi.Name; this.RequestArguments = zpi.RequestArguments; } }
public ZpiSREQ(CommandSubsystem subSystem, byte cmdId) { CommandSubsystem = subSystem; CommandId = cmdId; ZpiObject zpi = ZpiMeta.GetCommand(subSystem, cmdId); if (zpi != null) { this.Type = zpi.Type; this.Name = zpi.Name; this.RequestArguments = zpi.RequestArguments; if (zpi is ZpiSREQ) { this.ResponseArguments = ((ZpiSREQ)zpi).ResponseArguments; } } }
public void Response(ZpiObject zpiObject) { OnResponse?.Invoke(this, zpiObject); }
public void Parsed(ZpiObject zpiObject) { OnParsed?.Invoke(this, zpiObject); }
public static T ToSpecificObject<T>(this ZpiObject zpiObject) where T : ZpiObject { return (T)Activator.CreateInstance(typeof(T), zpiObject); }
public ZpiSREQ(ZpiObject zpiObject) : this(zpiObject.CommandSubsystem, zpiObject.CommandId) { Type = zpiObject.Type; RequestArguments = zpiObject.RequestArguments; }