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

MySensorsCore: new sendAsIs() function #1290

Closed
wants to merge 1 commit into from

Conversation

p-wieser
Copy link

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.

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.
@p-wieser p-wieser closed this May 21, 2019
@p-wieser p-wieser reopened this May 21, 2019
@scalz
Copy link

scalz commented May 22, 2019

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

@tekka007
Copy link
Contributor

This functionality already 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.

@p-wieser
Copy link
Author

p-wieser commented May 24, 2019 via email

@p-wieser
Copy link
Author

p-wieser commented May 24, 2019 via email

@tekka007
Copy link
Contributor

Hello Olivier, I do not understand your point : the present() function publishes the sensor id and type, not the library version.

This is exactly what present() does when called with NODE_SENSOR_ID as parameter (see here). Btw, the library version is automatically sent during bootup using this exact command, see here for reference.

@tekka007 tekka007 closed this Jul 14, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants