private void OnLinkCommandReceived(string command) { this.Reply(ByteFlag.PACKET_ACKNOWLEDGE); var cryptoHandled = this.CryptographyHandler.Handle(command); if (cryptoHandled != null) { this.Reply(Checksum.Encapsulate(cryptoHandled.ToString()).ToArray()); return; } this.CommandReceived?.Invoke(this.CryptographyHandler.Undo(command)); }
private void OnOutputLinkCommandReceived(string command) { this.device.Input(new byte[] { ByteFlag.PACKET_ACKNOWLEDGE }); this.Output?.Invoke(Checksum.Encapsulate(this.CryptographyHandler.Undo(command)).ToArray()); }
public void Reply(string response) { this.Reply(Checksum.Encapsulate(this.CryptographyHandler.Redo(response)).ToArray()); }