Handling of maximum length SSID

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
Handling of maximum length SSID

Maximum length SSID 

An issue has been found with MLA v5.42.06 Feb 2013 and prior releases, when SSID of the selected AP is up to the maximum length (length of 32). If SSID of AP is 32 characters, then the type of security is always seen as OPEN. However, if SSID is less than 32 characters, then host-scan result returns the correct security type. 

The root cause has been found to occur during the process of converting the SSID to ASCII string in order to print this out through console, whereby the last character was set to 0 to indicate end of string. 

 

The workarounds needed are as follows.

  1. WFEasyConfig.c

In WFRetrieveScanResult(), update the code as 

UINT16 WFRetrieveScanResult(UINT8 Idx, tWFScanResult *p_ScanResult) 

if (Idx >= SCANCXT.numScanResults) 

return WF_ERROR_INVALID_PARAM; 

WF_ScanGetResult(Idx, p_ScanResult); 

return WF_SUCCESS; 

 

In WFDisplayScanMgr(), update the code as 

void WFDisplayScanMgr() 

tWFScanResult bssDesc; 

char ssid[WF_MAX_SSID_LENGTH+1]; 

char rssiChan[48]; 

int i; 

...................... 

/* Display SSID */ 

for(i=0;i<WF_MAX_SSID_LENGTH;i++) ssid[i] = bssDesc.ssid[i]; 

ssid[WF_MAX_SSID_LENGTH] = 0; 

putsUART(ssid); 

putsUART("\r\n"); 

................................. 

 

2. CustomHTTPApp.c 

Modify HTTPPrint_name() as follows. 

void HTTPPrint_name(void) 

if (bssDescIsValid) 

if(strlen((const char*)bssDesc.ssid)<WF_MAX_SSID_LENGTH) 

TCPPutString(sktHTTP, bssDesc.ssid); 

else 

unsigned char buf_tmp[WF_MAX_SSID_LENGTH + 1]; 

int i; 

for(i=0;i<WF_MAX_SSID_LENGTH;i++) buf_tmp[i] = bssDesc.ssid[i]; 

buf_tmp[WF_MAX_SSID_LENGTH] = 0; 

TCPPutString(sktHTTP, buf_tmp); 

else 

TCPPutROMString(sktHTTP, (ROM BYTE *)"0"); }}

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.