Ejemplo n.º 1
0
    def send_position(self, timestamp, addr, lat, lon, alt, nsvel, ewvel, vrate,
                      callsign, squawk, error_est, nstations, anon):
        if not self.connected:
            return

        if anon:
            df = DF18ANON
        else:
            df = DF18

        if lat is None or lon is None:
            if alt is not None:
                self.send_frame(make_altitude_only_frame(addr, alt, df=df))
        else:
            even, odd = make_position_frame_pair(addr, lat, lon, alt, df=df)
            self.send_frame(even)
            self.send_frame(odd)

        if nsvel is not None or ewvel is not None or vrate is not None:
            self.send_frame(make_velocity_frame(addr, nsvel, ewvel, vrate, df=df))
Ejemplo n.º 2
0
    def send_position(self, timestamp, addr, lat, lon, alt, nsvel, ewvel, vrate,
                      callsign, squawk, error_est, nstations, anon):
        if not self.connected:
            return

        if anon:
            df = DF18ANON
        else:
            df = DF18

        if lat is None or lon is None:
            if alt is not None:
                self.send_frame(make_altitude_only_frame(addr, alt, df=df))
        else:
            even, odd = make_position_frame_pair(addr, lat, lon, alt, df=df)
            self.send_frame(even)
            self.send_frame(odd)

        if nsvel is not None or ewvel is not None or vrate is not None:
            self.send_frame(make_velocity_frame(addr, nsvel, ewvel, vrate, df=df))