]> vcs.slashdirt.org Git - sw/tic2json.git/log

vcs.slashdirt.org Git - sw/tic2json.git/log

git git / sw / tic2json.git / log
? search:
summary | shortlog | log | commit | commitdiff | tree
first ⋅ prev ⋅ next
sw/tic2json.git
4 years agotic2json_main(): add `yyin` argument
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月28日 13:49:21 +0000 (15:49 +0200)]
tic2json_main(): add `yyin` argument

Allows specifying the input FILE for the parsers.

4 years agotic2json: introduce PRINT2BUF
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月26日 15:13:06 +0000 (17:13 +0200)]
tic2json: introduce PRINT2BUF

This commit implements a wrapper around print routines that will output
JSON to a buffer provided to tic2json_main(). If the `cb` parameter is
not NULL, this callback will be called before the content of the buffer
are overwritten, after each frame that would normally be printed by the
program.

4 years agos/printf/ticprintf/ and define ticprintf -> printf
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月26日 14:41:44 +0000 (16:41 +0200)]
s/printf/ticprintf/ and define ticprintf -> printf

4 years agoUpdate README/ChangeLog, mark version 2.1 v2.1
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月15日 19:44:39 +0000 (21:44 +0200)]
Update README/ChangeLog, mark version 2.1

4 years agoImprove code documentation
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月15日 19:40:36 +0000 (21:40 +0200)]
Improve code documentation

4 years agotic2json_main(): print error message to stderr
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月15日 19:38:53 +0000 (21:38 +0200)]
tic2json_main(): print error message to stderr

4 years agoMake etiq_en an array of bool
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月15日 19:38:16 +0000 (21:38 +0200)]
Make etiq_en an array of bool

4 years agotic2json: implement '-V' to show version
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月15日 19:36:37 +0000 (21:36 +0200)]
tic2json: implement '-V' to show version

4 years agoembedded: add ARM Mbed stub
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月14日 19:59:02 +0000 (21:59 +0200)]
embedded: add ARM Mbed stub

4 years agolexers: %option nounistd
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月15日 16:39:55 +0000 (18:39 +0200)]
lexers: %option nounistd

We don't need it, it's not always available on embedded platforms

4 years agotic2json: unistd.h is not needed for BAREBUILD
commit | commitdiff | tree
Thibaut VARÈNE [2021年9月14日 11:27:47 +0000 (13:27 +0200)]
tic2json: unistd.h is not needed for BAREBUILD

4 years agoAdd missing semicolon in parsers' start rule
commit | commitdiff | tree
Thibaut VARÈNE [Thu, 9 Sep 2021 08:42:06 +0000 (10:42 +0200)]
Add missing semicolon in parsers' start rule

Purely for the sake of consistency, the generated code is unchanged.

4 years agoREADME: add note about embedded stubs
commit | commitdiff | tree
Thibaut VARÈNE [Mon, 6 Sep 2021 21:36:40 +0000 (23:36 +0200)]
README: add note about embedded stubs

4 years agoembedded/ESP: fix component CMakeLists
commit | commitdiff | tree
Thibaut VARÈNE [Tue, 7 Sep 2021 10:11:37 +0000 (12:11 +0200)]
embedded/ESP: fix component CMakeLists

4 years agoAdd build recipes for Raspberry Pi Pico SDK
commit | commitdiff | tree
Thibaut VARÈNE [Mon, 6 Sep 2021 21:31:57 +0000 (23:31 +0200)]
Add build recipes for Raspberry Pi Pico SDK

This commit adds recipes for a quick implementation of tic2json on
Raspberry Pi Pico SDK.

The included main() stub sets up a serial conversion with raw TIC on
input (RX) and JSON on output (TX).

The build recipe is hackish, but it get things done.

4 years agoREADME: add snapshot, explicit GPLv2-only
commit | commitdiff | tree
Thibaut VARÈNE [Mon, 6 Sep 2021 15:57:15 +0000 (17:57 +0200)]
README: add snapshot, explicit GPLv2-only

4 years agoBAREBUILD: s/ticmain/tic2json_main/
commit | commitdiff | tree
Thibaut VARÈNE [Sun, 5 Sep 2021 22:52:58 +0000 (00:52 +0200)]
BAREBUILD: s/ticmain/tic2json_main/

4 years agoAdd build recipes for ESP8266/ESP32 FreeRTOS IDF
commit | commitdiff | tree
Thibaut VARÈNE [Sun, 5 Sep 2021 18:57:08 +0000 (20:57 +0200)]
Add build recipes for ESP8266/ESP32 FreeRTOS IDF

This commit adds recipes for a quick implementation of tic2json on
Espressif FreeRTOS IDF SDK. It builds identically for ESP8266 and ESP32
(tested only on ESP8266).

The included main_app() stub sets up a serial conversion with raw TIC
on input (RX) and JSON on output (TX).

The build recipe is hackish, but it get things done.

4 years agoMakefile: add 'csources' target
commit | commitdiff | tree
Thibaut VARÈNE [Sun, 5 Sep 2021 16:08:11 +0000 (18:08 +0200)]
Makefile: add 'csources' target

Enables an easy way to generate C sources from .l/.y files

4 years agoREADME: switch to markdown
commit | commitdiff | tree
Thibaut VARÈNE [Sun, 5 Sep 2021 15:05:00 +0000 (17:05 +0200)]
README: switch to markdown

4 years agoadd LICENSE.md
commit | commitdiff | tree
Thibaut VARÈNE [Sun, 5 Sep 2021 15:02:27 +0000 (17:02 +0200)]
add LICENSE.md

4 years agoSimplify building BAREBUILD
commit | commitdiff | tree
Thibaut VARÈNE [Thu, 2 Sep 2021 09:58:50 +0000 (11:58 +0200)]
Simplify building BAREBUILD

This simplifies building for a barebone MCU: a separate 'ticmain()' is
provided instead of main(), all unnecessary bits are disabled and only
one TIC version is supported at a time.

4 years agodon't report errors in lexers by default v2.0
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月26日 10:16:09 +0000 (12:16 +0200)]
don't report errors in lexers by default

The parser will take care of that anyway. This reduces chatter during
initial sync.
Errors will still be reported in debug mode.

4 years agoticv02.l: separate etiquettes from data processing
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月25日 21:08:21 +0000 (23:08 +0200)]
ticv02.l: separate etiquettes from data processing

Following the previous commit and to avoid a similar issue in standard
mode, apply the same recipe:

Use an exclusive start condition to process data.
Logic: when we encounter the first SEP in INITIAL condition, everything
that comes after is DATA and not etiquette until we start a new dataset.
Only change states at delimiters and use condition catchalls for them to
ensure resync in case of data errors.
This makes initial frame sync a little more error-verbose.

4 years agoticv01.l: separate etiquettes from data processing
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月25日 20:45:48 +0000 (22:45 +0200)]
ticv01.l: separate etiquettes from data processing

Rationale: data can contain etiquettes patterns, for instance:

{ "label": "OPTARIF", "data": "BASE"}
{ "label": "BASE", "data": 13205849}

Use an exclusive start condition to process data.
Logic: when we encounter the first SEP in INITIAL condition, everything
that comes after is DATA and not etiquette until we start a new dataset.
Only change states at delimiters and use condition catchalls for them to
ensure resync in case of data errors.
This makes initial frame sync a little more error-verbose.

4 years agotic2json: correct spelling for mandatory options
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月22日 10:41:56 +0000 (12:41 +0200)]
tic2json: correct spelling for mandatory options

4 years agoticv01 lexer: fix desc typo
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月22日 10:07:46 +0000 (12:07 +0200)]
ticv01 lexer: fix desc typo

4 years agotic2json: remove useless variable
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月22日 09:57:35 +0000 (11:57 +0200)]
tic2json: remove useless variable

4 years agoBump version, update ChangeLog
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 14:28:12 +0000 (16:28 +0200)]
Bump version, update ChangeLog

4 years agoupdate README
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 14:56:38 +0000 (16:56 +0200)]
update README

4 years agoparser TICv01: specify which meters are supported
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 15:20:37 +0000 (17:20 +0200)]
parser TICv01: specify which meters are supported

4 years agoTICv01: support des étiquettes propres au concentrateur téléreport
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 15:09:40 +0000 (17:09 +0200)]
TICv01: support des étiquettes propres au concentrateur téléreport

4 years agodoc
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 14:17:39 +0000 (16:17 +0200)]
doc

4 years agoprint_field(): const arg
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 14:13:53 +0000 (16:13 +0200)]
print_field(): const arg

4 years agoparser v02: move etiquette error to recursive rule
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 14:05:08 +0000 (16:05 +0200)]
parser v02: move etiquette error to recursive rule

matches v01

4 years agoFurther split out parser from output producer
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 13:53:05 +0000 (15:53 +0200)]
Further split out parser from output producer

4 years agorename tic2json.h -> tic.h
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 13:41:02 +0000 (15:41 +0200)]
rename tic2json.h -> tic.h

4 years agominor cleanup no code change
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 13:32:14 +0000 (15:32 +0200)]
minor cleanup no code change

4 years agomake filter_mode a bool
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 13:31:37 +0000 (15:31 +0200)]
make filter_mode a bool

4 years agohook both versions
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 13:20:48 +0000 (15:20 +0200)]
hook both versions

4 years agoMakefile: prepare to support multiple versions
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 11:55:16 +0000 (13:55 +0200)]
Makefile: prepare to support multiple versions

4 years agoparser v02: disambiguate parse_config
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 11:54:52 +0000 (13:54 +0200)]
parser v02: disambiguate parse_config

4 years agoAdd lexer/parser for v01
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 11:53:42 +0000 (13:53 +0200)]
Add lexer/parser for v01

4 years agoticv02: add prefixes to lexer/parser
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 10:07:08 +0000 (12:07 +0200)]
ticv02: add prefixes to lexer/parser

4 years agorename tic2json.y to ticv02.y
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 09:49:09 +0000 (11:49 +0200)]
rename tic2json.y to ticv02.y

4 years agocarve out output formatting from the parser
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月20日 22:25:44 +0000 (00:25 +0200)]
carve out output formatting from the parser

4 years agorename tic2json.l to ticv02.l
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月20日 21:41:46 +0000 (23:41 +0200)]
rename tic2json.l to ticv02.l

4 years agoUpdate ChangeLog v1.1
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月19日 12:14:52 +0000 (14:14 +0200)]
Update ChangeLog

4 years agobump version number
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月21日 13:32:33 +0000 (15:32 +0200)]
bump version number

4 years agoparser: add option to decode STGE
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月18日 21:32:09 +0000 (23:32 +0200)]
parser: add option to decode STGE

4 years agoparser: static local functions
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月19日 10:18:46 +0000 (12:18 +0200)]
parser: static local functions

4 years agoparser: report frame status in dictionary mode
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月19日 10:11:31 +0000 (12:11 +0200)]
parser: report frame status in dictionary mode

4 years agoadd ChangeLog v1.0
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月16日 11:18:18 +0000 (13:18 +0200)]
add ChangeLog

4 years agoclarify filter file format
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月16日 10:57:09 +0000 (12:57 +0200)]
clarify filter file format

4 years agoparser: implement idtag
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月16日 10:32:10 +0000 (12:32 +0200)]
parser: implement idtag

useful to tag data from different meters

4 years agoIntroduce version number, simplify usage() prototype
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 22:25:11 +0000 (00:25 +0200)]
Introduce version number, simplify usage() prototype

4 years agoparser: cleanup frame handling
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月16日 10:13:50 +0000 (12:13 +0200)]
parser: cleanup frame handling

4 years agominor reformat
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 21:58:10 +0000 (23:58 +0200)]
minor reformat

4 years agoadd README
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 18:10:10 +0000 (20:10 +0200)]
add README

4 years agointroduce pr_err() and BAREBUILD
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 16:20:25 +0000 (18:20 +0200)]
introduce pr_err() and BAREBUILD

4 years agorename and improve makefile
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 16:06:49 +0000 (18:06 +0200)]
rename and improve makefile

4 years agoparser: hooked logic is unnecessary
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 15:40:02 +0000 (17:40 +0200)]
parser: hooked logic is unnecessary

The grammar is properly written :)

4 years agoparser: one less global variable
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 15:18:28 +0000 (17:18 +0200)]
parser: one less global variable

4 years agoparser: reduce unnecessary calls
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 15:12:25 +0000 (17:12 +0200)]
parser: reduce unnecessary calls

4 years agoparser: simplify grammar
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 14:11:08 +0000 (16:11 +0200)]
parser: simplify grammar

4 years agofirst pass at improving memory footprint
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 11:18:28 +0000 (13:18 +0200)]
first pass at improving memory footprint

down to 24KB and 8KB heap

4 years agoparser: help: French audience
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 11:03:54 +0000 (13:03 +0200)]
parser: help: French audience

4 years agoparser: implement long date
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 10:45:33 +0000 (12:45 +0200)]
parser: implement long date

4 years agoparser: implement optional output as dictionary
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 10:15:25 +0000 (12:15 +0200)]
parser: implement optional output as dictionary

4 years agoparser: only print description when requested
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月15日 10:02:15 +0000 (12:02 +0200)]
parser: only print description when requested

4 years agoadd basic Makefile
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 21:00:21 +0000 (23:00 +0200)]
add basic Makefile

4 years agoimplement filtering via simple config file
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 20:42:11 +0000 (22:42 +0200)]
implement filtering via simple config file

4 years agolexer: remove commented out v1 etiquettes
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 18:07:05 +0000 (20:07 +0200)]
lexer: remove commented out v1 etiquettes

4 years agolexer: switch to 7bit
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 18:04:59 +0000 (20:04 +0200)]
lexer: switch to 7bit

4 years agoparser: formatting cleanup, no code change
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 15:38:55 +0000 (17:38 +0200)]
parser: formatting cleanup, no code change

4 years agoparser: implement frame skipping
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 15:32:47 +0000 (17:32 +0200)]
parser: implement frame skipping

4 years agoparser: add usage() and option to add \n after fields
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 14:43:11 +0000 (16:43 +0200)]
parser: add usage() and option to add \n after fields

4 years agoparser: implement label unpacking
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 14:19:32 +0000 (16:19 +0200)]
parser: implement label unpacking

This exposes the full description as well as label unit as per specification,
at the cost of slightly increased stack usage

4 years agoparser: prepare implementing label unpacking
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 13:58:21 +0000 (15:58 +0200)]
parser: prepare implementing label unpacking

No output change for now.
This comes at zero cost over the previous implementation, save for binary size increase.

4 years agoFurther reduce memory pressure by using const char for labels
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 13:19:55 +0000 (15:19 +0200)]
Further reduce memory pressure by using const char for labels

This essentially halves the number of allocations by only using them for
dynamic data (namely horodate and data).

Valgrind output on 100KB test:
- Before:
see previous commit
- After:
thread 1 finished and used 21967 bytes out of 8388608 on its stack. Margin: 8366641 bytes.
total heap usage: 4,961 allocs, 4,961 frees, 83,025 bytes allocated

4 years agoparser: don't malloc()
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 13:05:00 +0000 (15:05 +0200)]
parser: don't malloc()

At the cost of a slight stack usage increase, this drastically reduces
overall memory usage and improves performance since we don't incur the
malloc() penalty.

Sample figures from a single run over a 100KB test capture:
- Before:
thread 1 finished and used 17151 bytes out of 8388608 on its stack. Margin: 8371457 bytes.
total heap usage: 13,996 allocs, 13,996 frees, 255,865 bytes allocated
- After:
thread 1 finished and used 21967 bytes out of 8388608 on its stack. Margin: 8366641 bytes.
total heap usage: 9,516 allocs, 9,516 frees, 112,505 bytes allocated

4 years agoparser: output frames as individual root elements
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 10:22:48 +0000 (12:22 +0200)]
parser: output frames as individual root elements

4 years agoparser: simplify error recovery
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月14日 10:13:25 +0000 (12:13 +0200)]
parser: simplify error recovery

4 years agoparser: implement masking zero-values
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月13日 20:59:00 +0000 (22:59 +0200)]
parser: implement masking zero-values

4 years agoparser: parse hex values (STGE)
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月13日 20:51:28 +0000 (22:51 +0200)]
parser: parse hex values (STGE)

4 years agoparser: process int values as ints
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月13日 20:43:43 +0000 (22:43 +0200)]
parser: process int values as ints

4 years agoparser: prepare to process int values
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月13日 20:25:22 +0000 (22:25 +0200)]
parser: prepare to process int values

4 years agodon't copy label
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月13日 20:03:13 +0000 (22:03 +0200)]
don't copy label

4 years agoadd stty.settings
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月13日 14:19:40 +0000 (16:19 +0200)]
add stty.settings

4 years agofix error handling/recovery
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月13日 14:21:09 +0000 (16:21 +0200)]
fix error handling/recovery

Improve error reporting too.

Error messages are sent to stderr, so stdout still carries a valid JSON
stream.

4 years agoinitial commit fully working on sample data
commit | commitdiff | tree
Thibaut VARÈNE [2021年8月13日 13:26:20 +0000 (15:26 +0200)]
initial commit fully working on sample data

tic2json TIC parser/converter
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /