📜 ⬆️ ⬇️

BlackBox is a source code generator (JAVA, C #, C) processing the binary protocol of your distributed application

In continuation of the topic , where readers are concentrating solely on the interface topic (the hooligans of buttons and encoders are deprived) , they completely missed that the proposal to move the interface from the microcontroller to a mobile phone or computer is just one of the many uses of the BlackBox code generator. Some time has passed, the project is developing and it's time to write exclusively about the code generator itself.

Let me remind you that the BlackBox code generator generates the source code ( JAVA, C #, C ) for processing the exchange protocol, as described by the user, in a predefined format. This is a regular JAVA file for editing of which you need to connect a set of data description annotations to the JAVA project and follow a small set of rules .

Having described the exchange protocol, packages, channels, hosts, communication interfaces, network topology and specifying the languages ​​(JAVA, C #, C) for which you need the source code, we check that there are no errors and the file is successfully compiled.

Then we send the source in the form of attachment of the letter, to the postal address of OneBlackBoxPlease@outlook.com .

The server periodically picks up the sent specifications, checks their correctness.
Generates the source code ordered in the specification, in the required programming languages.
After that, it creates several tests and the sources are run through them.

If all the tests were successful, the generated code, the last test passed, as well as an example of using the ordered API is packed into the archive and sent to the addressee.

If an error is detected, the sender is notified of a possible delay, and the BlackBox support service understands the difficulty.

The contents of the archive sent may, for example, look like this.



And just recently, to confirm maturity and as a demonstration of BlackBox's capabilities, a project was created to convert information about packages of the well-known MAVLink unmanned device control protocol into BlackBox format.

In MAVLink, the protocol description is in XML format . In BlackBox format, this file looks like this .

Of course, BlackBox has a much larger variety of data types compared to MAVLink, so the project demonstrates only a fraction of the capabilities of BlackBox. Read more about the conversion project here .

The result of the project is confirmed - BlackBox can easily replace MAVLink. All tests passed successfully, everything works fine. But, in order, in the context of MAVLink, to take advantage of all the features of the BlackBox, you will have to revise the protocol description.



Results:

If you are in the process of writing your distributed application, are thinking about the exchange protocol, you are not satisfied with the performance of the protocol already used or are tired of looking for errors and suffering when extending the protocol - try BlackBox .

In addition to the obvious application in distributed applications, with BlackBox you can easily for example: write your own protocol to SQLite, in any of the languages JAVA, C #, C ,
create your optimal format for uploading information to a file, followed by reading.

And, of course ... transfer the microcontroller control interface to the operator’s side.

Source: https://habr.com/ru/post/410297/