MatrixEditor / ubnt-discovery-tool

Updated and faster version of the Ubnt Discovery Tool (last update 2017 by provider) for Java (with GUI and CLI)
The Unlicense
1 stars 1 forks source link

[FEATURE] - A commandline version #4

Closed skinkie closed 1 year ago

skinkie commented 1 year ago

Is your feature request related to a problem? Please describe. While the release suggested there is a non-UI version, it seems this is currently not supported. The application always wants to connect to an X11 display.

Describe the solution you'd like Ideally: just a list of found devices as its output.

Describe alternatives you've considered This tool was the first alternative I foud for the official code, I have now tried a python variant which only lists the first device found on the first network interface. Hence, it needs more work.

https://github.com/just-oblivious/python-ubiquiti-discover

MatrixEditor commented 1 year ago

The so-called "non UI" version just doesn't include the FlatLaf library for a modern look and feel - it is not a CLI version. Since not everyone may have the ability to display graphical content, the proposed feature should be mandatory.

MatrixEditor commented 1 year ago

If you prefer using Python, you can try out this small snippet, which can parse received UBNT packets. Please note that the type handling is not implemented:

import construct as cs
from construct_dataclasses import dataclass_struct, csfield

@dataclass_struct
class Record:
    type: int = csfield(cs.Int8ub)
    length: int = csfield(cs.Int16ub)
    value: bytes = csfield(cs.Bytes(cs.this.length))

@dataclass_struct
class Frame:
    version: int = csfield(cs.Int8ub)
    command: int = csfield(cs.Int8ub)
    size: int = csfield(cs.Int16sb)
    records: list[Record] = csfield(cs.GreedyRange(Record.struct))

Frame.parser.parse(b"...")