Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ABP/ABPNode.cpp@3:63ac55b3514a, 2016-06-30 (annotated)
- Committer:
- sillevl
- Date:
- Thu Jun 30 19:39:40 2016 +0000
- Revision:
- 3:63ac55b3514a
add ABP Node class
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| sillevl | 3:63ac55b3514a | 1 | /* The MIT License (MIT) |
| sillevl | 3:63ac55b3514a | 2 | * |
| sillevl | 3:63ac55b3514a | 3 | * Copyright (c) 2016 Sille Van Landschoot |
| sillevl | 3:63ac55b3514a | 4 | * |
| sillevl | 3:63ac55b3514a | 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| sillevl | 3:63ac55b3514a | 6 | * of this software and associated documentation files (the "Software"), to deal |
| sillevl | 3:63ac55b3514a | 7 | * in the Software without restriction, including without limitation the rights |
| sillevl | 3:63ac55b3514a | 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| sillevl | 3:63ac55b3514a | 9 | * copies of the Software, and to permit persons to whom the Software is |
| sillevl | 3:63ac55b3514a | 10 | * furnished to do so, subject to the following conditions: |
| sillevl | 3:63ac55b3514a | 11 | * |
| sillevl | 3:63ac55b3514a | 12 | * The above copyright notice and this permission notice shall be included in all |
| sillevl | 3:63ac55b3514a | 13 | * copies or substantial portions of the Software. |
| sillevl | 3:63ac55b3514a | 14 | * |
| sillevl | 3:63ac55b3514a | 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| sillevl | 3:63ac55b3514a | 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| sillevl | 3:63ac55b3514a | 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| sillevl | 3:63ac55b3514a | 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| sillevl | 3:63ac55b3514a | 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| sillevl | 3:63ac55b3514a | 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| sillevl | 3:63ac55b3514a | 21 | * SOFTWARE. |
| sillevl | 3:63ac55b3514a | 22 | */ |
| sillevl | 3:63ac55b3514a | 23 | |
| sillevl | 3:63ac55b3514a | 24 | |
| sillevl | 3:63ac55b3514a | 25 | #include "ABPNode.h" |
| sillevl | 3:63ac55b3514a | 26 | |
| sillevl | 3:63ac55b3514a | 27 | namespace SimpleLoRaWAN |
| sillevl | 3:63ac55b3514a | 28 | { |
| sillevl | 3:63ac55b3514a | 29 | |
| sillevl | 3:63ac55b3514a | 30 | namespace ABP |
| sillevl | 3:63ac55b3514a | 31 | { |
| sillevl | 3:63ac55b3514a | 32 | |
| sillevl | 3:63ac55b3514a | 33 | Node::Node(uint32_t _dev_addr, uint8_t _nwks_key[], uint8_t _app_key[]) : SimpleLoRaWAN::Node() |
| sillevl | 3:63ac55b3514a | 34 | { |
| sillevl | 3:63ac55b3514a | 35 | LMIC_setSession (0x1, _dev_addr, _nwks_key, _app_key); // 1st argument: net_id |
| sillevl | 3:63ac55b3514a | 36 | //while(LMIC.devaddr == 0){ |
| sillevl | 3:63ac55b3514a | 37 | process(); |
| sillevl | 3:63ac55b3514a | 38 | //}; |
| sillevl | 3:63ac55b3514a | 39 | } |
| sillevl | 3:63ac55b3514a | 40 | |
| sillevl | 3:63ac55b3514a | 41 | Node::~Node() |
| sillevl | 3:63ac55b3514a | 42 | { |
| sillevl | 3:63ac55b3514a | 43 | |
| sillevl | 3:63ac55b3514a | 44 | } |
| sillevl | 3:63ac55b3514a | 45 | |
| sillevl | 3:63ac55b3514a | 46 | } |
| sillevl | 3:63ac55b3514a | 47 | |
| sillevl | 3:63ac55b3514a | 48 | } |