src/lmic/lmic_eu_like.c
// assumes that LMICeulike_canMapChannels passed. Return true if this would
// be a valid final configuration.
// chpage is 0 or 0x60; 0x60 turns all on; 0 selects channels 0..15 via mask.
// Assumes canMapChannels has already approved this change.
assumes that LMICeulike_canMapChannels passed. Return true if this would
be a valid final configuration.
chpage is 0 or 0x60; 0x60 turns all on; 0 selects channels 0..15 via mask.
Assumes canMapChannels has already approved this change.
assumes that LMICeulike_canMapChannels passed . Return true if this would be a valid final configuration . chpage is 0 or 0x60 ; 0x60 turns all on ; 0 selects channels 0 .. 15 via mask . Assumes canMapChannels has already approved this change .
bit_t LMICeulike_mapChannels(u1_t chpage, u2_t chmap) {
    switch (chpage) {
        case MCMD_LinkADRReq_ChMaskCntl_EULIKE_DIRECT:
            LMIC.channelMap = chmap;
            break;
        case MCMD_LinkADRReq_ChMaskCntl_EULIKE_ALL_ON: {
            u2_t new_chmap = 0;
            for (u1_t chnl = 0; chnl<MAX_CHANNELS; chnl++) {
                    if ((LMIC.channelFreq[chnl]&~3) != 0) {
                        new_chmap |= (1 << chnl);
                    }
            }
            LMIC.channelMap = new_chmap;
            break;
        }
        default:
            break;
    }
    return LMIC.channelMap != 0;
}
bit_t LMICeulike_mapChannels ( u1_t chpage , u2_t chmap ) { switch ( chpage ) { case MCMD_LinkADRReq_ChMaskCntl_EULIKE_DIRECT : LMIC . channelMap = chmap ; break ; case MCMD_LinkADRReq_ChMaskCntl_EULIKE_ALL_ON : { u2_t new_chmap = 0 ; for ( u1_t chnl = 0 ; chnl < MAX_CHANNELS ; chnl ++ ) { if ( ( LMIC . channelFreq [ chnl ] & ~ 3 ) != 0 ) { new_chmap |= ( 1 << chnl ) ; } } LMIC . channelMap = new_chmap ; break ; } default : break ; } return LMIC . channelMap != 0 ; }
assumes that LMICeulike_canMapChannels passed.
assumes that LMICeulike_canMapChannels passed .
// do nothing.