Skip to content

Commit

Permalink
Review comment changes for wan mac header
Browse files Browse the repository at this point in the history
  • Loading branch information
guruchandru committed Dec 15, 2023
1 parent 5a9e7b5 commit 56cd51d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/webcfg_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ int createMqttHeader(char **header_list)
char *AccountID = NULL, *AccountID_header = NULL;
char *deviceId_header = NULL, *doc_header = NULL;
char *contenttype_header = NULL, *contentlen_header = NULL;
char *DeviceWanMac_header = NULL;
char *DeviceWanMac = NULL, *DeviceWanMac_header = NULL;
struct timespec cTime;
char currentTime[32];
char *currentTime_header=NULL;
Expand Down Expand Up @@ -891,6 +891,7 @@ int createMqttHeader(char **header_list)
{
WebcfgError("Failed in memory allocation for contentlen_header\n");
}

//Addtional headers for telemetry sync
if(get_global_supplementarySync())
{
Expand Down Expand Up @@ -934,10 +935,14 @@ int createMqttHeader(char **header_list)
WebcfgError("Failed to get AccountID\n");
}

if( get_deviceWanMAC() != NULL && strlen(get_deviceWanMAC()) !=0 )
if(strlen(g_deviceWanMac) ==0)
{
strncpy(g_deviceWanMac, get_deviceWanMAC(), sizeof(g_deviceWanMac)-1);
WebcfgDebug("g_deviceWanMac fetched is %s\n", g_deviceWanMac);
DeviceWanMac = get_deviceWanMAC();
if(DeviceWanMac !=NULL)
{
strncpy(g_deviceWanMac, DeviceWanMac, sizeof(g_deviceWanMac)-1);
WebcfgDebug("g_deviceWanMac fetched is %s\n", g_deviceWanMac);
}
}

if(strlen(g_deviceWanMac))
Expand All @@ -957,6 +962,7 @@ int createMqttHeader(char **header_list)
{
WebcfgError("Failed to get DeviceWanMac_header\n");
}

}

if(!get_global_supplementarySync())
Expand Down

0 comments on commit 56cd51d

Please sign in to comment.