MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / APTask

Function APTask

ESP32_AP-Flasher/src/serialap.cpp:910–1110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

908}
909
910void APTask(void* parameter) {
911 if (!checkRadio()) {
912 // no radio
913 Serial.println("Working without radio.");
914 addFadeMono(config.led);
915 setAPstate(true, AP_STATE_NORADIO);
916 refreshAllPending();
917 vTaskDelete(NULL);
918 return;
919 }
920
921 xTaskCreate(rxCmdProcessor, "rxCmdProcessor", 6000, NULL, 15, NULL);
922#if defined(FLASHER_DEBUG_RXD) && !defined(FLASHER_DEBUG_SHARED)
923 xTaskCreate(rxSerialTask2, "rxSerialTask2", 1850, NULL, 2, NULL);
924 vTaskDelay(500 / portTICK_PERIOD_MS);
925#endif
926 bringAPOnline();
927
928#ifndef C6_OTA_FLASHING
929 if (checkForcedAPFlash() && FLASHER_AP_MOSI != -1) {
930 if (apInfo.type == SOLUM_SEG_UK && apInfo.isOnline) {
931 notifySegmentedFlash();
932 }
933 Serial.printf("We're going to try to perform an 'AP forced flash' in\r\n");
934 flashCountDown(10);
935 Serial.printf("\r\nPerforming force flash of the AP\r\n");
936 setAPstate(false, AP_STATE_FLASHING);
937 doForcedAPFlash();
938 checkWaitPowerCycle();
939 bringAPOnline();
940 }
941#endif
942
943 if (apInfo.isOnline) {
944 // AP works!
945 ShowAPInfo();
946
947 if (apInfo.type == SOLUM_SEG_UK) {
948 setAPstate(true, AP_STATE_COMING_ONLINE);
949 segmentedShowIp();
950 showAPSegmentedInfo(apInfo.mac, true);
951 setAPstate(true, AP_STATE_ONLINE);
952 updateContent(apInfo.mac);
953 }
954
955 uint16_t fsversion;
956#ifndef C6_OTA_FLASHING
957 if (FLASHER_AP_MOSI != -1) {
958 fsversion = getAPUpdateVersion(apInfo.type);
959 if ((fsversion) && (apInfo.version != fsversion)) {
960 Serial.printf("Firmware version on FS: %04X\r\n", fsversion);
961
962 Serial.printf("We're going to try to update the AP's FW in\r\n");
963 flashCountDown(30);
964 Serial.printf("\r\n");
965 notifySegmentedFlash();
966 setAPstate(false, AP_STATE_FLASHING);
967 if (doAPUpdate(apInfo.type)) {

Callers

nothing calls this directly

Calls 15

checkRadioFunction · 0.85
setAPstateFunction · 0.85
refreshAllPendingFunction · 0.85
bringAPOnlineFunction · 0.85
checkForcedAPFlashFunction · 0.85
notifySegmentedFlashFunction · 0.85
doForcedAPFlashFunction · 0.85
checkWaitPowerCycleFunction · 0.85
ShowAPInfoFunction · 0.85
segmentedShowIpFunction · 0.85
showAPSegmentedInfoFunction · 0.85
updateContentFunction · 0.85

Tested by

no test coverage detected