Skip to content

Merge in from upstream #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 225 commits into from
Apr 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
0b49274
Configure 868 order change (#132)
jpmeijers Nov 10, 2016
f72fb1b
fixed issues and remade example, removed init functions, fixed thethi…
Oct 13, 2016
9a64475
Optimization (#130)
Nov 16, 2016
dbf76aa
Merge pull request #117 from TheThingsNetwork/nanopbReceive
johanstokking Nov 16, 2016
ad7f2b1
Closes #138
Nov 17, 2016
33b1d45
fixed sendPayloads (port: int to char), found error when passing *siz…
Nov 18, 2016
6f5bea7
fix
Nov 18, 2016
50c075d
Merge pull request #140 from TheThingsNetwork/SerialToStream
johanstokking Nov 21, 2016
5dc127c
fixed compiling issues (#146)
Nov 29, 2016
e1d0c24
put the success/error message in flash memory, placed the defines for…
Nov 29, 2016
ad06600
Fix test always exits with 0 (#147)
FokkeZB Nov 30, 2016
a1400a7
Use Arduino CLI for CI
FokkeZB Nov 30, 2016
209b66a
fixed receive message (#148)
Nov 30, 2016
7746111
fix subString (#149)
Nov 30, 2016
6ce5a14
Move tests into folders
FokkeZB Nov 30, 2016
9f8cbf9
Use leonardo
FokkeZB Nov 30, 2016
f8db761
Fix path in travis
FokkeZB Nov 30, 2016
f96814b
Verify all examples after setting freqPlan
FokkeZB Nov 30, 2016
1ad3318
Fix replace
FokkeZB Nov 30, 2016
064baab
Try to fix sed on debian
FokkeZB Nov 30, 2016
fcddbba
Use verbose to see why 2nd example fails
FokkeZB Nov 30, 2016
52c615a
Fix Message example CI
FokkeZB Nov 30, 2016
93a780d
Typo in Message/Send/send
FokkeZB Nov 30, 2016
ca9c5b6
Update CONTRIBUTING.md, fix Message/Send example
FokkeZB Nov 30, 2016
967cf22
Install DHT sensor library for DHT example
FokkeZB Nov 30, 2016
30b411b
Force 1.3.0 of DHT lib
FokkeZB Nov 30, 2016
cd44e5e
Update Arduino IDE version
FokkeZB Nov 30, 2016
238f386
Add Unified Sensor lib
FokkeZB Nov 30, 2016
e170296
Use env for Arduino version
FokkeZB Dec 1, 2016
cd12be2
Merge pull request #151 from TheThingsNetwork/fix/150
johanstokking Dec 1, 2016
afc0cd4
add return messages for join and personalize + rebased (#143)
Dec 1, 2016
aefd05b
bump version (#154)
FokkeZB Dec 5, 2016
23455dc
fixed buffer-overflow (#157)
Dec 6, 2016
01a314e
Change library author to The Things Network only (#156)
FokkeZB Dec 6, 2016
cc79bab
Bump version (#158)
FokkeZB Dec 6, 2016
698296d
Update TheThingsNetwork.md (#159)
FokkeZB Dec 6, 2016
9f19c4c
Made freqPlan a define (#161)
Dec 8, 2016
5f385cb
Created calculateAirtime and made airtime public (#162)
Dec 8, 2016
bbaa461
added a few optional fields in the proto files
Nov 21, 2016
0fc94e7
changed activate to switch
Dec 9, 2016
e2121ca
fix
Dec 9, 2016
e286e0b
fix docs and example
Dec 12, 2016
ce7c55a
Merge pull request #142 from TheThingsNetwork/changeProto
johanstokking Dec 12, 2016
36d1e6a
Fix API reference intro (#165)
FokkeZB Dec 13, 2016
73e6aa0
Added defines for the return values of sendBytes,removed defines, rep…
Dec 14, 2016
952a6ed
replaced A2 by LED_BUILTIN (#168)
Dec 14, 2016
ff241b5
changed/removed fields name
Dec 16, 2016
bc2ecb4
Added sleep command
xoseperez Dec 16, 2016
d817ee0
A bit more room for long sleeping times
xoseperez Dec 17, 2016
6cf163f
add node class
FokkeZB Oct 6, 2016
1b72a8c
Use define for freqPlan
FokkeZB Dec 19, 2016
d9b4b8a
Update MCP9804 to 1.0, closes #164
FokkeZB Dec 20, 2016
008fd08
Update README, bump version, fix keywords (#167)
FokkeZB Dec 20, 2016
b922f11
fix spacing
Dec 20, 2016
2cf9846
Merge branch 'master' into feature/node
FokkeZB Dec 21, 2016
bd11b90
simplify Node example
FokkeZB Dec 21, 2016
2ebcb1a
Using 2 spaces indentation
xoseperez Dec 21, 2016
072d3d2
Merge pull request #171 from xoseperez/master
johanstokking Dec 22, 2016
68144a1
Document sleep
FokkeZB Dec 22, 2016
3485cf8
Merge pull request #173 from TheThingsNetwork/docs/sleep
johanstokking Dec 22, 2016
e5e416e
Address requests for changes
FokkeZB Dec 23, 2016
a97870e
Add setup event
FokkeZB Dec 23, 2016
2797bc0
Merge pull request #153 from TheThingsNetwork/feature/node
johanstokking Dec 23, 2016
d5c9445
Add Node example for activation website, Align Node and Uno example f…
FokkeZB Dec 23, 2016
97af939
Merge pull request #175 from TheThingsNetwork/landing
johanstokking Dec 23, 2016
2e115dc
Revert Node from landing config
FokkeZB Dec 27, 2016
d568a74
Merge pull request #177 from TheThingsNetwork/example/node
johanstokking Dec 27, 2016
1c74171
Bump version
FokkeZB Dec 27, 2016
88ebcda
Merge pull request #178 from TheThingsNetwork/publish
johanstokking Dec 27, 2016
a39a9b7
Merge pull request #170 from TheThingsNetwork/feature/change-proto-fi…
johanstokking Jan 25, 2017
7020915
Moved examples to TheThingsMessage folder
johanstokking Feb 10, 2017
f33745e
Code style
johanstokking Feb 10, 2017
9a27070
Added directive for AVR boards
johanstokking Feb 10, 2017
ec549b3
Code cleanup and pointer fixes
johanstokking Feb 10, 2017
dab86ba
Structure and code style
johanstokking Feb 10, 2017
ab09e24
Use shared buffer and introduced saveState()
johanstokking Feb 12, 2017
720e53f
Cleaning code
johanstokking Feb 12, 2017
4932859
Cleaning and don't print MAC commands as downlink
johanstokking Feb 13, 2017
3f3ba0d
Merge pull request #183 from TheThingsNetwork/fix/cleanup
johanstokking Feb 13, 2017
40793f5
Version bump
johanstokking Feb 13, 2017
f560f7a
Added getHardwareEui()
johanstokking Feb 16, 2017
740d606
Fixed retries
johanstokking Feb 16, 2017
acb5f09
Merge pull request #184 from TheThingsNetwork/fix/retries
johanstokking Feb 16, 2017
3f29f7c
Version bump
johanstokking Feb 16, 2017
cefa62f
Removed TheThingsNode, resolves #185
johanstokking Feb 23, 2017
f7753e3
Merge pull request #186 from TheThingsNetwork/fix/focus
johanstokking Feb 23, 2017
4dc688b
Removed TheThingsNode doc link
johanstokking Feb 23, 2017
4b7e5d2
Version bump
johanstokking Feb 24, 2017
402619e
Fixed retries
johanstokking Feb 24, 2017
9a06bf6
Version bump
johanstokking Feb 24, 2017
9bc28b1
Added getAppEui()
johanstokking Mar 13, 2017
bfd2f3a
Added autoBaud() to sync baud with RN module
johanstokking Mar 13, 2017
68bca48
Reset on provision
johanstokking Mar 13, 2017
79ebd00
Merge pull request #187 from TheThingsNetwork/feature/get-app-eui
johanstokking Mar 13, 2017
8b8a88d
Merge pull request #189 from TheThingsNetwork/feature/autobaud
johanstokking Mar 13, 2017
2cf2176
Merge branch 'master' into fix/provision-reset
johanstokking Mar 13, 2017
368793a
Merge pull request #188 from TheThingsNetwork/fix/provision-reset
johanstokking Mar 13, 2017
aab3944
Version bump
johanstokking Mar 13, 2017
54b4b43
Updated TheThingsNetwork documentation
johanstokking Mar 14, 2017
d957c89
Updated TheThingsNode documentation
johanstokking Mar 14, 2017
1718c4e
CayenneLPP class
johanstokking Mar 14, 2017
8c311ea
CayenneLPP example
johanstokking Mar 14, 2017
5407b7c
CayenneLPP docs
johanstokking Mar 14, 2017
67258be
Merge pull request #190 from TheThingsNetwork/feature/cayennelpp
johanstokking Mar 14, 2017
fd3d1ee
AS920-923 channel plan, affects #191
johanstokking Mar 18, 2017
014fffa
Flexible model and version splitting
johanstokking Mar 19, 2017
d5523f2
Changes to make library work with RN2903AS 1.0.3rc9
tftelkamp Mar 21, 2017
d08c506
Merge pull request #193 from tftelkamp/feature/as920_923
johanstokking Mar 21, 2017
53c9dad
Merge pull request #192 from TheThingsNetwork/feature/as920_923
johanstokking Apr 17, 2017
1c00f25
Fix reset of ADR
johanstokking Apr 17, 2017
05559a3
Merge pull request #197 from TheThingsNetwork/fix/adr-reset
johanstokking Apr 17, 2017
373e395
Pass SF to sendBytes()
johanstokking Apr 17, 2017
4b3c808
Merge pull request #198 from TheThingsNetwork/feature/sendbytes-sf
johanstokking Apr 17, 2017
5decd80
Version bump
johanstokking Apr 17, 2017
feeb679
Version bump
johanstokking Apr 17, 2017
35bda59
Version bump
johanstokking Apr 17, 2017
11370c2
Version bump
johanstokking Apr 17, 2017
ffbc988
Add Asia-high and Korea frequency plans - Untested.
jpmeijers Apr 17, 2017
56b6f71
Add Asia-high and Korea frequency plans - Untested.
jpmeijers Apr 17, 2017
5ec6bf4
Merge branch 'asian-frequency-plans' of https://github.com/TheThingsN…
jpmeijers Apr 18, 2017
57ff177
Removed dependency on LED_BUILTIN
johanstokking Apr 18, 2017
7c4371c
Merge pull request #200 from TheThingsNetwork/fix/led-builtin-dependency
johanstokking Apr 18, 2017
add66bb
Version bump
johanstokking Apr 18, 2017
a8c66b6
Remove obsolete documentation about calculated air time
avbentem Apr 23, 2017
b0c2d37
Merge pull request #201 from avbentem/patch-1
johanstokking Apr 23, 2017
531bf9f
Serial and SoftwareSerial port comments
jpmeijers May 2, 2017
22911ab
Improvement to the Serial port description.
jpmeijers May 3, 2017
34bd655
Merge pull request #203 from TheThingsNetwork/software-serial-docs
johanstokking May 3, 2017
312a006
Revert "Serial and SoftwareSerial port comments"
jpmeijers May 4, 2017
5a22e9f
Re-add general changes and links to documentation.
jpmeijers May 4, 2017
c3d8a2a
Merge pull request #204 from TheThingsNetwork/revert-203-software-ser…
johanstokking May 10, 2017
1c17713
Merge branch 'master' into asian-frequency-plans
jpmeijers May 11, 2017
0601d8d
Take default freq's of ch0 and ch1 into account.
jpmeijers May 11, 2017
81a6bbf
set the correct code under the method "reset"
dzmen Jun 2, 2017
dd96ef1
The info "band" is removed from the code
dzmen Jun 2, 2017
e02f33b
Merge pull request #206 from dzmen/patch-1
johanstokking Jun 6, 2017
b0e4616
Fix infinite join retry
jpmeijers Jun 7, 2017
e5365c4
Introduce attempts variable
jpmeijers Jun 7, 2017
fa757ac
Version bump
jpmeijers Jun 7, 2017
dedd359
Merge pull request #207 from TheThingsNetwork/fix/infinite-join
johanstokking Jun 7, 2017
4eae50c
Add a waitForOk() after mac save.
jpmeijers Jun 14, 2017
4500ae7
Enable saveState for RN2903AS.
jpmeijers Jun 14, 2017
3885b99
Update TheThingsNetwork.cpp
jpmeijers Jun 14, 2017
c850955
Merge pull request #211 from TheThingsNetwork/fix/208+209-mac-save-ok
johanstokking Jun 16, 2017
c63f0d0
Merge pull request #199 from TheThingsNetwork/asian-frequency-plans
johanstokking Jun 16, 2017
82d5f04
update CayenneLPP docs link
asanchezdelc Jun 23, 2017
29a21a5
fix correct doc name
asanchezdelc Jun 29, 2017
ab36f4d
Merge pull request #218 from asanchezdelc/cayenne-lpp-docs
johanstokking Jul 5, 2017
e553d4f
Update TheThingsNetwork.cpp
alexbn71 Jul 17, 2017
adc4111
Fix sleep time overflow
johanstokking Jul 17, 2017
4851006
Update TheThingsNetwork.cpp
alexbn71 Jul 17, 2017
eccecc8
Update TheThingsNetwork.cpp
alexbn71 Jul 17, 2017
3c38c7b
Merge pull request #223 from alexbn71/patch-1
johanstokking Jul 17, 2017
ca07cad
Merge pull request #224 from TheThingsNetwork/fix/sleep-overflow
johanstokking Jul 17, 2017
bb7b711
Version bump
johanstokking Jul 17, 2017
bbbb21f
Update TheThingsNetwork.h
alexbn71 Jul 17, 2017
ce75a98
Update TheThingsNetwork.cpp
alexbn71 Jul 17, 2017
3d8046a
Update TheThingsNetwork.h
alexbn71 Jul 17, 2017
d2f4c0a
Update TheThingsNetwork.cpp
alexbn71 Jul 17, 2017
55cfe47
Update AUTHORS
alexbn71 Jul 18, 2017
bc2cb7c
Update TheThingsNetwork.h
alexbn71 Jul 18, 2017
4268ff5
Update TheThingsNetwork.cpp
alexbn71 Jul 18, 2017
e97ce70
Update TheThingsNetwork.cpp
alexbn71 Jul 18, 2017
26eac60
Update TheThingsNetwork.cpp
alexbn71 Jul 18, 2017
18f58e8
Merge pull request #225 from alexbn71/patch-2
johanstokking Jul 18, 2017
4f20df9
Version bump
johanstokking Jul 18, 2017
2ba14f7
Merge branch 'master' into patch-4
alexbn71 Jul 18, 2017
879f6b3
Update TheThingsNetwork.cpp
alexbn71 Jul 25, 2017
4fad92b
Update TheThingsNetwork.h
alexbn71 Jul 25, 2017
63c8b39
Update TheThingsNetwork.md
alexbn71 Jul 25, 2017
5ddd44e
Update TheThingsNetwork.md
alexbn71 Jul 25, 2017
e035522
Update TheThingsNetwork.md
alexbn71 Jul 25, 2017
24fe75f
Merge pull request #226 from alexbn71/patch-4
johanstokking Jul 26, 2017
66ec733
Version bump
johanstokking Jul 26, 2017
9c166b4
Use correct separator in keywords.txt
per1234 Sep 3, 2017
bd42c2c
Merge pull request #227 from per1234/keyword-separator
johanstokking Sep 5, 2017
f5e96e5
added getVDD()
hallard Feb 21, 2018
ff29f15
added GetVDD
hallard Feb 21, 2018
db593ca
Merge pull request #229 from ch2i/master
johanstokking Feb 22, 2018
89a4aa1
Bump version to 2.5.7
johanstokking Feb 22, 2018
00289ea
Added getVDD()
hallard Mar 1, 2018
20d6964
Merge pull request #230 from ch2i/master
johanstokking Mar 1, 2018
1f73b8b
Support for IN865_867
akshaim Mar 31, 2018
8215b19
Indentation and comment updated
akshaim Apr 2, 2018
d3ccab2
Channels debugged
akshaim Apr 13, 2018
1417926
Indentation fix
jpmeijers Apr 17, 2018
15e7905
Switch formatting to match other
jpmeijers Apr 17, 2018
62c2980
Small formatting change
jpmeijers Apr 17, 2018
4d5054b
Removed Case Statements and updated duty cycle
akshaim Apr 24, 2018
c0da9b8
Add AU915 frequency plan support
johanstokking Apr 30, 2018
04e2a33
Add RN2903 programming docs and AU915 firmware
johanstokking Apr 30, 2018
98485a4
Merge pull request #235 from TheThingsNetwork/feature/au915
johanstokking May 3, 2018
3a01327
Merge pull request #233 from akshaim/master
johanstokking May 16, 2018
ee86cc8
Fix AU915 uplink DR
johanstokking Jun 29, 2018
ca4e08c
Merge pull request #237 from TheThingsNetwork/fix/236-au915-tx-dr
johanstokking Jun 29, 2018
f4795e9
Bump version
johanstokking Jun 29, 2018
d311777
Use a single tab field separator in keywords.txt
per1234 Jul 15, 2018
dd65459
Merge pull request #238 from per1234/keywords_txt-multiple-tabs
johanstokking Jul 19, 2018
b870e34
Fix example URLs in TheThingsNetwork documentation
cimm Jul 17, 2018
edf1e67
Revert relative paths in documentation
cimm Jul 19, 2018
cadc405
Merge pull request #240 from cimm/fix-thethingsmessage-doc-urls
johanstokking Jul 19, 2018
23c933f
Bump version
johanstokking Jul 19, 2018
fa0664c
Fix for compiling on ESP32
jstrobel Aug 11, 2018
80a517f
Merge pull request #243 from jstrobel/master
johanstokking Aug 14, 2018
b9a912c
Bump version
johanstokking Aug 14, 2018
b967fc4
Fix regression for Arduino SAMD boards
AmedeeBulle Oct 29, 2018
70b3648
Merge pull request #246 from AmedeeBulle/master
johanstokking Nov 3, 2018
f1e49d8
Bump version
johanstokking Nov 3, 2018
5c93155
Enhanced documentation for linkCheck()
avbentem Nov 23, 2018
be30091
Merge pull request #247 from avbentem/patch-2
johanstokking Nov 26, 2018
389ab70
Hard reset indicator and functionality
savnik Jan 14, 2019
4d9ad69
Bump version
johanstokking Jan 14, 2019
1c96acb
Avoid compiler warning
AmedeeBulle Jan 20, 2019
e355cb7
Fix links to Uno and Node
rgm3 Jan 21, 2019
de491dd
Merge pull request #251 from rgm3/readme-links
johanstokking Jan 22, 2019
3f26b73
Typo
rgm3 Jan 22, 2019
4fd56ee
Merge pull request #252 from rgm3/master
johanstokking Jan 22, 2019
e36667f
Bump version
johanstokking Jan 22, 2019
f584dfd
Remove unused variable
AmedeeBulle Jan 26, 2019
3164696
Merge pull request #250 from AmedeeBulle/master
johanstokking Jan 27, 2019
9f4b4fb
Fix failed attempts condition
frankleonrose Jun 17, 2019
e8db3d9
Merge pull request #256 from Teralytic/fix-readline-attempts
johanstokking Jun 18, 2019
629e613
Bump version
johanstokking Jun 18, 2019
332fde3
pb.h should be included from the local directory
jpmeijers Jul 14, 2019
e3115cc
Merge pull request #258 from TheThingsNetwork/bug/pb_global_includes
johanstokking Jul 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 32 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
language: python
python:
- "2.7"

# Cache PlatformIO packages using Travis CI container-based infrastructure
sudo: false
cache:
directories:
- "~/.platformio"

language: c
env:
- PLATFORMIO_CI_SRC=test/TheThingsNetwork.ino
- PLATFORMIO_CI_SRC=test/TheThingsMessage.ino

- ARDUINO_VERSION=1.6.13
before_install:
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
- sleep 3
- export DISPLAY=:1.0
- wget http://downloads.arduino.cc/arduino-$ARDUINO_VERSION-linux64.tar.xz
- tar xf arduino-$ARDUINO_VERSION-linux64.tar.xz
- sudo mv arduino-$ARDUINO_VERSION /usr/local/share/arduino
- sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino
install:
- pip install -U platformio

- ln -s $PWD /usr/local/share/arduino/libraries/TheThingsNetwork
- arduino --install-library "DHT sensor library:1.3.0,Adafruit Unified Sensor:1.0.2"
before_script:
# Replace placeholders with actual frequency plan (on Mac OS folow -i by '')
- find $PWD/examples -type f -name "*.ino" -exec sed -i 's/REPLACE_ME/TTN_FP_EU868/g' {} +
script:
# - platformio ci --lib=src --board=leonardo --board=sparkfun_promicro8
- "echo \"Warning: no test specified\" && exit 0"
- test/verify arduino:avr:leonardo examples/SendABP/SendABP.ino
- test/verify arduino:avr:leonardo examples/DeviceInfo/DeviceInfo.ino
- test/verify arduino:avr:leonardo examples/TheThingsMessage/Receive/Receive.ino
- test/verify arduino:avr:leonardo examples/TheThingsMessage/Send/Send.ino
- test/verify arduino:avr:leonardo examples/PassThrough/PassThrough.ino
- test/verify arduino:avr:leonardo examples/QuickStart/QuickStart.ino
- test/verify arduino:avr:leonardo examples/Receive/Receive.ino
- test/verify arduino:avr:leonardo examples/SendOTAA/SendOTAA.ino
- test/verify arduino:avr:leonardo examples/Sensors/DHT/DHT.ino
- test/verify arduino:avr:leonardo examples/Sensors/LightSensor/LightSensor.ino
- test/verify arduino:avr:leonardo examples/Workshop/Workshop.ino
- test/verify arduino:avr:leonardo test/TheThingsMessage/TheThingsMessage.ino
- test/verify arduino:avr:leonardo test/TheThingsNetwork/TheThingsNetwork.ino
notifications:
email:
on_success: change
on_failure: change
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Johan Stokking <johan@thethingsnetwork.org>
Fokke Zandbergen <mail@fokkezb.nl>
Alessandro Blason <mrblason@gmail.com>
9 changes: 6 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Contributing

We'd ❤️ to welcome your contribution. Please make sure you:
We'd ❤️ to welcome your contribution. Please make sure your changes include:

1. Keep [keywords.txt](../keywords.txt) up to date with your changes.
2. Keep [API.md](../API.md) up to date with your changes.
1. Examples: [examples](examples)
2. Syntax highlighting: [keywords.txt](keywords.txt)
3. Documentation: [docs](docs)
4. Tests: [test](test)
5. Verification of the examples and tests: [.travis.yml](.travis.yml)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The Things Network Arduino Library
[![Build Status](https://travis-ci.org/TheThingsNetwork/arduino-device-lib.svg?branch=master)](https://travis-ci.org/TheThingsNetwork/arduino-device-lib)

This is an [Arduino Library](https://www.arduino.cc/en/Guide/Libraries) for Arduino-compatible devices like [The Things Uno](https://shop.thethingsnetwork.com/index.php/product/the-things-uno/) and [Node](https://shop.thethingsnetwork.com/index.php/product/the-things-node/) to communicate via [The Things Network](https://www.thethingsnetwork.org).
This is an [Arduino Library](https://www.arduino.cc/en/Guide/Libraries) for Arduino devices like [The Things Uno](https://www.thethingsnetwork.org/docs/devices/uno/) and [Node](https://www.thethingsnetwork.org/docs/devices/node/) to communicate via [The Things Network](https://www.thethingsnetwork.org).

> At the moment this library requires devices to feature a [Microchip RN2xx3 module](http://www.microchip.com/design-centers/wireless-connectivity/embedded-wireless/lora-technology).

Expand All @@ -12,7 +12,7 @@ This is an [Arduino Library](https://www.arduino.cc/en/Guide/Libraries) for Ardu

## Documentation

* [The Things Network Documentation / Arduino](https://www.thethingsnetwork.org/docs/arduino/)
* [The Things Network Documentation](https://www.thethingsnetwork.org/docs/devices/arduino/)
* API References:
* [TheThingsNetwork](docs/TheThingsNetwork.md)
* [TheThingsMessage](docs/TheThingsMessage.md)
Expand Down
84 changes: 84 additions & 0 deletions docs/CayenneLPP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# API Reference

The `CayenneLPP` class enables Arduino devices to encode data with the Cayenne Low Power Payload (LPP). [Read more about Cayenne LPP](https://mydevices.com/cayenne/docs/lora/#lora-cayenne-low-power-payload)

## Class: `CayenneLPP`

Include and instantiate the CayenneLPP class. The constructor takes the size of the allocated buffer. Depending on the LoRa frequency plan and data rate used, the maximum payload varies. It's safe to send up to 51 bytes of payload.

```c
#include <CayenneLPP.h>

CayenneLPP lpp(uint8_t size);
```

- `uint8_t size`: The maximum payload size to send, e.g. `51`.

## Example

```c
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
CayenneLPP lpp(51);

lpp.reset();
lpp.addTemperature(1, 22.5);
lpp.addBarometricPressure(2, 1073.21);
lpp.addGPS(3, 52.37365, 4.88650, 2);

ttn.sendBytes(lpp.getBuffer(), lpp.getSize());
```

See the [CayenneLPP](https://github.com/TheThingsNetwork/arduino-device-lib/blob/master/examples/CayenneLPP/CayenneLPP.ino) example.

## Method: `reset`

Resets the buffer.

```c
void reset(void);
```

## Method: `getSize`

Returns the size of the buffer.

```c
uint8_t getSize(void);
```

## Method: `getBuffer`

Returns a pointer to the buffer.

```c
uint8_t *getBuffer(void);
```

## Method: `copy`

Copies the internal buffer to a specified buffer and returns the copied size.

```c
uint8_t copy(uint8_t *buffer);
```

## Methods: `add...`

Add data to the buffer. The `channel` parameter acts as a key for the data field. The data fields you send are dynamic; you can selectively send data as long as the channel matches.

```c
uint8_t addDigitalInput(uint8_t channel, uint8_t value);
uint8_t addDigitalOutput(uint8_t channel, uint8_t value);

uint8_t addAnalogInput(uint8_t channel, float value);
uint8_t addAnalogOutput(uint8_t channel, float value);

uint8_t addLuminosity(uint8_t channel, uint16_t lux);
uint8_t addPresence(uint8_t channel, uint8_t value);
uint8_t addTemperature(uint8_t channel, float celsius);
uint8_t addRelativeHumidity(uint8_t channel, float rh);
uint8_t addAccelerometer(uint8_t channel, float x, float y, float z);
uint8_t addBarometricPressure(uint8_t channel, float hpa);
uint8_t addGyrometer(uint8_t channel, float x, float y, float z);
uint8_t addGPS(uint8_t channel, float latitude, float longitude, float meters);
```
Binary file added docs/RN2903A-1.0.3-AU915.zip
Binary file not shown.
Binary file added docs/RN2903A-programming.docx
Binary file not shown.
Binary file added docs/RN2903A-uart-bootloader.docx
Binary file not shown.
43 changes: 32 additions & 11 deletions docs/TheThingsMessage.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# API Reference
The `TheThingsMessage` class provides structs for sensor and application data you can encode and decode as bytes.

## Class: TheThingsMessage
## Class: `TheThingsMessage`
The `TheThingsMessage` class provides structs for sensor and application data you can encode and decode as bytes.

```c
#include <TheThingsMessage.h>
```

## Type: sensordata_t
## Type: `devicedata_t`

Create a struct of this type using `api_SensorData_init_default` as defaults.
Create a struct of this type using `api_DeviceData_init_default` as defaults.

```c
sensordata_t data = api_SensorData_init_default;
devicedata_t data = api_DeviceData_init_default;
```

Then in your `setup()` function select what fields of the struct should be included when encoding it as bytes:
Expand Down Expand Up @@ -41,21 +41,42 @@ You can also add other analog readings.

> **TODO:** Document how this works and include in example.

## Method: encodeSensorData
## Method: `encodeDeviceData`

Encode the message you want to send.

```c
static void encodeSensorData(sensordata_t *data, byte **buffer, size_t *size);
static void encodeDeviceData(devicedata_t *data, byte **buffer, size_t *size);
```

- `sensordata_t *data`: Structure containing all the message we can send.
- `const byte **buffer`: Bytes received.
- `size_t *size`: The number of bytes.
- `devicedata_t *data`: Structure containing typical fields that devices send.
- `byte **buffer`: Bytes to send.
- `size_t *size`: The number of bytes to send.

Usage:

```c
byte *buffer;
size_t size;
TheThingsMessage::encodeSensorData(&data, &buffer, &size);
TheThingsMessage::encodeDeviceData(&data, &buffer, &size);
```

## Method: `decodeAppData`

Decode the message you received.

```c
static bool decodeAppData(appdata_t *receiveData, const byte *payload, size_t length);
```

- `appdata_t *receiveData`: Structure containing all the message we can interpret.
- `const byte *payload`: Bytes received.
- `size_t *length`: The number of bytes.

Usage:

```c
const byte *payload;
size_t length;
TheThingsMessage::decodeAppData(&receiveData, payload, length);
```
Loading