Skip to content

Commit

Permalink
Use WiFi credentials from Rendezvous BLE message (#1898)
Browse files Browse the repository at this point in the history
For this first draft, SSID and key are separated by ‘:’.
This will need to change since any character including ‘:’
can appear in an SSID or password.
  • Loading branch information
kpschoedel authored Jul 29, 2020
1 parent d1c982f commit 4ddc0fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/wifi-echo/server/esp32/main/RendezvousSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

using namespace ::chip;

extern CHIP_ERROR SetWiFiStationProvisioning(char * ssid, char * key);

BluetoothWidget * RendezvousSession::mVirtualLed;

Ble::BLEEndPoint * RendezvousSession::mEndPoint = nullptr;
Expand Down Expand Up @@ -79,5 +81,8 @@ void RendezvousSession::HandleMessageReceived(Ble::BLEEndPoint * endPoint, Packe

ChipLogProgress(Ble, "RendezvousSession: Receive message: %s", msg);

mEndPoint->Send(buffer);
char * ssid = strtok(msg, ":");
char * key = strtok(NULL, ":");
ChipLogProgress(Ble, "RendezvousSession: SSID: %s, key: %s", ssid, key);
SetWiFiStationProvisioning(ssid, key);
}

0 comments on commit 4ddc0fa

Please sign in to comment.