-
|
Greetings, |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 20 replies
-
|
Never used Python but it should be no big deal for you. I see these options:
|
Beta Was this translation helpful? Give feedback.
-
|
I added an issue: #265 |
Beta Was this translation helpful? Give feedback.
-
|
Next release (v0.50.0) has a new switch |
Beta Was this translation helpful? Give feedback.
-
|
Right now we still have no solution for this. But it should be not too complicated to implement that. This is an Open Source project, so anybody needing such a solution can implement it. It is not complicated, especially it is a separate implementation and does not interfere with the main project. Some ideas:
//! \file til.c
//! ///////////////////////////////////////////////////////////////////////////
//! Trice generated code - do not edit!
#include "til.h"
//! triceFormatStringList contains all trice format strings together with id and parameter information.
//!
//! The bitWidth value is not transmitted in the binary data stream and needed for its decoding.
//! The paramCount is de-facto not needed. It is derivable from the received data, see docs/TriceUserManual.md#binary-encoding.
//! It is recommended to check if both values are matching. A negative paramCount indicates, that its value is unknown at compile time.
const triceFormatStringList_t triceFormatStringList[] = {
/* Trice type ( extended ) */ // id, bitWidth, paramCount, format-string
/* trice ( trice32_9 ) */ { 14016, 32, 9, "rd:trice %d, %d, %d, %d, %d, %d, %d, %d, %d\n" },
/* trice ( trice0 ) */ { 14224, 32, 0, "\n" },
/* trice32 ( trice32_1 ) */ { 14337, 32, 1, "msg:%u (%%u)\n" },
/* TRICE8 ( TRICE8_10 ) */ { 15063, 8, 10, "rd:TRICE8 %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\n" },
/* Trice8 ( Trice8_9 ) */ { 15124, 8, 9, "rd:Trice8 %d, %d, %d, %d, %d, %d, %d, %d, %d\n" },
/* TRICE8 ( TRICE8_5 ) */ { 15058, 8, 5, "rd:TRICE8 %d, %d, %d, %d, %d\n" },
/* TRice ( TRice0 ) */ { 14885, 32, 0, "TEST:yellow+h:black\n" },
/* Trice64 ( Trice64_1 ) */ { 15560, 64, 1, "rd:Trice64 %d\n" },
/* trice ( trice32_1 ) */ { 15860, 32, 1, "rd:TRICE float %9.f (%%9.f)\n" },
...
/* TRICE64_0 ( TRICE64_0 ) */ { 16157, 64, 0, "w: Hello! 👋🙂 \a\n" },
/* TRICE ( TRICE0 ) */ { 14658, 32, 0, "interrupt:magenta+i:default+h\n" },
};
//! triceFormatStringListElements holds the compile time computed count of list elements.
const unsigned triceFormatStringListElements = sizeof(triceFormatStringList) / sizeof(triceFormatStringList_t);
|
Beta Was this translation helpful? Give feedback.
-
|
Hi Thomas
Thank you very much for all the helpfull and informative answers!
BR
Rafi.
קבל Outlook עבור Android<https://aka.ms/AAb9ysg>
…________________________________
From: Thomas Höhenleitner ***@***.***>
Sent: Monday, February 9, 2026 8:04:43 PM
To: rokath/trice ***@***.***>
Cc: Rafi22222 ***@***.***>; Comment ***@***.***>
Subject: Re: [rokath/trice] Python Integration? (Discussion #263)
Right now we still have no solution for this. But it should be not too complicated to implement that. This is an Open Source project, so anybody needing such a solution can implement it. It is not complicated, especially it is a separate implementation and does not interfere with the main project. Some ideas:
* Configure Trice package framing firstly to COBS. There is ready-to-use code in C and Python for decoding.
* In Python, I guess, exist JSON parser.
* In C, if parsing the JSON Trice ID list is an issue, you can use trice generate ...to get C code like this:
//! \file til.c
//! ///////////////////////////////////////////////////////////////////////////
//! Trice generated code - do not edit!
#include "til.h"
//! triceFormatStringList contains all trice format strings together with id and parameter information.
//!
//! The bitWidth value is not transmitted in the binary data stream and needed for its decoding.
//! The paramCount is de-facto not needed. It is derivable from the received data, see docs/TriceUserManual.md#binary-encoding.
//! It is recommended to check if both values are matching. A negative paramCount indicates, that its value is unknown at compile time.
const triceFormatStringList_t triceFormatStringList[] = {
/* Trice type ( extended ) */ // id, bitWidth, paramCount, format-string
/* trice ( trice32_9 ) */ { 14016, 32, 9, "rd:trice %d, %d, %d, %d, %d, %d, %d, %d, %d\n" },
/* trice ( trice0 ) */ { 14224, 32, 0, "\n" },
/* trice32 ( trice32_1 ) */ { 14337, 32, 1, "msg:%u (%%u)\n" },
/* TRICE8 ( TRICE8_10 ) */ { 15063, 8, 10, "rd:TRICE8 %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\n" },
/* Trice8 ( Trice8_9 ) */ { 15124, 8, 9, "rd:Trice8 %d, %d, %d, %d, %d, %d, %d, %d, %d\n" },
/* TRICE8 ( TRICE8_5 ) */ { 15058, 8, 5, "rd:TRICE8 %d, %d, %d, %d, %d\n" },
/* TRice ( TRice0 ) */ { 14885, 32, 0, "TEST:yellow+h:black\n" },
/* Trice64 ( Trice64_1 ) */ { 15560, 64, 1, "rd:Trice64 %d\n" },
/* trice ( trice32_1 ) */ { 15860, 32, 1, "rd:TRICE float %9.f (%%9.f)\n" },
...
/* TRICE64_0 ( TRICE64_0 ) */ { 16157, 64, 0, "w: Hello! 👋🙂 \a\n" },
/* TRICE ( TRICE0 ) */ { 14658, 32, 0, "interrupt:magenta+i:default+h\n" },
};
//! triceFormatStringListElements holds the compile time computed count of list elements.
const unsigned triceFormatStringListElements = sizeof(triceFormatStringList) / sizeof(triceFormatStringList_t);
* The main task to solve, is to write a parser in C or Python for the binary (COBS-decoded) Trice data to get the Trice IDs and the payload.
—
Reply to this email directly, view it on GitHub<#263 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/B6BNVGJ7KHPQVGPNRGQN6IL4LDD3XAVCNFSM6AAAAACUPO67RWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKNZUGY3DCNA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
I added an issue: #265