mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2026-03-03 00:39:10 +00:00
update imports
This commit is contained in:
parent
10b38b3fcc
commit
8cfeb45fcb
@ -5,16 +5,16 @@ import time
|
|||||||
|
|
||||||
from .enums import NBS
|
from .enums import NBS
|
||||||
from .error import VBANCMDConnectionError
|
from .error import VBANCMDConnectionError
|
||||||
from .packet import (
|
from .packet.headers import (
|
||||||
HEADER_SIZE,
|
HEADER_SIZE,
|
||||||
VBAN_PROTOCOL_SERVICE,
|
VBAN_PROTOCOL_SERVICE,
|
||||||
VBAN_SERVICE_RTPACKET,
|
VBAN_SERVICE_RTPACKET,
|
||||||
SubscribeHeader,
|
|
||||||
VbanPacket,
|
VbanPacket,
|
||||||
VbanPacketNBS0,
|
VbanResponseHeader,
|
||||||
VbanPacketNBS1,
|
VbanSubscribeHeader,
|
||||||
VbanRtPacketHeader,
|
|
||||||
)
|
)
|
||||||
|
from .packet.nbs0 import VbanPacketNBS0
|
||||||
|
from .packet.nbs1 import VbanPacketNBS1
|
||||||
from .util import bump_framecounter
|
from .util import bump_framecounter
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -34,7 +34,7 @@ class Subscriber(threading.Thread):
|
|||||||
while not self.stopped():
|
while not self.stopped():
|
||||||
try:
|
try:
|
||||||
for nbs in NBS:
|
for nbs in NBS:
|
||||||
sub_packet = SubscribeHeader().to_bytes(nbs, self._framecounter)
|
sub_packet = VbanSubscribeHeader().to_bytes(nbs, self._framecounter)
|
||||||
self._remote.sock.sendto(
|
self._remote.sock.sendto(
|
||||||
sub_packet, (self._remote.ip, self._remote.port)
|
sub_packet, (self._remote.ip, self._remote.port)
|
||||||
)
|
)
|
||||||
@ -90,7 +90,7 @@ class Producer(threading.Thread):
|
|||||||
if len(data) < HEADER_SIZE:
|
if len(data) < HEADER_SIZE:
|
||||||
return
|
return
|
||||||
|
|
||||||
response_header = VbanRtPacketHeader.from_bytes(data[:HEADER_SIZE])
|
response_header = VbanResponseHeader.from_bytes(data[:HEADER_SIZE])
|
||||||
if (
|
if (
|
||||||
response_header.format_sr != VBAN_PROTOCOL_SERVICE
|
response_header.format_sr != VBAN_PROTOCOL_SERVICE
|
||||||
or response_header.format_nbc != VBAN_SERVICE_RTPACKET
|
or response_header.format_nbc != VBAN_SERVICE_RTPACKET
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user