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

Example request #6

Open
ryanbateman opened this issue Dec 18, 2024 · 1 comment
Open

Example request #6

ryanbateman opened this issue Dec 18, 2024 · 1 comment

Comments

@ryanbateman
Copy link

I don't know much C and I don't quite follow how to listen for an NCMD and then take any subsequent action (which would seem to be supported by the library but I am not quite certain). It would be great to have an example of how the EON should listen for an NCMD and then take any subsequent action.

@mkeras
Copy link
Owner

mkeras commented Jan 8, 2025

Hello, the actual listening for a NCMD would be done via an external library like this one, because it is done through subscribing to the MQTT sparkplug NCMD topic.

For example, upon connecting to an MQTT Broker using the above library, you would use the setCallback function of the client to set a callback that gets called when an incoming message is received. Then you would subscribe to your sparkplug node's NCMD topic using the subscribe function. The topic char to supply to the function would be the ->topics.NCMD of the SparkplugNodeConfig struct.

I have added some more detail to the documentation (library version 0.2.5). Let me know if this helps and I will close the issue.

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