Skip to content

Commit

Permalink
openbeacon: fixed nick broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
schneider42 committed Dec 22, 2011
1 parent cf639ee commit 8e26d2b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions firmware/funk/openbeacon.c
Expand Up @@ -88,7 +88,7 @@ static void openbeaconSendPacket(uint32_t id, uint32_t seq,
i = (getRandom()&0xfff)+1;
while(i--);

static uint32_t n = 0;
static uint32_t n = 123;
if( --n == 0 ){
n = 123;
proto = 0x23; //Nick name
Expand All @@ -111,6 +111,9 @@ static void openbeaconSendPacket(uint32_t id, uint32_t seq,
nrf_snd_pkt_crc_encr(16,buf,NULL);
#endif
}else{
if( strlen(GLOBAL(nickname)) > 8 )
buf[1] = 0x24;
nrf_set_strength(3);
uint32touint8p(id, buf+2);
memcpy(buf+6, GLOBAL(nickname), 8);
#if ENCRYPT_OPENBEACON
Expand All @@ -120,7 +123,7 @@ static void openbeaconSendPacket(uint32_t id, uint32_t seq,
#endif
if( strlen(GLOBAL(nickname)) < 9 )
return;
buf[1]=0x24;
buf[1]=0x25;
memcpy(buf+6, GLOBAL(nickname)+8, 8);
#if ENCRYPT_OPENBEACON
nrf_snd_pkt_crc_encr(16,buf,openbeaconkey);
Expand Down

0 comments on commit 8e26d2b

Please sign in to comment.