minimal CLI tools to simulate and scan UID responses in AISG device discovery.
simulates AISG device responses to UID patterns.
takes a list of full UIDs as arguments and reads input lines from stdin:
- if exactly one UID matches the pattern → prints it
- if multiple match → prints a collision string (garbage-like output)
- if no match → prints nothing
an input string is split into:
- first two characters (
left
) - remaining characters (
right
)
a UID matches if:
uid.startswith(left) && uid.endswith(right)
example:
input = "12xx56"
matches uid = "12abc56"
./bootstrap.sh
./configure
make
make check
when running interactively, uidresp
accepts the following control commands:
SETADDR:<UID>
— manually assign address to a UID (e.g. for simulation)RESETADDR:<UID>
— remove previously assigned address from UIDRESETALL
— clear all assigned addresses
src/uidresp AB12345678901234567 AB02345678901234567
then type pattern lines interactively, e.g.:
AB
AB3
AB567
actively discovers UIDs using pattern refinement based on collision responses.
- iteratively refines the search by expanding the pattern inwards
- collects and mutes discovered UIDs
- supports automatic scanning over
socat
you can run uidresp
and uidscan
in pair using socat
:
socat exec:"src/uidresp AB12345678901234567 AB02345678901234567" \
exec:"src/uidscan AB"
this will run a full scan for all devices that match prefix AB
and
follow the expected UID format.
unit tests cover:
UidResponder::matches
UidResponder::generateCollision
use make check
to run tests.
for more detailed output:
src/test_uidresp
framework: GoogleTest
crazybrake <crazybrake -sobaka- gmail dot com>, 2025