Skip to content

Commit 26617d5

Browse files
committed
fix(axparameter): clarify parameter name format for axparameter API
- Add explanatory comment showing both short and fully qualified parameter names are valid - Use both fully qualified and short parameter names for clear demonstration - Note exception: ax_parameter_add() accepts only short names
1 parent 52f1c92 commit 26617d5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

axparameter/app/axparameter.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,22 @@ 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"
198+
// part set as the app_name passed to ax_parameter_new.
199+
// The callback will always receive the fully qualified parameter name.
200+
//
201+
// Exception: ax_parameter_add() accepts only short names.
202+
193203
// Act on changes to IsCustomized as soon as they happen.
194-
if (!ax_parameter_register_callback(handle, "IsCustomized", parameter_changed, handle, &error))
204+
if (!ax_parameter_register_callback(handle,
205+
"root." APP_NAME ".IsCustomized",
206+
parameter_changed,
207+
handle,
208+
&error))
195209
panic("%s", error->message);
196210

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

0 commit comments

Comments
 (0)