https://github.com/n-elia/software-version-comparator-for-arduino
This is a simple sketch to compoare software version numbers. Tested on Arduino Nano 33 IoT
https://github.com/n-elia/software-version-comparator-for-arduino
Last synced: 5 months ago
JSON representation
This is a simple sketch to compoare software version numbers. Tested on Arduino Nano 33 IoT
- Host: GitHub
- URL: https://github.com/n-elia/software-version-comparator-for-arduino
- Owner: n-elia
- License: gpl-3.0
- Created: 2020-12-12T01:44:44.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-12T01:56:24.000Z (about 5 years ago)
- Last Synced: 2025-04-08T09:52:29.780Z (9 months ago)
- Language: C++
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Very simple software version comparator for Arduino
This is a simple sketch to compare software version numbers.
Tested on Arduino Nano 33 IoT.
## Usage
Software versions can have up to 5 sections, and each section can be a number spanning from `0` to `65535`. In other words, from `0` to `65535.65535.65535.65535.65535`.
Whenever you need it, you can call `short versionCompare(char v1[], char v2[])`, where v1 and v2 are char arrays, e.g. `char v1[] = "3.14.0.1"`.
The function will return:
- `0` if `v1` > `v2`
- `1` if `v2` > `v1`
- `2` if `v1` = `v2`
- `3` in case of errors