xref: /btstack/port/arduino/examples/iBeacon/iBeacon.ino (revision 8caefee39d444df6d8908a96a844825f10fbdaa4)
1*8caefee3SMatthias Ringwald#include <BTstack.h>
2*8caefee3SMatthias Ringwald#include <stdio.h>
3*8caefee3SMatthias Ringwald#include <SPI.h>
4*8caefee3SMatthias Ringwald
5*8caefee3SMatthias Ringwald/* EXAMPLE_START(iBeacon): iBeacon Simulator
6*8caefee3SMatthias Ringwald *
7*8caefee3SMatthias Ringwald * @section Setup
8*8caefee3SMatthias Ringwald *
9*8caefee3SMatthias Ringwald * @text After BTstack.setup(), iBeaconConfigure() configures BTstack
10*8caefee3SMatthias Ringwald * to send out iBeacons Advertisements with the provided Major ID,
11*8caefee3SMatthias Ringwald * Minor ID and UUID.
12*8caefee3SMatthias Ringwald */
13*8caefee3SMatthias Ringwald/* LISTING_START(iBeaconSetup): iBeacon Setup */
14*8caefee3SMatthias RingwaldUUID uuid("E2C56DB5-DFFB-48D2-B060-D0F5A71096E0");
15*8caefee3SMatthias Ringwaldvoid setup(void){
16*8caefee3SMatthias Ringwald    Serial.begin(9600);
17*8caefee3SMatthias Ringwald    BTstack.setup();
18*8caefee3SMatthias Ringwald    BTstack.iBeaconConfigure(&uuid, 4711, 2);
19*8caefee3SMatthias Ringwald    BTstack.startAdvertising();
20*8caefee3SMatthias Ringwald}
21*8caefee3SMatthias Ringwald/* LISTING_END(iBeaconSetup) */
22*8caefee3SMatthias Ringwald
23*8caefee3SMatthias Ringwaldvoid loop(void){
24*8caefee3SMatthias Ringwald    BTstack.loop();
25*8caefee3SMatthias Ringwald}
26