OTA Updates

System.updatesEnabled()

System.updatesEnabled, updatesEnabled

// System.updatesEnabled() example
bool isSafeToUpdate() {
  return true;
}

void loop() {
  if (!isSafeToUpdate() && System.updatesEnabled()) {
      Particle.publish("error", "Updates are enabled but the device is not safe to update.");
  }
}

Determine if firmware updates are presently enabled or disabled for this device.

Returns true on startup, and after System.enableUpdates() has been called. Returns false after System.disableUpdates() has been called.

Version Developer Devices Product
Device OS < 1.2.0 Supported Supported
Device OS >= 1.2.0 Supported Supported