From dd0dfe703a7b1227e79015510d29fb9e98ed0fcb Mon Sep 17 00:00:00 2001 From: johvik Date: Mon, 15 Jun 2026 09:41:31 +0200 Subject: [PATCH] Add address to found_event callback --- mbus/mbus-protocol-aux.c | 4 ++-- mbus/mbus-protocol-aux.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mbus/mbus-protocol-aux.c b/mbus/mbus-protocol-aux.c index 473ead2..2f7a9fb 100755 --- a/mbus/mbus-protocol-aux.c +++ b/mbus/mbus-protocol-aux.c @@ -778,7 +778,7 @@ mbus_register_scan_progress(mbus_handle * handle, void (*event)(mbus_handle * ha /// Register a function for the found events. //------------------------------------------------------------------------------ void -mbus_register_found_event(mbus_handle * handle, void (*event)(mbus_handle * handle, mbus_frame *frame)) +mbus_register_found_event(mbus_handle * handle, void (*event)(mbus_handle * handle, mbus_frame *frame, const char *address)) { handle->found_event = event; } @@ -2368,7 +2368,7 @@ mbus_probe_secondary_address(mbus_handle *handle, const char *mask, char *matchi if (handle->found_event) { - handle->found_event(handle,&reply); + handle->found_event(handle,&reply,addr); } return MBUS_PROBE_SINGLE; diff --git a/mbus/mbus-protocol-aux.h b/mbus/mbus-protocol-aux.h index b119f61..52325f7 100755 --- a/mbus/mbus-protocol-aux.h +++ b/mbus/mbus-protocol-aux.h @@ -99,7 +99,7 @@ typedef struct _mbus_handle { void (*recv_event) (unsigned char src_type, const char *buff, size_t len); void (*send_event) (unsigned char src_type, const char *buff, size_t len); void (*scan_progress) (struct _mbus_handle *handle, const char *mask); - void (*found_event) (struct _mbus_handle *handle, mbus_frame *frame); + void (*found_event) (struct _mbus_handle *handle, mbus_frame *frame, const char *address); bool (*abort_scan_check) (struct _mbus_handle *handle); void *auxdata; void *userdata; /**< User‑managed pointer for callback context */ @@ -170,7 +170,7 @@ typedef enum _mbus_context_option { void mbus_register_recv_event(mbus_handle *handle, void (*event)(unsigned char src_type, const char *buff, size_t len)); void mbus_register_send_event(mbus_handle *handle, void (*event)(unsigned char src_type, const char *buff, size_t len)); void mbus_register_scan_progress(mbus_handle *handle, void (*event)(mbus_handle *handle, const char *mask)); -void mbus_register_found_event(mbus_handle *handle, void (*event)(mbus_handle *handle, mbus_frame *frame)); +void mbus_register_found_event(mbus_handle *handle, void (*event)(mbus_handle *handle, mbus_frame *frame, const char *address)); /** * Callback invoked prior to starting the next iteration of a scan.