Log invalid BLE probe payload and pacing arguments

This commit is contained in:
evgeny committed 2026-10-30 04:48:37 +01:00
1 parent 5957e01ae2
commit b5addd8b05
1 file changed
+5 -2
+5 -2
View File
@@ -74,9 +74,12 @@ int main(int argc, char** argv) {
unsigned window = argc > 5 ? (unsigned)atoi(argv[5]) : 1;
packet_size = argc > 6 ? (unsigned)atoi(argv[6]) : 1500;
unsigned interval_ms = argc > 7 ? (unsigned)atoi(argv[7]) : 0;
if (seconds < 1 || seconds > 300 || !packets || packets > 1000000 || !window || window > 64 ||
packet_size < 2 || packet_size > 1500 || interval_ms > 1000) return 2;
debug_config_init(); debug_set_level(DEBUG_LEVEL_WARN); debug_set_category_level(DEBUG_CATEGORY_DISCOVERY, DEBUG_LEVEL_DEBUG);
if (seconds < 1 || seconds > 300 || !packets || packets > 1000000 || !window || window > 64 ||
packet_size < 2 || packet_size > 1500 || interval_ms > 1000) {
DEBUG_ERROR(DEBUG_CATEGORY_DISCOVERY, "BLE probe invalid arguments seconds=%d packets=%u window=%u bytes=%u interval_ms=%u",
seconds, packets, window, packet_size, interval_ms); return 2;
}
struct UASYNC* ua = uasync_create();
struct SC_MYKEYS keys; if (!ua || sc_generate_keypair(&keys) != SC_OK) return 1;
char priv[65], pub[65], config[512];