Exemple #1
0
    def send(self, frm):
        r = False

        if self.phase == 9:
            w = chr(0) + dixpcommon.txt2raw(frm)
            s = chr(self.chanr) + 3 * chr(0) + 'K' + 23 * chr(0)
            s += chr(len(w) % 256) + chr(len(w) / 256) + 6 * chr(0) + w

            try:
                self.sockt.send(s)
            except socket.error:
                self.phase = 10
                r = True

        return r
Exemple #2
0
                            for i in range(0, len(soccc)):
                                try:
                                    soccc[i].sendto(stcc,
                                                    (udpcc[i][0], udpcc[i][1]))
                                except (socket.error, socket.gaierror):
                                    pass

            else:
                # No data received, do lower priority jobs
                if socrx <> None:
                    s = socrx.receive()

                    if s <> None:
                        # Data to send
                        if s[0] == 'D':
                            raw = dixpcommon.txt2raw(s[1:])
                            w = b2a(chr(0) + raw)

                            if ptt:
                                _ax25.RawTx(soc, w, len(w), axdev)

                                if soccc <> []:
                                    stcc = "DIXPRS2201|" + mycall + "|T" + dev + "|" + s[
                                        1:]

                                    for i in range(0, len(soccc)):
                                        try:
                                            soccc[i].sendto(
                                                stcc,
                                                (udpcc[i][0], udpcc[i][1]))
                                        except (socket.error, socket.gaierror):