| 320 | return false; |
| 321 | } |
| 322 | bool sendChannelPower(struct espSetChannelPower* scp) { |
| 323 | if (apInfo.state == AP_STATE_NORADIO) return true; |
| 324 | if ((apInfo.state != AP_STATE_ONLINE) && (apInfo.state != AP_STATE_COMING_ONLINE)) return false; |
| 325 | if (!txStart()) return false; |
| 326 | addCRC(scp, sizeof(struct espSetChannelPower)); |
| 327 | for (uint8_t attempt = 0; attempt < 5; attempt++) { |
| 328 | cmdReplyValue = CMD_REPLY_WAIT; |
| 329 | AP_SERIAL_PORT.print("SCP>"); |
| 330 | for (uint8_t c = 0; c < sizeof(struct espSetChannelPower); c++) { |
| 331 | AP_SERIAL_PORT.write(((uint8_t*)scp)[c]); |
| 332 | } |
| 333 | if (waitCmdReply()) { |
| 334 | txEnd(); |
| 335 | apInfo.channel = scp->channel; |
| 336 | apInfo.power = scp->power; |
| 337 | return true; |
| 338 | } |
| 339 | Serial.printf("SCP send failed in try %d\r\n", attempt); |
| 340 | } |
| 341 | Serial.print("SCP failed to send...\r\n"); |
| 342 | txEnd(); |
| 343 | return false; |
| 344 | } |
| 345 | bool sendPing() { |
| 346 | if (apInfo.state == AP_STATE_NORADIO) return true; |
| 347 | if (apInfo.state == AP_STATE_FLASHING) return false; |
no test coverage detected