Slave Implementation of WANOT Slave

Dependencies:   SX1276Lib mbed-src

main.cpp

Committer:
semsem
Date:
2016-05-23
Revision:
0:80ebf9b1dd4f

File content as of revision 0:80ebf9b1dd4f:

#include"WANOT.h"

/*
 *  Global variables declarations
 */

/*!
 * Radio events function pointer
 */
RadioEvents_t RadioEvents;

/*
 *  Global variables declarations
 */
SX1276MB1xAS Radio(NULL);

extern SuperSlotStates SuperSlotState;


int main()
{

    // verify the connection with the board
    while (Radio.Read(REG_VERSION) == 0x00) {
        debug("Radio could not be detected!\n\r\r", NULL);
        wait(1);
    }
    debug("WANOT Slave Started...\n\r");

    char StoreRead[50];
    GPS_Read(StoreRead);

    SuperSlotInit();

    while(1)    {
        switch(SuperSlotState) {
            case SetUp_Beacon_Phase:
                SetUp_Beacon();
                break;

            case SetUp_Phase:
                SlaveSetUp();
                break;

            case TDMA_Phase:
                SlaveTDMA();
                break;
        }
    }

}