Write() public method

public Write ( BinaryState state, bool commit = true ) : void
state BinaryState
commit bool
return void
        public RemoteSocketController WithRemoteSocket(int id, LPD433MHzCodeSequencePair codeSequencePair)
        {
            if (codeSequencePair == null)
            {
                throw new ArgumentNullException(nameof(codeSequencePair));
            }

            lock (_syncRoot)
            {
                var port = new RemoteSocketOutputPort(id, codeSequencePair, _sender);
                port.Write(BinaryState.Low);

                _ports.Add(id, port);
            }

            return(this);
        }
        public RemoteSocketOutputPort RegisterRemoteSocket(int id, LPD433MHzCodeSequencePair codeSequencePair)
        {
            if (codeSequencePair == null) throw new ArgumentNullException(nameof(codeSequencePair));

            if (Sender == null)
            {
                throw new InvalidOperationException("No sender is set for remote sockets. Registration not possible.");
            }

            lock (_syncRoot)
            {
                var port = new RemoteSocketOutputPort(codeSequencePair, Sender);
                port.Write(BinaryState.Low);

                _ports.Add(id, port);

                return port;
            }
        }
示例#3
0
        public RemoteSocketOutputPort RegisterRemoteSocket(int id, LPD433MHzCodeSequencePair codeSequencePair)
        {
            if (codeSequencePair == null)
            {
                throw new ArgumentNullException(nameof(codeSequencePair));
            }

            if (Sender == null)
            {
                throw new InvalidOperationException("No sender is set for remote sockets. Registration not possible.");
            }

            lock (_syncRoot)
            {
                var port = new RemoteSocketOutputPort(codeSequencePair, Sender);
                port.Write(BinaryState.Low);

                _ports.Add(id, port);

                return(port);
            }
        }