MCPcopy Create free account
hub / github.com/SatDump/SatDump / work

Method work

plugins/cluster_support/cluster/instruments/wbd_decoder.cpp:5–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3namespace cluster
4{
5 std::vector<MajorFrame> WBDdecoder::work(uint8_t *frm)
6 {
7 std::vector<MajorFrame> outputframes;
8
9 if (frm[3] % 4 == 0)
10 {
11 if (wbdwip.payload.size() == 1090 * 4 - 8)
12 outputframes.push_back(wbdwip);
13 wbdwip = MajorFrame();
14 }
15 else if (frm[3] % 4 == 1)
16 {
17 wbdwip.antennaselect = (frm[5] >> 4) & 0b11; // 0 Ez, 1 Bz, 2 By, 3 Ey
18 wbdwip.convfreq = (frm[5] >> 2) & 0b11; // conversion freq, 0, 125.454, 250.908, 501.816k
19 wbdwip.hgagc = frm[5] & 0b11; // Higher AGC select
20 wbdwip.commands = frm[5] >> 5 & 0b1; // Command Status (0=No cmds; 1=Cmds received)
21 wbdwip.OBDH = frm[5] >> 6 & 0b1; // OBDH Interface (0=Primary; 1=Redundant)
22 wbdwip.ADpower = frm[5] >> 4 & 0b1; // seems to be always on
23 wbdwip.VCXO = frm[5] >> 7; // locked unlocked, 0 is locked
24 }
25 else if (frm[3] % 4 == 2)
26 {
27
28 wbdwip.AGC = frm[4] >> 5 & 0b1; // AGC MAN/AUTO 0 for Auto, 1 for Manual
29 wbdwip.gainlevel = frm[4] >> 1 & 0b1111; // Gain, 16steps as per 3.2.2.4-1
30 wbdwip.antennaselect = (frm[5] >> 4) & 0b11; // 0 Ez, 1 Bz, 2 By, 3 Ey
31 wbdwip.convfreq = (frm[5] >> 2) & 0b11; // conversion freq, 0, 125.454, 250.908, 501.816k
32 wbdwip.hgagc = frm[5] & 0b11; // Higher AGC select
33 }
34 else if (frm[3] % 4 == 3)
35 {
36 wbdwip.commands = frm[5] >> 5 & 0b1; // Command Status (0=No cmds; 1=Cmds received)
37 wbdwip.OBDH = frm[5] >> 6 & 0b1; // OBDH Interface (0=Primary; 1=Redundant)
38 wbdwip.ADpower = frm[5] >> 4 & 0b1; // seems to be always on
39 wbdwip.VCXO = frm[5] >> 7; // locked unlocked, 0 is locked
40 wbdwip.outputmode = frm[4] >> 2 & 0b111; // sampling rate, bit depth, duty cycle as per 3.2.2.5-1
41 wbdwip.lwagc = frm[4] & 0b11; // Lower AGC select
42 }
43
44 for (int i = 6; i < 1096; i++)
45 if (i != 88 && i != 89)
46 wbdwip.payload.push_back(frm[i]);
47
48 return outputframes;
49 }
50}

Callers 3

processMethod · 0.45
processMethod · 0.45
processMethod · 0.45

Calls 2

MajorFrameClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected