Skip to content

Commit 353ff18

Browse files
committed
cubebel2 hotfix
1 parent b0bd77d commit 353ff18

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ The following protocols are currently supported:
3838
* `USP` - [Unified SPUTNIX protocol](https://sputnix.ru/tpl/docs/amateurs/%D0%9E%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%20%D0%BF%D1%80%D0%BE%D1%82%D0%BE%D0%BA%D0%BE%D0%BB%D0%B0%20USP%20v1.04.pdf)
3939
* `AX.25`
4040
* `CSP` - [Cubesat Space Protocol](https://github.com/libcsp/libcsp)
41-
* `CSUM` - [University Space Center of Montpellier platform (CSUM)](http://csu.edu.umontpellier.fr/)
4241
* `CubeBel-2`
4342
* `D-Star ONE` - [D-Star ONE Protocol](https://web.archive.org/web/20190807184852/http://www.d-star.one/downloads/D-Star%20ONE%20telemetry%20frame%20format.pdf)
4443
* `CitGardens-02` - [CIT Gardens-02 project](https://sites.google.com/view/gardens-02/english_ver/home)

README.ru.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ https://r4uab.ru/settings-soundmodem/
3838
* `USP` - [Unified SPUTNIX protocol](https://sputnix.ru/tpl/docs/amateurs/%D0%9E%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%20%D0%BF%D1%80%D0%BE%D1%82%D0%BE%D0%BA%D0%BE%D0%BB%D0%B0%20USP%20v1.04.pdf)
3939
* `AX.25`
4040
* `CSP` - [Cubesat Space Protocol](https://github.com/libcsp/libcsp)
41-
* `CSUM` - [University Space Center of Montpellier platform (CSUM)](http://csu.edu.umontpellier.fr/)
4241
* `CubeBel-2`
4342
* `D-Star ONE` - [D-Star ONE Protocol](https://web.archive.org/web/20190807184852/http://www.d-star.one/downloads/D-Star%20ONE%20telemetry%20frame%20format.pdf)
4443
* `CitGardens-02` - [CIT Gardens-02 project](https://sites.google.com/view/gardens-02/english_ver/home)

SatsDecoder/systems/cubebel2.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
'rst_cnt_total' / construct.Int8ul,
8585
'rst_cnt_iwdg' / construct.Int8ul,
8686
'adc_status' / construct.Hex(construct.Int8ul),
87-
'adc_temp_1' / construct.Int16ul,
88-
'adc_temp_2' / construct.Int16ul,
87+
'adc_temp_1' / temperature16u,
88+
'adc_temp_2' / temperature16u,
8989
'ant_1_v' / voltage16u,
9090
'ant_2_v' / voltage16u,
9191
'solar_common_v' / voltage16u,
@@ -220,6 +220,13 @@
220220
'command_seq_num' / construct.Int16ul,
221221
)
222222

223+
unknown = construct.Struct(
224+
'_name' / construct.Computed('unknown'),
225+
'name' / construct.Computed('Unknown'),
226+
227+
'data' / construct.Hex(construct.GreedyBytes),
228+
)
229+
223230
payloads = {
224231
CDM_VERSION_GET_ANS: cdm_version_get_ans,
225232
CDM_TELEMETRY_GET_ANS_MOTHERBOARD: cdm_telemetry_get_ans_motherboard,
@@ -234,11 +241,11 @@
234241
trx_beacon = construct.Struct(
235242
'beacon_id' / construct.Int8ul,
236243
'beacon_uptime' / common.TimeDeltaAdapter(construct.Int32ul),
237-
'beacon_vbus' / common.LinearAdapter(1000, construct.Int16ul),
244+
'beacon_vbus' / voltage16u,
238245
'beacon_reset_total_cnt' / construct.Int8ul,
239246
'beacon_reset_iwdg_cnt' / construct.Int8ul,
240247
'beacon_reset_iwdg_time' / common.TimeDeltaAdapter(construct.Int32ul),
241-
'beacon_pamp_temp' / common.LinearAdapter(100, construct.Int16ul),
248+
'beacon_pamp_temp' / common.LinearAdapter(1000, construct.Int16ul),
242249
'beacon_rx_settings' / construct.Int8ul,
243250
'beacon_rx_period_on' / construct.Int16ul,
244251
'beacon_rx_seqnum' / construct.Int16ul,
@@ -262,7 +269,7 @@
262269
'trx_beacon' / trx_beacon,
263270
'cdm_datalen' / construct.Int8ul,
264271
'cdm_header' / cdm_header,
265-
'cdm_payload' / construct.Switch(construct.this.cdm_header.cdm_id, payloads, default=construct.GreedyBytes),
272+
'cdm_payload' / construct.Switch(construct.this.cdm_header.cdm_id, payloads, default=unknown),
266273
'_tail' / construct.GreedyBytes,
267274
)
268275

@@ -485,6 +492,13 @@ class Cubebel2Protocol(common.Protocol):
485492
('command_seq_num', 'Command seq num'),
486493
),
487494
},
495+
'unknown': {
496+
'table': (
497+
*_beacon,
498+
('tlm_name', 'Unknown'),
499+
('data', 'Data'),
500+
),
501+
},
488502
}
489503

490504
def recognize(self, bb):
@@ -497,6 +511,8 @@ def recognize(self, bb):
497511
_trx_beacon.pop('_io', 0)
498512
_cdm_payload = {**data.frame.cdm_payload}
499513
_cdm_payload.pop('_io', 0)
514+
if _cdm_payload['_name'] == 'unknown':
515+
_cdm_payload['data'] = utils.bytes2hex(_cdm_payload['data'])
500516
d = utils.Dict(
501517
beacon_name='',
502518
**_trx_beacon,

0 commit comments

Comments
 (0)