Package: construct-gallery
construct-gallerywxPython Widgets extending functionalities ofconstruct-editorThe following Python modules are included:construct_gallery.py, providing theConstructGallery()class.This module implements a GUI editor to parse and build an editable and ordered list of binary data via a gallery of predefinedconstructdata structures.constructis a powerful, declarative, symmetrical parser and builder for binary data.construct_gallery.pyis based onwxPythonandconstruct-editor: it relies on the excellent editing widgets provided by theconstruct-editormodule and offers a superset of features compared with its standardGUI.This module can be directly used in GUI programs, or can be further extended withbleak_scanner_construct.py.config_editor.py, providing theConfigEditorPanel()class (widget).This widget implements an editing GUI composed by a form including multiple byte structures, each one related to its ownconstructdata model.The structure of this form is described by the "editing_structure" parameter.bleak_scanner_construct.py, providing theBleakScannerConstruct()class.The component implements aBluetooth Low Energy(BLE) GUI client to log, browse, test and editBLE advertisements.This module extendsconstruct_gallery.py, offering a skeleton of BLE Advertiser scanner.bleakis needed (pip3 install bleak)construct-galleryalso includes a number ofconstruct-editorplugins, which are used byConstructGallery()andBleakScannerConstruct(), but they can be separately reused on projects based onconstruct-editor.plugins offering additional options for the context menu of theconstruct-editorHexEditorGrid (invoked with the right click of the mouse):allow_python_expr_plugin.pydecimal_convert_plugin.pystring_convert_plugin.pyPyShell pluginpyshell_plugin.py, adding a button to activate a PyShell frame (PyShell is a GUI-based python shell).wx_logging_plugin.py, providing a debug GUI panel in background.pyshell_plugin.py, activating a Python shell button that allows opening an inspector shell, which also includes a specialHelpwith related submenu (that can be invoked also via F9).Main functionalitiesCross-platform GUIThe GUI includes a BLE control (implemented with buttons) which allows starting and stopping the BLE advertising receiver. Advertisements are logged in their reception sequence, automatically labbelled with the MAC address.A filter button can be used to enter a specific MAC address to restrict logging, a portion of it or a sequence of addresses, as well as BLE local names.Logged data can be saved to file inpickle format. Archives can be subsequently reloaded and appended to the current log. They can also be inspected withpython -mpickle archive-file-name.pickle.Advertisement data are logged in the left panel, shown as hex bytes in the central panel and then parsed to browsableconstructstructures in the right panel.The Python error management is wrapped into a GUI panel.A Python shell button allows opening an inspector shell, which also provides a specialHelpwith related submenu (or by pressing F9).All panels allow a context menu (invoked with the right click of the mouse) with a number of special functions.The left log menu panel allows renaming labels and changing MAC address. Also, by double clicking an unused area of the log panel, new frames can be added and then labelled; subsequently, a specific MAC address can be associated. Log elements can be repositioned, or deleted.The hex editor (central panel) allows any kind of copy/paste. Sequences of bytes can be pastedin a number of different formats. Also a special checkbox enables pasting Python expressions. Two debugging tools are also provided (invoked with the right click of the mouse after selecting a sequence of bytes), to convert bytes into a wide set of numeric forms as well as strings; these debug panels can be used to quickly check the most appropriate conversion method for a sequence of bytes.When starting the BLE reception, a debug window is opened in background, with the possibility to control the debug level and clear the produced data.Full information, installation notes, API reference and usage details at theconstruct-gallery GitHub repository.