Legrandgroup / libezsp

C++ library to send/receive wireless Zigbee messages to/from a Silicon Labs-based transceiver using the EZSP protocol.
BSD 3-Clause "New" or "Revised" License
16 stars 7 forks source link

Getter for ezsp version and current dongle firmware version #55

Closed masa-raritan closed 4 years ago

masa-raritan commented 4 years ago

Please provide a getter each of the following:

The firmware version is needed to check the dongle for an firmware update and for informational purposes of course.

lionelains commented 4 years ago

Yes, this can be done. I'm working on this in a dedicated branch: https://github.com/Legrandgroup/libezsp/tree/add-version-getter-to-api

lionelains commented 4 years ago

Hello @masa-raritan, can you check if the code introduced in PR #57 fits your need?

masa-raritan commented 4 years ago

Hi @lionelains. This should fit my needs. Is there a way to read out the firmware version from the update binaries too?

lionelains commented 4 years ago

I guess it is then OK to merge this into master, and close this issue. Am I right? Meanwhile, I am going to check if version can be extracted from gbl files.

masa-raritan commented 4 years ago

Yes, thank you.

lionelains commented 4 years ago

Code in PR #57 implements this and has been merged into master, available in release v2.1.0. Example on how to use the getter this can be found here: https://github.com/Legrandgroup/libezsp/blob/8571574085160bc71177f68795f09b17b3c2ad7f/example/mainEzspStateMachine.h#L105

Note you should check that the libezsp library exports its NSEZSP::CLibEzspState state as NSEZSP::CLibEzspState::READY before you invoke NSEZSP::CEzsp::getAdapterVersion() or you might get an empty or incomplete version returned.

lionelains commented 4 years ago

Is there a way to read out the firmware version from the update binaries too?

I have added a small utility for this purpose in the source tree: https://github.com/Legrandgroup/libezsp/commit/e5fa2d38fe1234d53d1c11625bcb91fbefac1602