Skip to content

Commit

Permalink
Merge pull request #24 from janjongboom/class-switcheroo
Browse files Browse the repository at this point in the history
Add LoRaWAN Class C handling
  • Loading branch information
janjongboom committed Dec 12, 2018
2 parents 4f9fafb + a739df5 commit f291d20
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions mbed-simulator-hal/lora-radio-drv/SX1276_LoRaRadio.cpp
Expand Up @@ -653,12 +653,11 @@ void SX1276_LoRaRadio::receive()

_rf_settings.lora_packet_handler.pending = false;

if (delta_ms > 1000) {
tr_warn("receive delta was over 1000 ms (was %u ms), discarding packet", delta_ms);
return;
}
// if (delta_ms > 1000) {
// tr_warn("receive delta was over 1000 ms (was %u ms), discarding packet", delta_ms);
// return;
// }

// after 200 ms. we send the rx_done event
rx_done_irq();
return;
}
Expand Down
2 changes: 1 addition & 1 deletion mbed-simulator-hal/mbed-os.lib
@@ -1 +1 @@
https://github.com/janjongboom/mbed-os/#0ff2a5bdc69f9c86f992604eb5402f037799a060
https://github.com/janjongboom/mbed-os/#52d5c308399ec140f4d7cf44bf19f388d59a0e9d
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "mbed-simulator",
"version": "1.7.1",
"version": "1.8.0",
"description": "Mbed OS 5 simulator",
"preferGlobal": true,
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions server/launch-server.js
Expand Up @@ -16,8 +16,8 @@ const timesyncServer = require('timesync/server');
const version = JSON.parse(fs.readFileSync(Path.join(__dirname, '..', 'package.json'), 'utf-8')).version;
const compression = require('compression');

const LORA_PORT = 1700;
const LORA_HOST = 'router.eu.thethings.network';
const LORA_PORT = process.env.LORA_PORT || 1700;
const LORA_HOST = process.env.LORA_HOST || 'router.eu.thethings.network';

let startupTs = Date.now();

Expand Down
2 changes: 1 addition & 1 deletion viewer/js-hal/lora.js
Expand Up @@ -51,7 +51,7 @@ window.MbedJSHal.lora = (function() {
// when to send?
var timeOnAir = calculateTimeOnAir(buffer.length, ev.datarate, ev.bandwidth);
var delay = ev.sendTs - ts.now() + timeOnAir;
// console.log('send delay is', delay);
console.log('lora RX send delay is', delay);

function go() {
console.log(/*Date.now(), */'handle_lora_downlink', 'dataLength', buffer.length, 'freq', ev.freq, 'bandwidth', ev.bandwidth, 'datarate', ev.datarate);
Expand Down

0 comments on commit f291d20

Please sign in to comment.