From 161f996d6af434eb6f81c4261138911f4cc5184e Mon Sep 17 00:00:00 2001 From: bey0ne <195894611+bey0ne@users.noreply.github.com> Date: Tue, 27 Oct 2026 19:49:35 +0000 Subject: [PATCH] Targets: keep the PLID computed when loading targets.txt tagtinker_targets_load() wrote the PLID into the target and then cleared the whole target with memset() (since 0447f12, custom size support). After a restart every saved tag therefore had PLID 00 00 00 00, the broadcast address: targeted payloads (LED Test, Set Image, Set Text) were ignored by the tag, while broadcast commands such as the diagnostic page still worked. A tag added in the current session was fine until the app was closed. Clear the slot first, then compute the PLID. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QYkmJ3RnCgGZEBKnfRJt5x --- tagtinker_app.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tagtinker_app.c b/tagtinker_app.c index fa1822f..1bff3d1 100644 --- a/tagtinker_app.c +++ b/tagtinker_app.c @@ -535,9 +535,11 @@ void tagtinker_targets_load(TagTinkerApp* app) { p = sep + 1; } - if(tagtinker_barcode_to_plid(fields[0], app->targets[app->target_count].plid)) { - TagTinkerTarget* target = &app->targets[app->target_count]; - memset(target, 0, sizeof(*target)); + /* Clear the slot first: clearing it after computing the PLID + * left every saved tag with PLID 00 00 00 00 (broadcast). */ + TagTinkerTarget* target = &app->targets[app->target_count]; + memset(target, 0, sizeof(*target)); + if(tagtinker_barcode_to_plid(fields[0], target->plid)) { strncpy(target->barcode, fields[0], TAGTINKER_BC_LEN); target->barcode[TAGTINKER_BC_LEN] = '\0';