Purbright_Esp32_PlatformIO/Purbright_Esp32_PlatformIO/main.cpp
void TasktoRunNetworkStack(void *parameter)
{
  Network *network = new Network;
  PurrMqtt *mqtt = new PurrMqtt;
  Serial.print("Networking Tasks running on core ");
  Serial.println(xPortGetCoreID());
  for (;;)
  {
    if (millis() - lastMillis >= 5000)
    {
      lastMillis = millis();        // get ready for the next iteration
      network->updateCurrentData(); // Update the config file with the current data
      network->CheckNetworkLoop();  // Check the network state and connect to the AP if needed
    }
    // network.SetupmDNSLoop(); // Setup mDNS loop
    mqtt->RunMqttService(); // Run the MQTT service loop
  }
  delete network;
  delete mqtt;
}
/******************************************************************************
 * Function: Task to Run Network Stack
 * Description: This function assigns the network stack loop to a task in freeRTOS.
 * Parameters: void *parameters
 * Return: None
 ******************************************************************************/
Task to Run Network Stack
Description: This function assigns the network stack loop to a task in freeRTOS.
Parameters: void *parameters
Return: None
Task to Run Network Stack Description : This function assigns the network stack loop to a task in freeRTOS . Parameters : void * parameters Return : None
void TasktoRunNetworkStack(void *parameter)
{
  Network *network = new Network;
  PurrMqtt *mqtt = new PurrMqtt;
  Serial.print("Networking Tasks running on core ");
  Serial.println(xPortGetCoreID());
  for (;;)
  {
    if (millis() - lastMillis >= 5000)
    {
      lastMillis = millis();        
      network->updateCurrentData(); 
      network->CheckNetworkLoop();  
    }
    mqtt->RunMqttService(); 
  }
  delete network;
  delete mqtt;
}
void TasktoRunNetworkStack ( void * parameter ) { Network * network = new Network ; PurrMqtt * mqtt = new PurrMqtt ; Serial . print ( " " ) ; Serial . println ( xPortGetCoreID ( ) ) ; for ( ; ; ) { if ( millis ( ) - lastMillis >= 5000 ) { lastMillis = millis ( ) ; network -> updateCurrentData ( ) ; network -> CheckNetworkLoop ( ) ; } mqtt -> RunMqttService ( ) ; } delete network ; delete mqtt ; }
Function: Task to Run Network Stack
 Description: This function assigns the network stack loop to a task in freeRTOS.
Function : Task to Run Network Stack Description : This function assigns the network stack loop to a task in freeRTOS .
// get ready for the next iteration // Update the config file with the current data // Check the network state and connect to the AP if needed // network.SetupmDNSLoop(); // Setup mDNS loop // Run the MQTT service loop