I use two bladeRFs. On one I run bob and on another one I run alice.
I slightly modified the source code (added printf and changed bob's sleep time to two seconds) and I see that decoded packet id (pkt.id) is always null.
The code of modified bob.c is here: http://pastebin.com/A54y0Uj4
Changes of bob.c:
Code: Select all
pkt.prize = PRIZE_NONE;
printf("packet: id = %d, prn = %d\n", pkt.id, pkt.prn); //here
send_pkt(&pkt);
send_pkt(&pkt);
sleep(2); //and here
Changes:
Code: Select all
if (pkt.id == pkt_id && pkt.prn == pkt_prn) {
/* Enforce 5 minutes between victories */
if (victory_time + 5 < time(NULL)) { //here
pkt_id++;
pkt_prn = rand();
Here is an example of alice.c output.
Code: Select all
First symbol of the first long synchronization pulse
len: 0
raw:
Manchester:
Demanchester. len = 0:
Grouped binary:
Grouped binary in hex:
good = 1
☻packet: id = 0, prn = -1217376256 | pkt_id = 0, pkt_prn = 269070388
First symbol of the first long synchronization pulse
len: 0
raw:
Manchester:
Demanchester. len = 0:
Grouped binary:
Grouped binary in hex:
good = 1
☻packet: id = 0, prn = -1217568768 | pkt_id = 0, pkt_prn = 269070388
First symbol of the first long synchronization pulse
len: 0
raw:
Manchester:
Demanchester. len = 0:
Grouped binary:
Grouped binary in hex:
good = 1
☻packet: id = 0, prn = -1217568768 | pkt_id = 0, pkt_prn = 269070388
What is going wrong?