Merge pull request #13493 from balajicyp/topic/cypress_target_ssid_fix

Fix SSID bug on Cypress Targets
pull/13518/head
Martin Kojtal 2020-08-31 10:48:00 +01:00 committed by GitHub
commit 31ff368d17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -299,9 +299,12 @@ nsapi_error_t WhdSTAInterface::connect()
// setup ssid
whd_ssid_t ssid;
strncpy((char *)ssid.value, _ssid, SSID_NAME_SIZE);
ssid.value[SSID_NAME_SIZE - 1] = '\0';
ssid.length = strlen((char *)ssid.value);
uint8_t ssid_len;
memset(&ssid, 0, sizeof(whd_ssid_t));
ssid_len = strlen(_ssid);
strncpy((char *)ssid.value, _ssid, ssid_len);
ssid.length = ssid_len;
// choose network security
whd_security_t security = whd_fromsecurity(_security);