RYSEN/const.py
Simon 88334eaaf5 Adds support for new Bridge Control OPCODE - BCSQ
BCSQ is Source Quench or Squelch

When a stream id is received from more than one source on a TG
the system sends a BCSQ to all of the non-first systems to ask them
to stop sending this stream ID. This reduces network and CPU load. Also
packets can't loop of they arent even received!

Squashed commit of the following:

commit e5ba9ece5d84e56096c459139fb39eba16249f96
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Apr 12 23:16:30 2021 +0100

    Tidy up log handling for streams

commit fc1e4bd91f0e576e8c58e84cf4b96f00ce6ec933
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Apr 12 22:56:45 2021 +0100

    Fix target port (BCKA)

commit 27e046e5efe744679c7652f65135cf3129481092
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Apr 12 22:50:35 2021 +0100

    Handle keyerror

commit 99c660fa813a300940b16e55d840218f1868cadb
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Apr 12 22:45:05 2021 +0100

    Stream trimmer for BCSQ

commit 9d6102be13813b27b752192e29e94d5eafbbb934
Author: Simon <simon@gb7fr.org.uk>
Date:   Mon Apr 12 21:32:54 2021 +0100

    Brack

commit 2f8a8cf620153cb0138e970c0dcd85328a47521c
Merge: f77a68a 17b6968
Author: Simon <simon@gb7fr.org.uk>
Date:   Sun Apr 11 22:16:38 2021 +0100

    Merge branch 'master' into bcsq

commit f77a68a96297fe050609b8ee5fb56b0866ec78f4
Merge: 7f4c6f5 9a3e5fb
Author: Simon <simon@gb7fr.org.uk>
Date:   Fri Apr 9 01:39:54 2021 +0100

    Merge branch 'master' into bcsq

commit 7f4c6f5375b589aa78e74f0002448afe95a625a2
Author: Simon <simon@gb7fr.org.uk>
Date:   Thu Apr 8 18:35:08 2021 +0100

    c

commit c0904242e0f532c26e33bdd9cba8d1bea5329abc
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Apr 6 19:05:40 2021 +0100

    only try to quench the source once

commit 2748d0cf7c5557522a5b2d0d9e3b37e294711910
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Apr 6 18:56:05 2021 +0100

    Comment out check for enahnced to tes

commit fa43a09db73862343f0f70a367786c4d77aaf9b9
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Apr 6 18:51:19 2021 +0100

    Dst id not tgid

commit f02df6edf10cfa936147b0862671ed949a820785
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Apr 6 18:48:44 2021 +0100

    More BCSQ

commit adf3bb4059f0710848f8e3349722141836889c41
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Apr 6 18:44:15 2021 +0100

    more BCKA fixes

commit b4dc518d9b74a0d8c83b3b1bb17d7de4d04b9915
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Apr 6 18:42:13 2021 +0100

    Fix broken BKCA

commit 637d772dbadb346ad49d5b80d8299c13b0fbfc79
Author: Simon <simon@gb7fr.org.uk>
Date:   Tue Apr 6 18:38:17 2021 +0100

    More work on BCSQ
2021-04-12 23:28:01 +01:00

79 lines
2.2 KiB
Python
Executable File

#!/usr/bin/env python
#
###############################################################################
# Copyright (C) 2016-2018 Cortney T. Buffington, N0MJS <n0mjs@me.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
###############################################################################
'''
These are contants used by HBlink. Rather than stuff them into the main program
file, any new constants should be placed here. It makes them easier to keep track
of and keeps hblink.py shorter.
'''
__author__ = 'Cortney T. Buffington, N0MJS'
__copyright__ = 'Copyright (c) 2016 Cortney T. Buffington, N0MJS and the K0USY Group'
__credits__ = ''
__license__ = 'GNU GPLv3'
__maintainer__ = 'Cort Buffington, N0MJS'
__email__ = 'n0mjs@me.com'
# DMR Related constants
ID_MIN = 1
ID_MAX = 16776415
# Timers
STREAM_TO = .360
# Options from the LC - used for late entry
LC_OPT = b'\x00\x00\x20'
# HomeBrew Protocol Frame Types
HBPF_VOICE = 0x0
HBPF_VOICE_SYNC = 0x1
HBPF_DATA_SYNC = 0x2
HBPF_SLT_VHEAD = 0x1
HBPF_SLT_VTERM = 0x2
# HomeBrew Protocol Commands
DMRD = b'DMRD'
MSTCL = b'MSTCL'
MSTNAK = b'MSTNAK'
MSTPONG = b'MSTPONG'
MSTN = b'MSTN'
MSTP = b'MSTP'
MSTC = b'MSTC'
RPTL = b'RPTL'
RPTPING = b'RPTPING'
RPTCL = b'RPTCL'
RPTL = b'RPTL'
RPTACK = b'RPTACK'
RPTK = b'RPTK'
RPTC = b'RPTC'
RPTP = b'RPTP'
RPTA = b'RPTA'
RPTO = b'RPTO'
DMRA = b'DMRA'
#Bridge Control commands
BC = b'BC'
BCKA = b'BCKA'
BCSQ = b'BCSQ'
# Higheset peer ID permitted by HBP
PEER_MAX = 4294967295