Ejemplo n.º 1
0
        public async Task <bool> Open()
        {
            _stream = new SerialStream(_port);

            if (_stream.Open())
            {
                _stream.TelegramReceived += TelegramReceivedEventHandler;

                var readIdBase = await SendTelegram(new CommonCommandPacket(CommonCommands.CO_RD_IDBASE));

                if (readIdBase != null)
                {
                    _idBase = readIdBase.Data.Slice(1, 4);
                }


                return(true);
            }

            return(false);
        }