Skip to content

Commit 578e96a

Browse files
Update examples
1 parent a89c867 commit 578e96a

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

examples/cameraDiscoveryExample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ def main() -> None:
2323
def process_event(event: DiscoveryEvent) -> None:
2424
log.info('Service discovery event', type=event.type.name, service=event.service)
2525

26-
# Register the event handler to process discovery events
26+
# Register the event handler
2727
discoverer.register(process_event)
2828

2929
# Start the discoverer with the specified group
3030
discoverer.start(group)
3131

32-
# Send the service query
32+
# Send a service query to trigger advertisement from matching services
3333
discoverer.discover(query)
3434

3535
shutdown_event.wait()

examples/cameraServiceExample.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ def main() -> None:
1717
group = Group(name='effective-range/sniper', url='udp://239.0.1.1:5555')
1818

1919
# Define the service information for the camera
20-
info = ServiceInfo(uuid=uuid4(), name='er-sniper-camera-1', role='camera', urls={
21-
'device-api': 'grpc://er-sniper-camera-1/device',
22-
'video-stream': 'blob:http://er-sniper-camera-1/video'
20+
hostname = 'er-sniper-camera-1'
21+
info = ServiceInfo(uuid=uuid4(), name=hostname, role='camera', urls={
22+
'api': f'grpc://{hostname}.local/api',
23+
'stream': f'http://{hostname}.local/stream'
2324
})
2425

2526
# Use a scheduled advertizer to periodically announce the camera service

0 commit comments

Comments
 (0)