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
MySensorsCore: new sendAsIs() function #1290
Conversation
Do not force a C_SET command, letting the client use a C_INTERNAL one, e.g. to send the library version to the controller.
Hello pwieser, If you need to get the MySensors library version, I_INTERNAL messages are usually used by core functions, not directly exposed to the user like this, I think. What about something like this? I've not tried but it might also be more user friendly in user sketch
Do you know that you can keep track of your firmware revisions with sendSketchInfo? |
This functionality already exists- simply call:
In addition, the controller can request the library version by sending a |
Hello Olivier,
I do not understand your point : the present() function publishes the sensor id and type, not the library version.
Mine is to let the node advertise the controller of the library version it has been compiled with.
Or am I missing something ?
Regards
Pierre
… De: "Olivier" ***@***.***>
À: "mysensors/MySensors" ***@***.***>
Cc: "pwieser" ***@***.***>, "State change"
***@***.***>
Envoyé: Mercredi 22 Mai 2019 19:25:05
Objet: Re: [mysensors/MySensors] MySensorsCore: new sendAsIs() function (#1290)
This functionality already [
https://github.com/mysensors/MySensors/blob/master/core/MySensorsCore.cpp#L353-L358
| exists ] - simply call:
present(NODE_SENSOR_ID, S_ARDUINO_NODE)
In addition, the controller can request the library version by sending a
C_INTERNAL | I_PRESENTATION message to the node.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, [
#1290?email_source=notifications&email_token=ABPFI45E77CQC3S2ISJSV6DPWV6XBA5CNFSM4HOOEHB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV7XZAA#issuecomment-494894208
| view it on GitHub ] , or [
https://github.com/notifications/unsubscribe-auth/ABPFI42PGXXBYALNXNN72ULPWV6XBANCNFSM4HOOEHBQ
| mute the thread ] .
|
Hello Scalz,
Your proposal would be OK for my own immediate need.
I just tried to patch the code a minima, while keeping a generally usable method, i.e. for other possible use cases...
More, in my understanding, sendSketchInfo() sends name and version of the sketch, not of the library version it has been compiled with.
So, yes, one could use the "version" part of the function as the library version instead of the sketch version, but I think it would be more "user-friendly" to be able to publis the two informations.
Regards
Pierre
… De: "scalz" ***@***.***>
À: "mysensors/MySensors" ***@***.***>
Cc: "pwieser" ***@***.***>, "State change"
***@***.***>
Envoyé: Mercredi 22 Mai 2019 19:00:41
Objet: Re: [mysensors/MySensors] MySensorsCore: new sendAsIs() function (#1290)
Hello pwieser,
thx for contributing.
If you need to get the MySensors library version, I_INTERNAL messages are
usually used by core functions, not directly exposed to the user like this, I
think.
So I'm not sure if a sendAsIs-like user function is really needed. I let others
answer :)
What about something like this? I've not tried but it might also be more user
friendly in user sketch
bool sendMySensorsVersion(const bool ack)
{
return _sendRoute(build(_msgTmp, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL,
I_VERSION,
ack).set(MYSENSORS_LIBRARY_VERSION));
}
Do you know that you can keep track of your firmware revisions with
sendSketchInfo?
Here more infos about MySensors Api (battery level, sketchInfo etc): [
https://www.mysensors.org/apidocs-beta/group__MySensorsCoregrp.html |
https://www.mysensors.org/apidocs-beta/group__MySensorsCoregrp.html ]
—
You are receiving this because you modified the open/close state.
Reply to this email directly, [
#1290?email_source=notifications&email_token=ABPFI46ATVUEULOEZZEIO5DPWV33TA5CNFSM4HOOEHB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV7V4CY#issuecomment-494886411
| view it on GitHub ] , or [
https://github.com/notifications/unsubscribe-auth/ABPFI46KSYOGDPDHTYTBK7DPWV33TANCNFSM4HOOEHBQ
| mute the thread ] .
|
This is exactly what |
Do not force a C_SET command, letting the client use a C_INTERNAL one,
e.g. to send the library version to the controller.