File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from aprslib .packets .position import PositionReport
2+ from aprslib .packets .telemetry import TelemetryReport
Original file line number Diff line number Diff line change 1+ from aprslib .packets .base import APRSPacket
2+
3+ class TelemetryReport (APRSPacket ):
4+ format = 'raw'
5+ telemetry = dict (seq = 0 ,
6+ vals = ['0' ]* 6 )
7+ telemetry ['vals' ][5 ] = ['1' ]* 8 # Replace io data with list of 8 values
8+ comment = ''
9+
10+ def _serialize_body (self ):
11+ # What do we do when len(digitalvalue) != 8?
12+ tempio = '' .join (self .telemetry ['vals' ][5 ])
13+
14+ body = [
15+ str (self .telemetry ['seq' ]).zfill (3 ),
16+ str (self .telemetry ['vals' ][0 ]).zfill (3 ),
17+ str (self .telemetry ['vals' ][1 ]).zfill (3 ),
18+ str (self .telemetry ['vals' ][2 ]).zfill (3 ),
19+ str (self .telemetry ['vals' ][3 ]).zfill (3 ),
20+ str (self .telemetry ['vals' ][4 ]).zfill (3 ),
21+ str (tempio ),
22+ self .comment ,
23+ ]
24+ # Add packet type to body joined by commas
25+ return 'T#' + "," .join (body )
You can’t perform that action at this time.
0 commit comments