Skip to content

Conversation

@michielappelman
Copy link
Contributor

Adds support for requesting extended advertisement data from nodes on demand. As described in meshcore-dev/MeshCore#1374

Changes

  • commands.py: Added request_advert(prefix, path) command (CMD 0x39)
  • reader.py: Added parser for PUSH_CODE_ADVERT_RESPONSE (0x8F)
  • events.py: Added ADVERT_RESPONSE event type

Usage

# Request advert from node with prefix 0x1F
result = await mc.commands.request_advert(bytes([0x1F]), bytes([0x1F]))

# Wait for async response
response = await mc.wait_for_event(EventType.ADVERT_RESPONSE, timeout=30)
if response:
    print(f"Name: {response.payload['node_name']}")
    print(f"Location: {response.payload.get('latitude')}, {response.payload.get('longitude')}")
    print(f"Description: {response.payload.get('node_desc')}")

@fdlamotte fdlamotte merged commit 02a38fc into meshcore-dev:main Jan 12, 2026
michielappelman added a commit to michielappelman/meshcore_py that referenced this pull request Jan 12, 2026
Followup from meshcore-dev#45 which was merged before backend feature was merged.
Suggest to keep this in draft until that has been merged and we know
final codes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants