| 908 | } |
| 909 | |
| 910 | void 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)) { |
nothing calls this directly
no test coverage detected