From c8b4a07fafeaad34b28b22424b01f4c1d4b7576f Mon Sep 17 00:00:00 2001 From: jdenecha Date: Wed, 1 Mar 2017 12:48:22 +0100 Subject: [PATCH] first commit --- base64.o | Bin 0 -> 6128 bytes main.cpp | 9 +++++---- main.o | Bin 0 -> 11904 bytes single_chan_pkt_fwd | Bin 0 -> 21788 bytes 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 base64.o create mode 100644 main.o create mode 100755 single_chan_pkt_fwd diff --git a/base64.o b/base64.o new file mode 100644 index 0000000..2334e7c Binary files /dev/null and b/base64.o differ diff --git a/main.cpp b/main.cpp index c669f3f..4d8b83d 100644 --- a/main.cpp +++ b/main.cpp @@ -40,7 +40,7 @@ byte currentMode = 0x81; char message[256]; char b64[256]; -bool sx1272 = true; +bool sx1272 = false; byte receivedbytes; @@ -85,8 +85,8 @@ static char description[64] = ""; /* used for free form d // define servers // TODO: use host names and dns -#define SERVER1 "54.72.145.119" // The Things Network: croft.thethings.girovito.nl -//#define SERVER2 "192.168.1.10" // local +#define SERVER1 "127.0.0.1" // The Things Network: croft.thethings.girovito.nl +#define SERVER2 "192.168.42.106" // local #define PORT 1700 // The port on which to send data // ############################################# @@ -265,7 +265,7 @@ void SetupLoRa() sx1272 = false; } else { printf("Unrecognized transceiver.\n"); - //printf("Version: 0x%x\n",version); + printf("Version: 0x%x\n",version); exit(1); } } @@ -505,6 +505,7 @@ void receivepacket() { memcpy((void *)(buff_up + buff_index), (void *)",\"data\":\"", 9); buff_index += 9; j = bin_to_b64((uint8_t *)message, receivedbytes, (char *)(buff_up + buff_index), 341); + //j = snprintf((char *)(buff_up + buff_index), 341, "%02d ",(uint8_t *)message); buff_index += j; buff_up[buff_index] = '"'; ++buff_index; diff --git a/main.o b/main.o new file mode 100644 index 0000000..2239b47 Binary files /dev/null and b/main.o differ diff --git a/single_chan_pkt_fwd b/single_chan_pkt_fwd new file mode 100755 index 0000000..12df815 Binary files /dev/null and b/single_chan_pkt_fwd differ -- libgit2 0.21.2