src/lmic/lmic_us_like.c
// US does not have duty cycling - return now as earliest TX time
// but also do the channel hopping dance.
US does not have duty cycling - return now as earliest TX time
but also do the channel hopping dance.
US does not have duty cycling - return now as earliest TX time but also do the channel hopping dance .
ostime_t LMICuslike_nextTx(ostime_t now) {
        if (LMIC.datarate >= LMICuslike_getFirst500kHzDR()) { 
                if (LMIC.activeChannels500khz > 0) {
                        setNextChannel(64, 64 + 8, LMIC.activeChannels500khz);
                } else if (LMIC.activeChannels125khz > 0) {
                        LMIC.datarate = lowerDR(LMICuslike_getFirst500kHzDR(), 1);
                        setNextChannel(0, 64, LMIC.activeChannels125khz);
                        LMICOS_logEvent("LMICuslike_nextTx: no 500k, choose 125k");
                } else {
                        LMICOS_logEvent("LMICuslike_nextTx: no channels at all (500)");
                }
        }
        else { 
                if (LMIC.activeChannels125khz > 0) {
                        setNextChannel(0, 64, LMIC.activeChannels125khz);
                } else if (LMIC.activeChannels500khz > 0) {
                        LMIC.datarate = LMICuslike_getFirst500kHzDR();
                        setNextChannel(64, 64 + 8, LMIC.activeChannels500khz);
                        LMICOS_logEvent("LMICuslike_nextTx: no 125k, choose 500k");
                } else {
                        LMICOS_logEvent("LMICuslike_nextTx: no channels at all (125)");
                }
        }
        return now;
}
ostime_t LMICuslike_nextTx ( ostime_t now ) { if ( LMIC . datarate >= LMICuslike_getFirst500kHzDR ( ) ) { if ( LMIC . activeChannels500khz > 0 ) { setNextChannel ( 64 , 64 + 8 , LMIC . activeChannels500khz ) ; } else if ( LMIC . activeChannels125khz > 0 ) { LMIC . datarate = lowerDR ( LMICuslike_getFirst500kHzDR ( ) , 1 ) ; setNextChannel ( 0 , 64 , LMIC . activeChannels125khz ) ; LMICOS_logEvent ( " " ) ; } else { LMICOS_logEvent ( " " ) ; } } else { if ( LMIC . activeChannels125khz > 0 ) { setNextChannel ( 0 , 64 , LMIC . activeChannels125khz ) ; } else if ( LMIC . activeChannels500khz > 0 ) { LMIC . datarate = LMICuslike_getFirst500kHzDR ( ) ; setNextChannel ( 64 , 64 + 8 , LMIC . activeChannels500khz ) ; LMICOS_logEvent ( " " ) ; } else { LMICOS_logEvent ( " " ) ; } } return now ; }
US does not have duty cycling - return now as earliest TX time
but also do the channel hopping dance.
US does not have duty cycling - return now as earliest TX time but also do the channel hopping dance .
// TODO(tmm@mcci.com): use a static const for US-like // 500kHz // 125kHz