Created
August 16, 2021 19:09
-
-
Save IonianIronist/132e913960eb4e307ee27088ea47414e to your computer and use it in GitHub Desktop.
rss at command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint8_t rss() { | |
uint8_t atCmd[] = {'D', 'B'}, respLen, *resp, dBm; | |
AtCommandRequest atCmdReq; | |
AtCommandResponse atResp; | |
atCmdReq = AtCommandRequest(atCmd); | |
xbee.send(atCmdReq); | |
if (xbee.readPacket(10)) { | |
if (xbee.getResponse().getApiId() == AT_COMMAND_RESPONSE) { | |
xbee.getResponse().getAtCommandResponse(atResp); | |
if (atResp.isOk()) { | |
respLen = atResp.getValueLength(); | |
if (respLen == 1) { | |
resp = atResp.getValue(); | |
dBm = resp[0]; | |
return dBm; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment