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"
|
#include "proc.h"
|
||||||
|
|
||||||
#ifdef WITH_WIFI
|
#ifdef WITH_APRS
|
||||||
|
|
||||||
#define DEBUG_PRINT
|
#define DEBUG_PRINT
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ int APRS_RxMsg(const char *Msg)
|
||||||
return 0; }
|
return 0; }
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
void vTaskWIFI(void* pvParameters)
|
void vTaskAPRS(void* pvParameters)
|
||||||
{ esp_err_t Err;
|
{ esp_err_t Err;
|
||||||
vTaskDelay(1000);
|
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
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
#endif
|
#endif
|
||||||
void vTaskWIFI(void* pvParameters);
|
void vTaskAPRS(void* pvParameters);
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
#include "stratux.h"
|
#include "stratux.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_WIFI
|
#ifdef WITH_APRS
|
||||||
#include "wifi.h" // WIFI task
|
#include "aprs.h" // APRS task
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
|
@ -113,8 +113,8 @@ void app_main(void)
|
||||||
#ifdef WITH_AERO
|
#ifdef WITH_AERO
|
||||||
xTaskCreate(vTaskAERO, "AERO", 2048, 0, tskIDLE_PRIORITY+3, 0);
|
xTaskCreate(vTaskAERO, "AERO", 2048, 0, tskIDLE_PRIORITY+3, 0);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_WIFI
|
#ifdef WITH_APRS
|
||||||
xTaskCreate(vTaskWIFI, "WIFI", 4096, 0, tskIDLE_PRIORITY+2, 0);
|
xTaskCreate(vTaskAPRS, "APRS", 4096, 0, tskIDLE_PRIORITY+2, 0);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_STRATUX
|
#ifdef WITH_STRATUX
|
||||||
xTaskCreate(vTaskSTX, "STX", 4096, 0, tskIDLE_PRIORITY+3, 0);
|
xTaskCreate(vTaskSTX, "STX", 4096, 0, tskIDLE_PRIORITY+3, 0);
|
||||||
|
|
|
@ -117,7 +117,7 @@ class FlashParameters
|
||||||
int8_t StratuxTxPwr;
|
int8_t StratuxTxPwr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_WIFI
|
#ifdef WITH_APRS
|
||||||
static const uint8_t WIFInameLen = 32;
|
static const uint8_t WIFInameLen = 32;
|
||||||
static const uint8_t WIFIpassLen = 64;
|
static const uint8_t WIFIpassLen = 64;
|
||||||
static const uint8_t WIFIsets = 10;
|
static const uint8_t WIFIsets = 10;
|
||||||
|
@ -137,7 +137,7 @@ class FlashParameters
|
||||||
|
|
||||||
uint32_t CheckSum;
|
uint32_t CheckSum;
|
||||||
|
|
||||||
#ifdef WITH_WIFI
|
#ifdef WITH_APRS
|
||||||
const char *getWIFIpass(const char *NetName) const
|
const char *getWIFIpass(const char *NetName) const
|
||||||
{ for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
{ for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
||||||
{ if(strcmp(NetName, WIFIname[Idx])==0) return WIFIpass[Idx]; }
|
{ if(strcmp(NetName, WIFIname[Idx])==0) return WIFIpass[Idx]; }
|
||||||
|
@ -247,7 +247,7 @@ class FlashParameters
|
||||||
StratuxMinSig = -70; // [dBm]
|
StratuxMinSig = -70; // [dBm]
|
||||||
StratuxTxPwr = 40; // [0.25dBm]
|
StratuxTxPwr = 40; // [0.25dBm]
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_WIFI
|
#ifdef WITH_APRS
|
||||||
for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
||||||
{ WIFIname[Idx][0] = 0;
|
{ WIFIname[Idx][0] = 0;
|
||||||
WIFIpass[Idx][0] = 0; }
|
WIFIpass[Idx][0] = 0; }
|
||||||
|
@ -590,7 +590,7 @@ class FlashParameters
|
||||||
if(TxPwr>=80) TxPwr=80;
|
if(TxPwr>=80) TxPwr=80;
|
||||||
StratuxTxPwr=TxPwr; return 1; }
|
StratuxTxPwr=TxPwr; return 1; }
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_WIFI
|
#ifdef WITH_APRS
|
||||||
if(strcmp(Name, "WIFIname")==0) return Read_String(WIFIname[0], Value, WIFInameLen)<=0;
|
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(strcmp(Name, "WIFIpass")==0) return Read_String(WIFIpass[0], Value, WIFIpassLen)<=0;
|
||||||
if( (memcmp(Name, "WIFIname", 8)==0) && (strlen(Name)==9) )
|
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_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;
|
Write_SignDec(Line, "StratuxMinSig", (int32_t)StratuxMinSig); strcat(Line, " # [ dBm]\n"); if(fputs(Line, File)==EOF) return EOF;
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_WIFI
|
#ifdef WITH_APRS
|
||||||
for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
||||||
{ if(WIFIname[Idx][0]==0) continue;
|
{ 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;
|
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_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);
|
Write_SignDec (Line, "StratuxMinSig", (int32_t)StratuxMinSig); strcat(Line, " # [ dBm]\n"); Format_String(Output, Line);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_WIFI
|
#ifdef WITH_APRS
|
||||||
for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
for(uint8_t Idx=0; Idx<WIFIsets; Idx++)
|
||||||
{ if(WIFIname[Idx][0]==0) continue;
|
{ 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);
|
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