/* * "TinySA_wifi.h" * * Definitions and function prototypes for the WiFi capability. */ #ifndef TINYSA_WIFI_H_ #define TINYSA_WIFI_H_ // Prevent double inclusion #include "Arduino.h" // Basic Arduino definitions #include "tinySA.h" // Program definitions #include "Si4432.h" // RF module definitions #include // WiFi library #include #include "ESPAsyncWebServer.h" // ESP32 Webserver library #include "SPIFFS.h" // ESP32 File system #include // Display library #include #include // Install using Library Manager or go to arduinojson.org /* * Install WebSocketes library by Markus Sattler * https://github.com/Links2004/arduinoWebSockets */ #include #include #include #include #define SSID_NAME "TinySA" // Name of access point /* * Function prototypes: */ extern boolean startAP (); extern boolean connectWiFi (); extern void buildServer (); extern void addTagNameValue ( char *b, char *_name, char *value ); extern char *escapeXML ( char *s ); extern void webSocketEvent ( uint8_t num, WStype_t type, uint8_t* payload, size_t lenght ); extern char *FormatIPAddress ( IPAddress ipAddress ); /* * Functions outside of "TinySA_wifi: */ int GetPointsAsXML ( void textHandler (char *s) ); void set_sweep_frequency ( int type, int32_t frequency ); void SetRBW ( int ); void SetAttenuation ( int a ); void RequestSetPowerLevel ( float o ); void SetPowerLevel ( int o ); void SetPowerReference (int freq ); void SetLoDrive ( uint8_t level ); bool SetIFFrequency ( int32_t f ); void SetPreAmpGain ( int g ); void WriteSettings (); void SetSpur ( int v ); /* * variables and objects outside of TinySA_wifi */ extern settings_t setting; extern uint8_t myData[DISPLAY_POINTS+1]; extern uint8_t myStorage[DISPLAY_POINTS+1]; extern uint8_t myActual[DISPLAY_POINTS+1]; extern uint8_t myGain[DISPLAY_POINTS+1]; // M0WID addition to record preamp gain extern uint32_t myFreq[DISPLAY_POINTS+1]; // M0WID addition to store frequency for XML file extern WebSocketsServer webSocket; // Initiated in TinySA.ino extern TFT_eSPI tft; // TFT Screen object extern bandpassFilter_t bandpassFilters[11]; extern float bandwidth; extern uint32_t sweepPoints; // Number of points in the sweep. Can be more than DISPLAY_POINTS if RBW is set less than video resolution #endif