Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

North plugin "operation" documentation is incorrect #829

Open
jchabod opened this issue Sep 19, 2022 · 1 comment
Open

North plugin "operation" documentation is incorrect #829

jchabod opened this issue Sep 19, 2022 · 1 comment
Assignees

Comments

@jchabod
Copy link

jchabod commented Sep 19, 2022

From https://fledge-iot.readthedocs.io/en/latest/plugin_developers_guide/04_north_plugins.html :

In section The plugin_register entry point we can read the prototype for "operation" as:

void plugin_register(PLUGIN_HANDLE handle, (bool ( *write)(char *name, char *value, ControlDestination destination, ...), int (* operation)(char *operation, int paramCount, char *parameters[], ControlDestination destination, ...))

However, in north.cpp we can see a different prototype.

static int controlOperation(char *operation, int paramCount, char *names[], char *parameters[], ControlDestination destination, ...)

It seems that "array-like" operation are now "object-like". Can you confirm (and update documentation?)

It seems very uncomfortable that the plugin API does not define an API version which could allow the plugin to check its compatibility.
For example, when looking to some specific implementations like https://github.com/fledge-power/fledge-north-iec104/ there is no way for the plugin to determine that the API changed and that the call to m_operwill not lead a segfault. (this is the case)

At minimum the plugin_api.h should provide the prototypes for every interfaces, including callbacks. (which would allow, at least to identify a prototype incompatibility, but clearly that is not enough), but clearly an interface version seems better

@MarkRiddoch
Copy link
Contributor

It looks like we have missed one of the arguments to the plugin_operation call in the documentation. This needs to be fixed.

The API version is contained within the block of data returned by plugin_info.

I will need to look into the prototypes, I thought that they were there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants