Skip to content

Commit

Permalink
changed receiver address to be different from sender, related to #17
Browse files Browse the repository at this point in the history
  • Loading branch information
paidforby committed Sep 21, 2020
1 parent 46b7398 commit 349341f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/receiver/src/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#define LED 25
#define TX_POWER 20

char MAC[9] = "c0d3f00d";
uint8_t LOCAL_ADDRESS[ADDR_LENGTH] = {0xc0, 0xd3, 0xf0, 0x0d};
char MAC[9] = "c0d3cafe";
uint8_t LOCAL_ADDRESS[ADDR_LENGTH] = {0xc0, 0xd3, 0xca, 0xfe};
// GATEWAY is the receiver
uint8_t GATEWAY[ADDR_LENGTH] = {0xc0, 0xd3, 0xf0, 0x0c};
uint8_t SENDER[ADDR_LENGTH] = {0xc0, 0xd3, 0xf0, 0x0d};

Layer1Class *Layer1;
LL2Class *LL2;
Expand Down
5 changes: 2 additions & 3 deletions examples/sender/src/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

char MAC[9] = "c0d3f00d";
uint8_t LOCAL_ADDRESS[ADDR_LENGTH] = {0xc0, 0xd3, 0xf0, 0x0d};
// GATEWAY is the receiver
uint8_t GATEWAY[ADDR_LENGTH] = {0xc0, 0xd3, 0xf0, 0x0c};
uint8_t RECEIVER[ADDR_LENGTH] = {0xc0, 0xd3, 0xca, 0xfe};

Layer1Class *Layer1;
LL2Class *LL2;
Expand Down Expand Up @@ -73,7 +72,7 @@ void loop() {
struct Datagram datagram;
if (Layer1Class::getTime() - lastTransmit >= 5000){
msglen = sprintf((char*)datagram.message, "%s,%i", "hello", counter);
memcpy(datagram.destination, BROADCAST, ADDR_LENGTH);
memcpy(datagram.destination, RECEIVER, ADDR_LENGTH);
datagram.type = 's'; // can be anything, but 's' for 'sensor'

datagramsize = msglen + DATAGRAM_HEADER;
Expand Down

0 comments on commit 349341f

Please sign in to comment.