Checking for features
User firmware is designed to run transparently regardless of what type of device it is run on. However, sometimes you will need to have code that varies depending on the capabilities of the device.
It's always best to check for a capability, rather than a specific device. For example, checking for cellular instead of checking for the Electron allows the code to work properly on the Boron without modification.
Some commonly used features include:
For example, you might have code like this to declare two different methods, depending on your network type:
#if Wiring_WiFi const char *wifiScan(); #endif #if Wiring_Cellular const char *cellularScan(); #endif
The official list can be found in the source.