Skip to content

Commit

Permalink
Merge pull request #40 from jaenrig-ifx/ports/psoc6_network_mod_tests
Browse files Browse the repository at this point in the history
Ports/psoc6 network mod tests
  • Loading branch information
NikhitaR-IFX committed Apr 14, 2023
2 parents 2a562ef + 9bbc70f commit 26c4396
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ports/psoc6/tests/network_wlan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import network

print("Testing PSoC6 Network module")

sta_if = network.WLAN(network.STA_IF)

ssid = "OnePlus 9 5G"
password = "psoc-mpy"
ifconfig_params = ("192.168.255.75", "255.255.255.0", "192.168.255.73", "192.168.255.73")

if not sta_if.isconnected():
print("Status: ", isconnected())
print("Connecting to hotspot...")
sta_if.ifconfig(ifconfig_params)
sta_if.connect(ssid, password)
if sta_if.ifconfig() == ifconfig_params:
print("ifconfig params match")
if sta_if.active() == 1:
print("Successfully connected")

sta_if.disconnect()

0 comments on commit 26c4396

Please sign in to comment.