import ctypes

class TargetHalfCallSign(ctypes.Structure):
    _fields_ = [("raw", ctypes.c_uint16)]

    def get_character1_msw(self):
        return (self.raw >> 8) & 0xFF

    def set_character1_msw(self, value):
        self.raw &= ~(0xFF << 8)
        self.raw |= (value << 8)

    def get_character2_msw(self):
        return (self.raw >> 0) & 0xFF

    def set_character2_msw(self, value):
        self.raw &= ~(0xFF << 0)
        self.raw |= (value << 0)