openFrameworks addon for handling iBeacon.
class ofApp : public ofxiOSApp {
public:
ofxiBeacon iBeacon;
};
void ofApp::setup(){
string uuid( "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" );
string serviceIndentifier ( "com.example.yourapp" );
ofxiBeadon();
iBeacon = ofxiBeacon(uuid, serviceIndentifier, true);
}
if debug is true, sending beacon info to LocalNotification.
class ofApp : public ofxiOSApp {
public:
BeaconInfo beaconInfo;
};
//--------------------------------------------------------------
void ofApp::update(){
beaconInfo = iBeacon.updateBeaconInfo();
string kind = beaconInfo.status;
string status = beaconInfo.status;
string uuid = beaconInfo.uuid;
int major = beaconInfo.major;
int minor = beaconInfo.minor;
double accuracy = beaconInfo.accuracy;
int rssi = beaconInfo.rssi;
}
This software is released under the MIT License, see LICENSE.md