Send OpenBeacon (if privacy allows)

This commit is contained in:
Stefan `Sec` Zehl 2011-08-03 00:23:31 +02:00
parent f176bed03f
commit 69907e7d16
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
#include <sysinit.h>
#include "basic/basic.h"
#include "basic/byteorder.h"
#include "basic/config.h"
#include "funk/nrf24l01p.h"
#include "funk/openbeacon.h"
#define B_INTERVAL 100
/**************************************************************************/
void do_openbeacon(){
openbeaconSend();
}
void init_beacon(void){
nrf_init();
openbeaconSetup();
};
void tick_beacon(void){
static int beaconctr=0;
if(GLOBAL(privacy)>0)
return;
if(beaconctr--<0){
push_queue(&do_openbeacon);
beaconctr=B_INTERVAL/SYSTICKSPEED/2;
beaconctr+=getRandom()%(beaconctr*2);
};
};