Skip to content

Commit

Permalink
[coco][fuji] net_scan_result to use response.
Browse files Browse the repository at this point in the history
  • Loading branch information
tschak909 committed Apr 28, 2024
1 parent a2264b5 commit c5e0046
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/device/drivewire/fuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ void drivewireFuji::net_scan_networks()
_countScannedSSIDs = fnWiFi.scan_networks();
}

fnUartBUS.write(_countScannedSSIDs);
response.clear();
response.shrink_to_fit();

response += _countScannedSSIDs;
}

// Return scanned network entry
Expand Down Expand Up @@ -171,7 +174,10 @@ void drivewireFuji::net_scan_result()
err = true;
}

fnUartBUS.write((uint8_t *)&detail, sizeof(detail));
response.clear();
response.shrink_to_fit();

response = std::string((const char *)&detail, sizeof(detail));
}

// Get SSID
Expand Down Expand Up @@ -201,7 +207,10 @@ void drivewireFuji::net_get_ssid()
memcpy(cfg.password, s.c_str(),
s.length() > sizeof(cfg.password) ? sizeof(cfg.password) : s.length());

fnUartBUS.write((uint8_t *)&cfg, sizeof(cfg));
response.clear();
response.shrink_to_fit();

response = std::string((const char *)&cfg, sizeof(cfg));
}

// Set SSID
Expand Down

0 comments on commit c5e0046

Please sign in to comment.