Added TelemetrySenseProjectReport
This function sends out only digital IO status telemetry as well as a project name that effectively describes what the APRS station is meant to do.
This commit is contained in:
parent
f992ccfb84
commit
5e7701144f
|
|
@ -2,4 +2,5 @@ from aprslib.packets.position import PositionReport
|
|||
from aprslib.packets.telemetry import TelemetryReport
|
||||
from aprslib.packets.telemetryunitlabels import TelemetryUnitLabelsReport
|
||||
from aprslib.packets.telemetryparameters import TelemetryParametersReport
|
||||
from aprslib.packets.telemetryequations import TelemetryEquationsReport
|
||||
from aprslib.packets.telemetryequations import TelemetryEquationsReport
|
||||
from aprslib.packets.telemetrysenseproject import TelemetrySenseProjectReport
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
from aprslib.packets.base import APRSPacket
|
||||
|
||||
class TelemetrySenseProjectReport(APRSPacket):
|
||||
format = 'raw'
|
||||
telemetrystation = "N0CALL"
|
||||
digitalvalue = ['0']*8
|
||||
project = ''
|
||||
|
||||
def _serialize_body(self):
|
||||
# What do we do when len(digitalvalue) != 8?
|
||||
self.digitalvalue = ''.join(self.digitalvalue)
|
||||
|
||||
body = [
|
||||
':{0} :BITS.'.format(self.telemetrystation), # packet type
|
||||
str(self.digitalvalue),
|
||||
self.project,
|
||||
]
|
||||
tmpbody = ",".join(body)
|
||||
badcomma = tmpbody.index(",")
|
||||
|
||||
# remove static but erroneous comma between BITS. and digitalvalue
|
||||
# Position can vary due to callsign
|
||||
return tmpbody[:badcomma] + tmpbody[badcomma + 1:]
|
||||
Loading…
Reference in New Issue