[prev in list] [next in list] [prev in thread] [next in thread]
List: ruby-talk
Subject: Reading information on a serial-port
From: Jérémy Seban <jeremy () seban ! eu>
Date: 2017-02-14 9:48:02
Message-ID: CA+AtXfJ8fTYUJn5y41fC6BJKmj1r2qfZET-J-VTCrJgK4pRZcA () mail ! gmail ! com
[Download RAW message or body]
Hello,
I'm currently working on a script that reads the content on a serial
port. I need to read using the following logic :
- I start to read
- I read and skip every char until a \u0002 is available
- I read everything and store until a \u0003 is here
I have implemented it in ruby this way : http://pastebin.com/2ihMeXeE
Is the way I'm doing it a good one ? I have this feeling I can do it
in a better way (not with the is_reading bool that sounds clearly a
bad way to do it).
Thank you !
Jérémy
Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic