Device OS 4.0: No more PRODUCT_ID!

If you are using the product firmware feature, once you begin targeting Device OS 4.0 and later you must remove the PRODUCT_ID macro from your code. You still need to set PRODUCT_VERSION.

Note that 4.0.0-alpha.1 is a pre-release and you should not upgrade production devices to it, but you can experiment with it on development devices in your product to get ready for it. Eventually, 4.0.0 will become the new LTS release of Device OS.

PRODUCT_ID is no longer necessary as all devices will behave as if the wildcard product ID (added in 1.5.4) is always used. To determine which product a device belongs to, it must be added to the product before it connects to the cloud. This has always been the recommended method for product devices, but will become a requirement with Device OS 4.0.

Quarantine mode will not be supported, nor will auto-approve. In practice, these options were either operationally confusing (quarantine) or insecure (auto-approve), and it’s always been best to pre-add Device IDs instead.

It makes it easier to have a single source code base that is compiled to multiple products.

If you want to make code that builds properly both before and after 4.0, you can structure it like this:

#ifndef SYSTEM_VERSION_v400ALPHA1
// Only used for Device OS 3.x and earlier
PRODUCT_ID(1234);
#endif
6 Likes