Skip to content

Commit e05f092

Browse files
fix(axparameter): Enforce fully-qualified parameter names for consistency
Co-authored-by: Mykhailo Didur <mikhaildidur2003@gmail.com>
1 parent 53f82a6 commit e05f092

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

axparameter/app/axparameter.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,20 @@ int main(void) {
190190
syslog(LOG_INFO, "SerialNumber: '%s'", serial_number);
191191
g_free(serial_number);
192192

193+
// Note: Most of axparameter API accepts both:
194+
// - short names (e.g., "IsCustomized")
195+
// - fully qualified names (e.g., "root.axparameter.IsCustomized").
196+
//
197+
// Both formats are internally converted to the fully qualified format with the "group" part set
198+
// as the app_name passed to ax_parameter_new. The callback will always receive the fully
199+
// qualified parameter name.
200+
193201
// Act on changes to IsCustomized as soon as they happen.
194-
if (!ax_parameter_register_callback(handle, "IsCustomized", parameter_changed, handle, &error))
202+
if (!ax_parameter_register_callback(handle,
203+
"root." APP_NAME ".IsCustomized",
204+
parameter_changed,
205+
handle,
206+
&error))
195207
panic("%s", error->message);
196208

197209
// Register the same callback for CustomValue, even though that parameter does not exist yet!

0 commit comments

Comments
 (0)