Xinyuan-LilyGO / LilyGO-T-SIM7000G

LilyGO T-SIM7000G
https://pt.aliexpress.com/item/4000542688096.html
284 stars 123 forks source link

Why assign a boolean to a string? #221

Open trixymoon opened 1 year ago

trixymoon commented 1 year ago

the instruction modem.setNetworkMode(2); at line https://github.com/Xinyuan-LilyGO/LilyGO-T-SIM7000G/blob/c163bb7a71e778d27053c550339a23bb8d7ebc03/examples/Arduino_TinyGSM/AllFunctions/AllFunctions.ino#L151 return a boolean

Just do:

if (!modem.setNetworkMode(2)) {
        DBG("setNetworkMode  false ");
        return ;
}

and it's the same for the instruction modem.setPreferredMode(3); at line https://github.com/Xinyuan-LilyGO/LilyGO-T-SIM7000G/blob/c163bb7a71e778d27053c550339a23bb8d7ebc03/examples/Arduino_TinyGSM/AllFunctions/AllFunctions.ino#L163

if (!modem.setPreferredMode(3)) {
        DBG("setPreferredMode  false ");
        return ;
}
gulliverrr commented 9 months ago

Duplicate of https://github.com/Xinyuan-LilyGO/LilyGO-T-SIM7000G/pull/119