Skip to content

dropcontrol/ofxiBeacon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ofxiBeacon

openFrameworks addon for handling iBeacon.

Initialize

ofxiBeacon(const string &uuid, const string &serviceIndentifier, bool debug);

.h

class ofApp : public ofxiOSApp {

    public:
        ofxiBeacon iBeacon;
};

.mm

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.

methods

BeaconInfo updateBeaconInfo();

.h

class ofApp : public ofxiOSApp {

    public:
        BeaconInfo beaconInfo;
};

.mm

//--------------------------------------------------------------
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;
}

LICENSE

This software is released under the MIT License, see LICENSE.md

About

openFrameworks addon for handling iBeacon.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published