Skip to content

Inconsistent API usage in the "axparameter" example #440

@lucky-rydar

Description

@lucky-rydar

Problem

The example app "axparameter" registers callbacks with short names but in the API it suggests to use "path-like" as the following: "root.Group.Name".

Line 194 in axparameter/app/axparameter.c:

if (!ax_parameter_register_callback(handle, "IsCustomized", parameter_changed, handle, &error))

However, line 158 in the callback it attempts to parse the parameter name assuming it was registered with a path name:

const char* name_without_qualifiers = &name[strlen("root." APP_NAME ".")];

Inconsistency

In the main function we are registering for the call back with a short name (e.g., "IsCustomized")
But once we handled change of the parameter we are trying to parse path (e.g., "root.axparameter.IsCustomized")

This creates inconsistency in the example app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions