Skip to content

Print nanopb data in nice way, almost same as Python implementation

Notifications You must be signed in to change notification settings

tymmej/nanopb_printer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nanopb_printer

Print nanopb data in nice way, almost same as Python implementation

Example

nanopb_printer:

╰─ ./simple.out                                                                           ─╯
number: 99

lucky_number: 42
unlucky_number: 0
enum1: TWO

lucky_number: 23
enum1: TWOTWO
byte: "a55a"


nested2 {
}
enum1: ONE
enum2: TWOTWO

text: "asdf"
text: "zxcv"
message {
        lucky_number: 0
        unlucky_number: 169
        enum1: ONE
}
message {
        lucky_number: 0
        unlucky_number: 144
        enum1: ONE
}

unlucky_number: 123
notnested: 124

msg1 {
        lucky_number: 42
        unlucky_number: 24
        enum1: TWO
}
notnested: 142

included {
        enum_inc: EXCLUDED
}

Python:

╰─ python3 example.py                                                                    ─╯
number: 99

lucky_number: 42
unlucky_number: 0
enum1: TWO

lucky_number: 23
enum1: TWOTWO
byte: "\245Z"

nested2 {
}
enum1: ONE
enum2: TWOTWO

text: "asdf"
text: "zxcv"
message {
  lucky_number: 0
  unlucky_number: 169
  enum1: ONE
}
message {
  lucky_number: 0
  unlucky_number: 144
  enum1: ONE
}

unlucky_number: 123
notnested: 124

msg1 {
  lucky_number: 42
  unlucky_number: 24
  enum1: TWO
}
notnested: 142

included {
  enum_inc: EXCLUDED
}

Differences:

  1. Indentetion: spaces vs tabs
  2. Binary formats: hex (a55a) vs Python (\245Z)

Usage

  1. make clean
  2. make proto
  3. make parser
  4. make example && ./example/example
  5. make tests && ./tests/tests

About

Print nanopb data in nice way, almost same as Python implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published