Exemplo n.º 1
0
    def __init__(self, data):
        # myutils.debug_hex(data)
        string_length, self.id_key = myutils.get_utf8_string(data)
        tmp = 4 + string_length
        # print("  id_key: {} (len:{})".format(self.id_key, string_length))

        self.new_id = myutils.get_boolean(data[tmp:])
        # print("  [*] new: {}".format(self.new_id))
        tmp += myutils.DataSize._boolean
        # print("  [*] new_id:{}".format(self.new_id))

        self.now_time = myutils.get_time(data[tmp:])
        tmp += myutils.DataSize._time
        # print("  [*] date:{}".format(self.now_time))

        self.snr = myutils.get_int32(data[tmp:])
        tmp += myutils.DataSize._int32
        # print("  [*] snr:{}".format(self.snr))

        self.delta_time = myutils.get_double(data[tmp:])
        tmp += myutils.DataSize._double
        # print("  [*] delta_time:{}".format(self.delta_time))

        # Something in here? Seems zero in the debug
        # myutils.debug_hex(data[tmp:])
        tmp += myutils.DataSize._uint32

        self.delta_freq = myutils.get_uint32(data[tmp:])
        tmp += myutils.DataSize._uint32
        # print("  [*] delta_freq:{}".format(self.delta_freq))

        self.drift = myutils.get_uint32(data[tmp:])
        tmp += myutils.DataSize._uint32
        # print("  [*] drift:{}".format(self.drift))

        string_length, self.callsign = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("  [*] callsign:{}".format(self.callsign))

        string_length, self.grid = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("  [*] grid:{}".format(self.grid))

        self.power = myutils.get_uint32(data[tmp:])
        # print("  [*] power:{}".format(self.power))

        self.dist = 0
        self.bearing = 0
        if (myutils.validate_callsign(self.callsign)):
            if (myutils.validate_locator(self.grid)):
                self.dist = locator.calculate_distance("io64", self.grid)
                self.bearing = locator.calculate_heading("io64", self.grid)
Exemplo n.º 2
0
    def __init__(self, data):
        # myutils.debug_hex(data)
        string_length, self.id_key = myutils.get_utf8_string(data)
        tmp = 4 + string_length
        # print("  id_key: {} (len:{})".format(self.id_key, string_length))

        self.new_id = myutils.get_boolean(data[tmp:])
        # print("  [*] new: {}".format(self.new_id))
        tmp += myutils.DataSize._boolean
        # print("  [*] new_id:{}".format(self.new_id))

        self.now_time = myutils.get_time(data[tmp:])
        tmp += myutils.DataSize._time
        # print("  [*] date:{}".format(self.now_time))

        self.snr = myutils.get_int32(data[tmp:])
        tmp += myutils.DataSize._int32
        # print("  [*] snr:{}".format(self.snr))

        self.delta_time = myutils.get_double(data[tmp:])
        tmp += myutils.DataSize._double
        # print("  [*] delta_time:{}".format(self.delta_time))

        # Something in here? Seems zero in the debug
        # myutils.debug_hex(data[tmp:])
        tmp += myutils.DataSize._uint32

        self.delta_freq = myutils.get_uint32(data[tmp:])
        tmp += myutils.DataSize._uint32
        # print("  [*] delta_freq:{}".format(self.delta_freq))

        self.drift = myutils.get_uint32(data[tmp:])
        tmp += myutils.DataSize._uint32
        # print("  [*] drift:{}".format(self.drift))

        string_length, self.callsign = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("  [*] callsign:{}".format(self.callsign))

        string_length, self.grid = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("  [*] grid:{}".format(self.grid))

        self.power = myutils.get_uint32(data[tmp:])
        # print("  [*] power:{}".format(self.power))

        self.dist = 0
        self.bearing = 0
        if (myutils.validate_callsign(self.callsign)):
            if (myutils.validate_locator(self.grid)):
                self.dist = locator.calculate_distance("io64", self.grid)
                self.bearing = locator.calculate_heading("io64", self.grid)
Exemplo n.º 3
0
    def __init__(self, data):
        string_length, self.id_key = myutils.get_utf8_string(data)

        tmp = 4 + string_length
        self.new_id = myutils.get_boolean(data[tmp:])

        tmp += 1
        self.now_time = myutils.get_time(data[tmp:])

        tmp += 4
        self.snr = myutils.get_int32(data[tmp:])

        tmp += 4
        self.delta_time = myutils.get_double(data[tmp:])

        tmp += 8
        self.delta_freq = myutils.get_uint32(data[tmp:])

        tmp += 4
        mode_len, self.mode = myutils.get_utf8_string(data[tmp:])

        tmp += (4 + mode_len)
        msg_len, self.message = myutils.get_utf8_string(data[tmp:])
Exemplo n.º 4
0
    def __init__(self, data):
        string_length, self.id_key = myutils.get_utf8_string(data)

        tmp = 4 + string_length
        self.new_id = myutils.get_boolean(data[tmp:])

        tmp += 1
        self.now_time = myutils.get_time(data[tmp:])

        tmp += 4
        self.snr = myutils.get_int32(data[tmp:])

        tmp += 4
        self.delta_time = myutils.get_double(data[tmp:])

        tmp += 8
        self.delta_freq = myutils.get_uint32(data[tmp:])

        tmp += 4
        mode_len, self.mode = myutils.get_utf8_string(data[tmp:])

        tmp += (4 + mode_len)
        msg_len, self.message = myutils.get_utf8_string(data[tmp:])
Exemplo n.º 5
0
    def __init__(self, data):
        string_length, self.id_key = myutils.get_utf8_string(data)
        # print("  id_key: {} (len:{})".format(self.id_key, string_length))
        tmp = 4 + string_length

        self.date_time = myutils.get_datetime(data[tmp:])
        tmp += 13
        # print("datetime:{}".format(self.date_time))

        string_length, self.dx_call = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("DX_Call:"+self.dx_call)

        string_length, self.dx_grid = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("dx_grid:"+self.dx_grid)

        self.dial_freq = myutils.get_int64(data[tmp:])
        tmp += 8
        # print("Dial:{}".format(self.dial_freq))

        string_length, self.mode = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("mode:"+self.mode)

        string_length, self.report_sent = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("report_sent:"+self.report_sent)

        string_length, self.report_recv = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("report_recv:"+self.report_recv)

        string_length, self.tx_power = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("rx_power:"+self.tx_power)

        string_length, self.name = myutils.get_utf8_string(data[tmp:])
Exemplo n.º 6
0
    def __init__(self, data):
        string_length, self.id_key = myutils.get_utf8_string(data)
        # print("  id_key: {} (len:{})".format(self.id_key, string_length))
        tmp = 4 + string_length

        self.date_time = myutils.get_datetime(data[tmp:])
        tmp += 13
        # print("datetime:{}".format(self.date_time))

        string_length, self.dx_call = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("DX_Call:"+self.dx_call)

        string_length, self.dx_grid = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("dx_grid:"+self.dx_grid)

        self.dial_freq = myutils.get_int64(data[tmp:])
        tmp += 8
        # print("Dial:{}".format(self.dial_freq))

        string_length, self.mode = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("mode:"+self.mode)

        string_length, self.report_sent = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("report_sent:"+self.report_sent)

        string_length, self.report_recv = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("report_recv:"+self.report_recv)

        string_length, self.tx_power = myutils.get_utf8_string(data[tmp:])
        tmp += 4 + string_length
        # print("rx_power:"+self.tx_power)

        string_length, self.name = myutils.get_utf8_string(data[tmp:])
Exemplo n.º 7
0
 def __init__(self, data):
     string_length, self.id_key = myutils.get_utf8_string(data)
Exemplo n.º 8
0
    def __init__(self, data):
        string_length, self.id_key = myutils.get_utf8_string(data)
        tmp = 4 + string_length

        self.max_schema = myutils.get_uint32(data[tmp:])
Exemplo n.º 9
0
    def __init__(self, data):
        string_length, self.id_key = myutils.get_utf8_string(data)
        tmp = 4 + string_length

        self.max_schema = myutils.get_uint32(data[tmp:])
Exemplo n.º 10
0
    def __init__(self, data):
        string_length, self.id_key = myutils.get_utf8_string(data)

        self.max_schema = struct.unpack(">L", data[4 + string_length:])[0]