Skip to content

Commit

Permalink
examples/network: Add UDP multicast client and server examples.
Browse files Browse the repository at this point in the history
Signed-off-by: IhorNehrutsa <[email protected]>
  • Loading branch information
IhorNehrutsa authored and IhorNehrutsa committed Dec 21, 2023
1 parent f1cfc44 commit f1b968b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/network/udp_multicast_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def inet_aton(str_addr):
if time.time() - t >= 3:
t = time.time()

mac = wlan.config('mac')
mac = wlan.config("mac")
str_to_send = f"client_ip:{client_ip}\t mac:{'-'.join(map('{:02x}'.format, mac))}"
skt.sendto(str_to_send, sockaddr)
print(f'GET to {sockaddr}\t sent "{str_to_send}"')
Expand All @@ -60,4 +60,4 @@ def inet_aton(str_addr):
skt.close()
except:
pass
raise(e)
raise (e)
4 changes: 2 additions & 2 deletions examples/network/udp_multicast_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def inet_aton(str_addr):
if received:
print(f'GET from {addr}\t received "{received.decode()}"')

mac = wlan.config('mac')
mac = wlan.config("mac")
str_to_send = f"server_ip:{server_ip}\t mac:{'-'.join(map('{:02x}'.format, mac))}"
skt.sendto(str_to_send, sockaddr)
print(f'ACK to {sockaddr}\t sent "{str_to_send}"')
Expand All @@ -56,4 +56,4 @@ def inet_aton(str_addr):
skt.close()
except:
pass
raise(e)
raise (e)

0 comments on commit f1b968b

Please sign in to comment.