mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-13 12:46:53 +00:00
some packet types were commands vim packets.py !
This commit is contained in:
@@ -3,7 +3,7 @@ import random
|
||||
|
||||
from .base import CommandHandlerBase
|
||||
from ..events import EventType, Event
|
||||
from ..packets import ControlType, PacketType
|
||||
from ..packets import ControlType, CommandType
|
||||
|
||||
logger = logging.getLogger("meshcore")
|
||||
|
||||
@@ -14,7 +14,7 @@ class ControlDataCommandHandler(CommandHandlerBase):
|
||||
"""Helper functions to handle binary requests through binary commands"""
|
||||
|
||||
async def send_control_data (self, control_type: int, payload: bytes) -> Event:
|
||||
data = bytearray([PacketType.SEND_CONTROL_DATA.value])
|
||||
data = bytearray([CommandType.SEND_CONTROL_DATA.value])
|
||||
data.extend(control_type.to_bytes(1, "little", signed = False))
|
||||
data.extend(payload)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Optional, Union
|
||||
from hashlib import sha256
|
||||
|
||||
from ..events import Event, EventType
|
||||
from ..packets import PacketType
|
||||
from ..packets import CommandType
|
||||
from .base import CommandHandlerBase, DestinationType, _validate_destination
|
||||
|
||||
logger = logging.getLogger("meshcore")
|
||||
@@ -252,7 +252,7 @@ class MessagingCommands(CommandHandlerBase):
|
||||
|
||||
logger.debug(f"Setting scope to {scope_key.hex()}")
|
||||
|
||||
cmd_data = bytearray([PacketType.SET_FLOOD_SCOPE.value])
|
||||
cmd_data = bytearray([CommandType.SET_FLOOD_SCOPE.value])
|
||||
cmd_data.extend(b"\0")
|
||||
cmd_data.extend(scope_key)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user