An attempt to sleep an mDot

Dependencies:   libmDot-mbed5

Fork of mDot_helloworld_bk by Brendan Kelly

main.cpp

Committer:
kellybs1
Date:
2017-08-09
Revision:
3:706cdd7ce1b2
Parent:
2:9682d754c902
Child:
4:0c96c67d914b

File content as of revision 3:706cdd7ce1b2:


#include "mbed.h"
#include "mDot.h"
#include "ChannelPlans.h"
#include "MTSLog.h"

int main() {
    // use AU915 plan
    lora::ChannelPlan* plan = new lora::ChannelPlan_AU915();
    assert(plan);
    // get a mDot handle
    mDot* dot = mDot::getInstance(plan);
    assert(dot);
    
    // print the message 
    logInfo("Hello world! I am an mDot");
    
    // go to sleep and wake up automatically sleep_time seconds later
    uint32_t sleep_time = 5;
    dot->sleep(sleep_time, mDot::RTC_ALARM);
}