LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-21-2006, 07:41 AM   #1
fUNkYbOOStER
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
Question Analyse of logs of a serial device (yacc/bison/flex..)


Hi all

I would like to interpret data streams (logs) comming from a serial device (in my case).

The device is sending informations like following:

[..]
Temperatures: 12 12 13 15 19 30 30 30
Digital Inputs: 0 1 1 1 0 1 0 0 0 1
Temperature Sensor 3 missing
Temperatures: 12 12 13 15 19 30 30 30
Digital Inputs: 0 1 1 1 0 1 0 0 0 1
Temperatures: 12 12 13 15 19 31 30 30
Temperature Sensor 4 reached limit
Turning off heater 4
Digital Inputs: 0 1 1 1 0 1 0 1 0 1
[..]

Some of the messages appears periodicalliy (all x msec) and others appear only in case of an event.

My first idea was to write a C application writing the data stream into a buffer, splits into lines, searches for key words like 'Temperatures:' and takes the values (each value is the temperature of a sensor, 8 sensors here in) and put them into a variable for displaying them on a GUI.
Sometimes lines are incomplete because of limitations of the device attached to the searial port, e.g. 'Temperatures: 12 12 13 1'. This messages I don't want to interpret, because only 3 temperatures are shown.

Of course I could write such a program but I think I'm not the first and not the last one writing such an application. Someone did it before. So searched for libraries/tools doing the interpreter job.

I found (f)lex, yacc or bison. It might be that these tools are helpful to solve my problem efficent. What do you think? How would you do that? Which do you prefer?

Thanks in advance,

fb
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Do flex and bison support C++? ankit4u1 Programming 7 08-08-2011 04:56 PM
installing bison and flex rameshsena Linux - Software 10 06-21-2010 11:33 AM
Yacc/Bison question russinoff Programming 1 06-17-2006 01:54 PM
bison / flex zaman Programming 1 08-16-2005 10:19 AM
yacc, Bison Config Linux - General 6 02-21-2002 02:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration