Initial commit with telemetry unit label support

Committing initial code that supports the generation of an APRS unit/label
string. This was testing by sending telemetry labels to APRS-IS and
checked on aprs.fi. Not cleaned up yet.
This commit is contained in:
Bryce Salmi 2017-03-11 10:49:55 -08:00
parent fa63671ae9
commit 7e4da837ad
2 changed files with 44 additions and 0 deletions

View File

@ -1,2 +1,3 @@
from aprslib.packets.position import PositionReport
from aprslib.packets.telemetry import TelemetryReport
from aprslib.packets.telemetryunitlabels import TelemetryUnitLabelsReport

View File

@ -0,0 +1,43 @@
from aprslib.packets.base import APRSPacket
class TelemetryUnitLabelsReport(APRSPacket):
format = 'raw'
telemetrystation = "N0CALL"
a1 = "BITS"
a2 = "BITS"
a3 = "BITS"
a4 = "BITS"
a5 = "BITS"
b1 = "EN"
b2 = "EN"
b3 = "EN"
b4 = "EN"
b5 = "EN"
b6 = "EN"
b7 = "EN"
b8 = "EN"
comment = ''
def _serialize_body(self):
body = [
':{0} :UNIT.'.format(self.telemetrystation), # packet type
self.a1,
self.a2,
self.a3,
self.a4,
self.a5,
self.b1,
self.b2,
self.b3,
self.b4,
self.b5,
self.b6,
self.b7,
self.b8,
]
tmpbody = ",".join(body)
badcomma = tmpbody.index(",")
# remove static but erroneous comma between UNIT. and a1 value
return tmpbody[:badcomma] + tmpbody[badcomma+1:]