# Path: cbus/common.py
# class DestinationAddressType(IntEnum):
#     """
#     Destination Address Type (DAT).
# 
#     Ref: Serial Interface Guide, s3.4. Other values reserved.
#     """
#     UNSET = 0x00
#     POINT_TO_POINT_TO_MULTIPOINT = 0x03
#     POINT_TO_MULTIPOINT = 0x05
#     POINT_TO_POINT = 0x06
# 
# class PriorityClass(IntEnum):
#     CLASS_4 = 0x00  # lowest
#     CLASS_3 = 0x01  # medium low
#     CLASS_2 = 0x02  # medium high
#     CLASS_1 = 0x03  # highest


import abc
from base64 import b16encode
from dataclasses import dataclass
from typing import Optional
from cbus.common import DestinationAddressType, PriorityClass
# Copyright 2012-2019 Michael Farrell <micolous+git@gmail.com>
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library.  If not, see <http://www.gnu.org/licenses/>.



__all__ = [
    'BasePacket',
    'InvalidPacket',
    'SpecialClientPacket',
    'SpecialServerPacket',
]


class BasePacket(abc.ABC):
    def __init__(
            self,
            checksum: bool = True,
            destination_address_type:

# Path: cbus/common.py
# class DestinationAddressType(IntEnum):
#     """
#     Destination Address Type (DAT).
# 
#     Ref: Serial Interface Guide, s3.4. Other values reserved.
#     """
#     UNSET = 0x00
#     POINT_TO_POINT_TO_MULTIPOINT = 0x03
#     POINT_TO_MULTIPOINT = 0x05
#     POINT_TO_POINT = 0x06
# 
# class PriorityClass(IntEnum):
#     CLASS_4 = 0x00  # lowest
#     CLASS_3 = 0x01  # medium low
#     CLASS_2 = 0x02  # medium high
#     CLASS_1 = 0x03  # highest


# Path: cbus/protocol/base_packet.py
import abc
from base64 import b16encode
from dataclasses import dataclass
from typing import Optional
from cbus.common import DestinationAddressType, PriorityClass

# Copyright 2012-2019 Michael Farrell <micolous+git@gmail.com>
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library.  If not, see <http://www.gnu.org/licenses/>.



__all__ = [
    'BasePacket',
    'InvalidPacket',
    'SpecialClientPacket',
    'SpecialServerPacket',
]


class BasePacket(abc.ABC):
    def __init__(
            self,
            checksum: bool = True,
            destination_address_type:

            DestinationAddressType = DestinationAddressType.UNSET,