mirror of
https://gitlab.com/d3tn/ud3tn.git
synced 2026-08-13 12:33:27 +02:00
commit
69f004306a
1 changed files with 3 additions and 5 deletions
|
|
@ -9,7 +9,7 @@ import socket
|
|||
import uuid
|
||||
|
||||
from google.protobuf.internal.decoder import _DecodeVarint32
|
||||
from google.protobuf.internal.encoder import _EncodeVarint
|
||||
from google.protobuf.internal.encoder import _VarintBytes
|
||||
|
||||
from .generated import aap2_pb2
|
||||
|
||||
|
|
@ -334,10 +334,8 @@ class AAP2Client(abc.ABC):
|
|||
|
||||
"""
|
||||
msg_bin = msg.SerializeToString()
|
||||
varint_bytes = bytearray()
|
||||
_EncodeVarint(lambda b: varint_bytes.extend(b), len(msg_bin))
|
||||
self.socket.send(varint_bytes)
|
||||
self.socket.send(msg_bin)
|
||||
delimited_msg = _VarintBytes(len(msg_bin)) + msg_bin
|
||||
self.socket.send(delimited_msg)
|
||||
|
||||
def send_adu(self, adu_msg, bundle_data):
|
||||
"""Send a bundle ADU (Protobuf with extra payload data).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue