Kai Ren / BluetoothWorld2018BeaconsClass

Dependencies:   microbit-iBeacon

Fork of BTW_ComboBeacon_Solution by KEN OGAMI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "MicroBit.h"
00002 
00003 /******************************************************
00004  *          Macros
00005  ******************************************************/
00006 // TODO: add ADV on and off flag
00007 
00008  
00009 /******************************************************
00010  *          Constants
00011  ******************************************************/
00012 // TODO: constants, used for iBeacon UUID(MSB first), Major, Minor and txpower setting
00013 
00014  
00015  /******************************************************
00016  *          Variables
00017  ******************************************************/
00018 //microbit object
00019 MicroBit uBit;
00020 //Initial USB-to-Serial, baud rate is 9600-8-N-1
00021 Serial pcCom(USBTX, USBRX);
00022 
00023 // TODO: global data and functions
00024 
00025 
00026 
00027 /******************************************************
00028  *          Functions
00029  ******************************************************/
00030 // TODO: functions, startAdvertising and stopAdvertising 
00031 
00032 
00033 // TODO: functions, used for ButtonA and ButtonB interrupt callbacks
00034 
00035 
00036 int main()
00037 {
00038     // Serial output after a reset
00039     pcCom.printf("mBit Beacon.\n\r");
00040 
00041     // Initialize the micro:bit runtime.
00042     uBit.init();
00043 
00044     // TODO: Register the interrupt and callback for ButtonA and ButtonB
00045     
00046     
00047     // TODO: First Advertisment, adv name only
00048  
00049     
00050     release_fiber();
00051 }