I am finalizing a presentation of particle cloud/OTA framework for my company.
I have made designed a simple demo hardware (nothing fancy : an oled screen & a SR104 sonar) with associated software.
Obviously automatic OTA of all devices running a product is a key feature I will demonstrate.
So for demonstration purpose, the oled screen is supposed to display the product id as well as the product version.
My question is simple
PRODUCT_ID(x) and PRODUCT_VERSION(y) allow to define it but is there a system C/C++ API to fetch the current version ?
Obviously, I can design something like:
- a small include MyProductInfo.h as
#define MY_PRODUCT_ID 111
#define MY_PRODUCT_VERSION 12
- make a call at the right place like
- in other places, where I need it
but It means I would have to include it EVERYWHERE I plan to use the info. Not very satisfactory to me.
I like the idea : 2 lines of code to set it in a unique place, then available everywhere via a system call.
Any idea ?