Skip to content

Commit b254f33

Browse files
Merge pull request #2410 from arduino/benjamindannegard/update-cloud-docs-device-priority
[PXCT-390] Updated cloud docs for device priority
2 parents f935de6 + c9e3d1f commit b254f33

File tree

1 file changed

+11
-0
lines changed
  • content/arduino-cloud/03.cloud-interface/00.sketches

1 file changed

+11
-0
lines changed

content/arduino-cloud/03.cloud-interface/00.sketches/sketches.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ void onTestChange(){
103103
}
104104
```
105105

106+
There are a few different options available for synchronizing your sketch with the Arduino Cloud:
107+
- `MOST_RECENT_WINS` - The latest update whether from the device or the cloud is used. Best for real-time applications where the latest data should always be used, regardless of source.
108+
- `CLOUD_WINS` - The cloud value always overwrites the device value. Useful when the cloud holds critical configurations or settings that should always be enforced on the device.
109+
- `DEVICE_WINS` - The device value always overwrites the cloud value. Used when the device generates important real-time data (sensor readings) that should always be preserved over cloud updates.
110+
111+
It can be set in your sketch with:
112+
113+
```arduino
114+
setSyncPolicy(MOST_RECENT_WINS); // or CLOUD_WINS, DEVICE_WINS
115+
```
116+
106117
### Configuration Header File
107118

108119
The `thingProperties.h` file is a non-editable file that updates based on changes made in your Thing. For example:

0 commit comments

Comments
 (0)