Skip to content

Commit

Permalink
[WIP] Publish IP address after pairing in PairingMode
Browse files Browse the repository at this point in the history
  • Loading branch information
708yamaguchi committed Feb 1, 2025
1 parent 5bf6b1f commit f7b5a14
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/display_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
from riberry.com.base import PacketType
from riberry.com.i2c_base import I2CBase
from riberry.com.uart_base import UARTBase
from riberry.esp_now_pairing import ESPNowPairing
from riberry.esp_now_pairing import get_role
from riberry.esp_now_pairing import Role
from riberry.network import get_ip_address
from riberry.network import get_mac_address
from riberry.network import get_ros_master_ip
Expand Down Expand Up @@ -337,6 +340,19 @@ def run(self):
# Set ros_display_image to None
# after displaying the image to ensure it's not reused
ros_display_image = None
elif mode == 'PairingMode':
# Single tap to start communicate with AtomS3
if button_count == 1:
role = get_role(self.com)
if role is not None:
esp_now_pairing = ESPNowPairing(
com=self.com, role=role)
if role == Role.Main:
esp_now_pairing.set_pairing_info(get_ip_address())
esp_now_pairing.pairing()
if esp_now_pairing.role == Role.Secondary:
# TODO: publish pairing info
print(esp_now_pairing.get_pairing_info())
else:
time.sleep(0.1)

Expand Down

0 comments on commit f7b5a14

Please sign in to comment.