src/lmic/lmic_eu_like.c
// check whether a map operation will work.
// chpage is 0 or 6; 6 turns all on; 0 selects channels 0..15 via mask.
// The spec is unclear as to whether we should veto a channel mask that enables
// a channel that hasn't been configured; we veto it.
check whether a map operation will work.
chpage is 0 or 6; 6 turns all on; 0 selects channels 0..15 via mask.
The spec is unclear as to whether we should veto a channel mask that enables
a channel that hasn't been configured; we veto it.
check whether a map operation will work . chpage is 0 or 6 ; 6 turns all on ; 0 selects channels 0 .. 15 via mask . The spec is unclear as to whether we should veto a channel mask that enables a channel that hasn ' t been configured ; we veto it .
bit_t LMICeulike_canMapChannels(u1_t chpage, u2_t chmap) {
    switch (chpage) {
        case MCMD_LinkADRReq_ChMaskCntl_EULIKE_DIRECT:
            for (u1_t chnl = 0; chnl<MAX_CHANNELS; chnl++) {
                    if ((chmap & (1 << chnl)) != 0 && (LMIC.channelFreq[chnl]&~3) == 0)
                            return 0; 
            }
            return 1;
        case MCMD_LinkADRReq_ChMaskCntl_EULIKE_ALL_ON:
            return 1;
        default:
            return 0;
    }
}
bit_t LMICeulike_canMapChannels ( u1_t chpage , u2_t chmap ) { switch ( chpage ) { case MCMD_LinkADRReq_ChMaskCntl_EULIKE_DIRECT : for ( u1_t chnl = 0 ; chnl < MAX_CHANNELS ; chnl ++ ) { if ( ( chmap & ( 1 << chnl ) ) != 0 && ( LMIC . channelFreq [ chnl ] & ~ 3 ) == 0 ) return 0 ; } return 1 ; case MCMD_LinkADRReq_ChMaskCntl_EULIKE_ALL_ON : return 1 ; default : return 0 ; } }
check whether a map operation will work.
check whether a map operation will work .
// we don't allow any channel to be turned on if its frequency is zero. // fail - channel is not defined