kopia lustrzana https://github.com/pjalocha/esp32-ogn-tracker
Prepare for more regular WiFi code
rodzic
dff4f2e572
commit
5bccc189b5
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "proc.h"
|
||||
|
||||
#ifdef WITH_WIFI
|
||||
#ifdef WITH_APRS
|
||||
|
||||
#define DEBUG_PRINT
|
||||
|
||||
|
@ -205,7 +205,7 @@ int APRS_RxMsg(const char *Msg)
|
|||
return 0; }
|
||||
|
||||
extern "C"
|
||||
void vTaskWIFI(void* pvParameters)
|
||||
void vTaskAPRS(void* pvParameters)
|
||||
{ esp_err_t Err;
|
||||
vTaskDelay(1000);
|
||||
|
||||
|
@ -369,5 +369,5 @@ void vTaskWIFI(void* pvParameters)
|
|||
}
|
||||
}
|
||||
|
||||
#endif // WITH_WIFI
|
||||
#endif // WITH_APRS
|
||||
|
|
@ -6,5 +6,5 @@ bool APRS_isConnected(void);
|
|||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
void vTaskWIFI(void* pvParameters);
|
||||
void vTaskAPRS(void* pvParameters);
|
||||
|
|
@ -28,8 +28,8 @@
|
|||
#include "stratux.h"
|
||||
#endif
|
||||
|
||||
#ifdef WITH_WIFI
|
||||
#include "wifi.h" // WIFI task
|
||||
#ifdef WITH_APRS
|
||||
#include "aprs.h" // APRS task
|
||||
#endif
|
||||
|
||||
extern "C"
|
||||
|
@ -113,8 +113,8 @@ void app_main(void)
|
|||
#ifdef WITH_AERO
|
||||
xTaskCreate(vTaskAERO, "AERO", 2048, 0, tskIDLE_PRIORITY+3, 0);
|
||||
#endif
|
||||
#ifdef WITH_WIFI
|
||||
xTaskCreate(vTaskWIFI, "WIFI", 4096, 0, tskIDLE_PRIORITY+2, 0);
|
||||
#ifdef WITH_APRS
|
||||
xTaskCreate(vTaskAPRS, "APRS", 4096, 0, tskIDLE_PRIORITY+2, 0);
|
||||
#endif
|
||||
#ifdef WITH_STRATUX
|
||||
xTaskCreate(vTaskSTX, "STX", 4096, 0, tskIDLE_PRIORITY+3, 0);
|
||||
|
|
|
@ -117,7 +117,7 @@ class FlashParameters
|
|||
int8_t StratuxTxPwr;
|
||||
#endif
|
||||
|
||||
#ifdef WITH_WIFI
|
||||
#ifdef WITH_APRS
|
||||
static const uint8_t WIFInameLen = 32;
|
||||
static const uint8_t WIFIpassLen = 64;
|
||||
static const uint8_t WIFIsets = 10;
|
||||
|
@ -137,7 +137,7 @@ class FlashParameters
|
|||
|
||||
uint32_t CheckSum;
|
||||
|
||||
#ifdef WITH_WIFI
|
||||
#ifdef WITH_APRS
|
||||
const char *getWIFIpass(const char *NetName) const
|
||||
{ for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
||||
{ if(strcmp(NetName, WIFIname[Idx])==0) return WIFIpass[Idx]; }
|
||||
|
@ -247,7 +247,7 @@ class FlashParameters
|
|||
StratuxMinSig = -70; // [dBm]
|
||||
StratuxTxPwr = 40; // [0.25dBm]
|
||||
#endif
|
||||
#ifdef WITH_WIFI
|
||||
#ifdef WITH_APRS
|
||||
for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
||||
{ WIFIname[Idx][0] = 0;
|
||||
WIFIpass[Idx][0] = 0; }
|
||||
|
@ -590,7 +590,7 @@ class FlashParameters
|
|||
if(TxPwr>=80) TxPwr=80;
|
||||
StratuxTxPwr=TxPwr; return 1; }
|
||||
#endif
|
||||
#ifdef WITH_WIFI
|
||||
#ifdef WITH_APRS
|
||||
if(strcmp(Name, "WIFIname")==0) return Read_String(WIFIname[0], Value, WIFInameLen)<=0;
|
||||
if(strcmp(Name, "WIFIpass")==0) return Read_String(WIFIpass[0], Value, WIFIpassLen)<=0;
|
||||
if( (memcmp(Name, "WIFIname", 8)==0) && (strlen(Name)==9) )
|
||||
|
@ -709,7 +709,7 @@ class FlashParameters
|
|||
Write_Float1(Line, "StratuxTxPwr" , (int32_t)10*StratuxTxPwr/4); strcat(Line, " # [ dBm]\n"); if(fputs(Line, File)==EOF) return EOF;
|
||||
Write_SignDec(Line, "StratuxMinSig", (int32_t)StratuxMinSig); strcat(Line, " # [ dBm]\n"); if(fputs(Line, File)==EOF) return EOF;
|
||||
#endif
|
||||
#ifdef WITH_WIFI
|
||||
#ifdef WITH_APRS
|
||||
for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
||||
{ if(WIFIname[Idx][0]==0) continue;
|
||||
strcpy(Line, "WIFIname"); Line[8]='0'+Idx; Line[9]='='; strcpy(Line+10, WIFIname[Idx]); strcat(Line, "; # [char]\n"); if(fputs(Line, File)==EOF) return EOF;
|
||||
|
@ -768,7 +768,7 @@ class FlashParameters
|
|||
Write_Float1 (Line, "StratuxTxPwr", (int32_t)10*StratuxTxPwr/4); strcat(Line, " # [ dBm]\n"); Format_String(Output, Line);
|
||||
Write_SignDec (Line, "StratuxMinSig", (int32_t)StratuxMinSig); strcat(Line, " # [ dBm]\n"); Format_String(Output, Line);
|
||||
#endif
|
||||
#ifdef WITH_WIFI
|
||||
#ifdef WITH_APRS
|
||||
for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
||||
{ if(WIFIname[Idx][0]==0) continue;
|
||||
strcpy(Line, "WIFIname"); Line[8]='0'+Idx; Line[9]='='; strcpy(Line+10, WIFIname[Idx]); strcat(Line, "; # [char]\n"); Format_String(Output, Line);
|
||||
|
|
Ładowanie…
Reference in New Issue