LEGO / lego-ble-wireless-protocol-docs

This repository contains information about LEGO Hubs (name, battery level, etc.) and to interact with any sensors and motors connected to it.
https://lego.github.io/lego-ble-wireless-protocol-docs
MIT License
334 stars 43 forks source link

Machine readable specification of the protocol #14

Closed janvrany closed 8 months ago

janvrany commented 4 years ago

Hi,

is there any kind of machine readable specification of the protocol? This would be extremely useful to build custom client libraries such as pylgbst, bricknil, wireshark dissectors, you name it. Now one has to manually transcribe this document into a code instead of generating it which is tedious and error-prone.

hasselmm commented 4 years ago

It such really worth the effort? Who guaranties the generator is without errors? Who guaranties that the specification is technically sound and matches implementation? You have to test and review anyway.

janvrany commented 4 years ago

Who guaranties that the specification is technically sound and matches implementation? You have to test and review anyway.

Nobody, just like nobody guarantees this textual documentation (esentially a prose) is sound and matches the implementation. Sure you can have a bug in spec, but then, fixing bug in the spec at one place fixes it for all consumers.

Who guaranties the generator is without errors?

Nobody, just like nobody guarantees human-written translation of this textual documentation into a code is without errors. Sure you can have a bug in generator, but often generators are smaller than the code they generate.

It such really worth the effort?

I personally have no doubts about that. I use machine-readable formal ISA specs on nearly daily basis to automatically synthetise instruction encoder and decoder. GCC uses machine-readable formal specs to synthetise assembler, disassembler and simulator from single ISA specification.

janvrany commented 8 months ago

Closed because because of lack of interest.