Murata RF modules are designed to simplify wireless development and certification by minimizing the amount of RF expertise you need to wirelessly enable a wide range of applications.
Diff: Type/WIFIInfo.cpp
- Revision:
- 9:0ce800923eda
- Parent:
- 1:fd19bd683e90
--- a/Type/WIFIInfo.cpp Mon Feb 15 15:17:50 2016 +0000 +++ b/Type/WIFIInfo.cpp Wed Mar 16 15:04:46 2016 +0000 @@ -4,7 +4,7 @@ const char * WIFIInfo::GetSSID() { - return ssid.c_str(); + return ssid; } SecurityMode WIFIInfo::GetSecurityMode() @@ -17,23 +17,36 @@ return channel; } -WIFIInfo::WIFIInfo() { } +WIFIInfo::WIFIInfo() +{ + ssid = NULL; +} WIFIInfo::WIFIInfo(const char * SSID, const SecurityMode securityMode) { + ssid = NULL; SetSSID(SSID)->SetSecurityMode(securityMode); } -/* + WIFIInfo::~WIFIInfo() { - delete[] ssid; + if (ssid != NULL) + delete[] ssid; } -*/ + WIFIInfo * WIFIInfo::SetSSID(const char * SSID) { - ssid.assign(SSID); + if (SSID == NULL) + return this; + + if (ssid != NULL) + delete[] ssid; + + int length = strlen(SSID) + 1; + ssid = new char[length]; + memcpy(ssid, SSID, length); return this; } @@ -49,7 +62,7 @@ return this; } -string & WIFIInfo::ToString() +const char * WIFIInfo::ToString() { return ssid; } \ No newline at end of file