Skip to content

Commit

Permalink
add support for eirsat-1 beacons
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Aug 13, 2024
1 parent b621fb9 commit 38e8d76
Show file tree
Hide file tree
Showing 31 changed files with 3,332 additions and 9 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,11 @@ jradio has lots of built-in satellite decoders. Some of them have non standard d
<td>58470</td>
<td>ru.r2cloud.jradio.enso.EnsoBeacon</td>
</tr>
<tr>
<td>EIRSAT-1</td>
<td>58472</td>
<td>ru.r2cloud.jradio.eirsat.EirsatBeacon</td>
</tr>
</tbody>
</table>

Expand Down
44 changes: 37 additions & 7 deletions src/main/java/ru/r2cloud/jradio/ccsds/PacketSecondaryHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,56 @@

public class PacketSecondaryHeader {

private int pusHeader;
public static final int SIZE_BYTES = 3;

private Boolean ccsdsSecondaryHeader;
private int pusVersion;
private Integer ack;
private int serviceType;
private int serviceSubType;

public PacketSecondaryHeader() {
// do nothing
}

public PacketSecondaryHeader(BitInputStream bis) throws IOException {
pusHeader = bis.readUnsignedByte();
public PacketSecondaryHeader(BitInputStream bis, boolean telemetry) throws IOException {
if (telemetry) {
bis.skipBits(1);
} else {
ccsdsSecondaryHeader = bis.readBoolean();
}
pusVersion = bis.readUnsignedInt(3);
if (telemetry) {
bis.skipBits(4);
} else {
ack = bis.readUnsignedInt(4);
}
serviceType = bis.readUnsignedByte();
serviceSubType = bis.readUnsignedByte();
}

public int getPusHeader() {
return pusHeader;
public Boolean getCcsdsSecondaryHeader() {
return ccsdsSecondaryHeader;
}

public void setCcsdsSecondaryHeader(Boolean ccsdsSecondaryHeader) {
this.ccsdsSecondaryHeader = ccsdsSecondaryHeader;
}

public int getPusVersion() {
return pusVersion;
}

public void setPusVersion(int pusVersion) {
this.pusVersion = pusVersion;
}

public Integer getAck() {
return ack;
}

public void setPusHeader(int pusHeader) {
this.pusHeader = pusHeader;
public void setAck(Integer ack) {
this.ack = ack;
}

public int getServiceType() {
Expand Down
87 changes: 87 additions & 0 deletions src/main/java/ru/r2cloud/jradio/eirsat/Adcs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package ru.r2cloud.jradio.eirsat;

import java.io.IOException;

import ru.r2cloud.jradio.util.BitInputStream;

public class Adcs {

private AdcsMode packedadcsmode0;
private int executioncount0;
private float rawgyrorate0;
private float rawgyrorate1;
private float rawgyrorate2;
private float fss1alphaangle0;
private float fss1betaangle0;

public Adcs() {
// do nothing
}

public Adcs(BitInputStream dis) throws IOException {
packedadcsmode0 = AdcsMode.valueOfCode(dis.readUnsignedByte());
executioncount0 = dis.readUnsignedShort();
rawgyrorate0 = dis.readShort() * -0.0104166f;
rawgyrorate1 = dis.readShort() * -0.0104166f;
rawgyrorate2 = dis.readShort() * -0.0104166f;
fss1alphaangle0 = dis.readFloat();
fss1betaangle0 = dis.readFloat();
}

public AdcsMode getPackedadcsmode0() {
return packedadcsmode0;
}

public void setPackedadcsmode0(AdcsMode packedadcsmode0) {
this.packedadcsmode0 = packedadcsmode0;
}

public int getExecutioncount0() {
return executioncount0;
}

public void setExecutioncount0(int executioncount0) {
this.executioncount0 = executioncount0;
}

public float getRawgyrorate0() {
return rawgyrorate0;
}

public void setRawgyrorate0(float rawgyrorate0) {
this.rawgyrorate0 = rawgyrorate0;
}

public float getRawgyrorate1() {
return rawgyrorate1;
}

public void setRawgyrorate1(float rawgyrorate1) {
this.rawgyrorate1 = rawgyrorate1;
}

public float getRawgyrorate2() {
return rawgyrorate2;
}

public void setRawgyrorate2(float rawgyrorate2) {
this.rawgyrorate2 = rawgyrorate2;
}

public float getFss1alphaangle0() {
return fss1alphaangle0;
}

public void setFss1alphaangle0(float fss1alphaangle0) {
this.fss1alphaangle0 = fss1alphaangle0;
}

public float getFss1betaangle0() {
return fss1betaangle0;
}

public void setFss1betaangle0(float fss1betaangle0) {
this.fss1betaangle0 = fss1betaangle0;
}

}
57 changes: 57 additions & 0 deletions src/main/java/ru/r2cloud/jradio/eirsat/AdcsArray.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package ru.r2cloud.jradio.eirsat;

import java.io.IOException;

import ru.r2cloud.jradio.util.BitInputStream;

public class AdcsArray {

private float temperature1Plusx;
private float temperature4Minusx;
private float temperature3Plusy;
private float temperature2Minusy;

public AdcsArray() {
// do nothing
}

public AdcsArray(BitInputStream dis) throws IOException {
temperature1Plusx = dis.readUnsignedShort() * 0.007629f - 272.15f;
temperature4Minusx = dis.readUnsignedShort() * 0.007629f - 272.15f;
temperature3Plusy = dis.readUnsignedShort() * 0.007629f - 272.15f;
temperature2Minusy = dis.readUnsignedShort() * 0.007629f - 272.15f;
}

public float getTemperature1Plusx() {
return temperature1Plusx;
}

public void setTemperature1Plusx(float temperature1Plusx) {
this.temperature1Plusx = temperature1Plusx;
}

public float getTemperature4Minusx() {
return temperature4Minusx;
}

public void setTemperature4Minusx(float temperature4Minusx) {
this.temperature4Minusx = temperature4Minusx;
}

public float getTemperature3Plusy() {
return temperature3Plusy;
}

public void setTemperature3Plusy(float temperature3Plusy) {
this.temperature3Plusy = temperature3Plusy;
}

public float getTemperature2Minusy() {
return temperature2Minusy;
}

public void setTemperature2Minusy(float temperature2Minusy) {
this.temperature2Minusy = temperature2Minusy;
}

}
22 changes: 22 additions & 0 deletions src/main/java/ru/r2cloud/jradio/eirsat/AdcsMode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package ru.r2cloud.jradio.eirsat;

public enum AdcsMode {

STANDBY(0), DETUMBLE(1), STABILISED(2), TEST(85), UNKNOWN(255);

private final int code;

private AdcsMode(int code) {
this.code = code;
}

public static AdcsMode valueOfCode(int code) {
for (AdcsMode cur : values()) {
if (cur.code == code) {
return cur;
}
}
return UNKNOWN;
}

}
107 changes: 107 additions & 0 deletions src/main/java/ru/r2cloud/jradio/eirsat/Bat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package ru.r2cloud.jradio.eirsat;

import java.io.IOException;

import ru.r2cloud.jradio.util.BitInputStream;

public class Bat {

private float batterycurrent2;
private float batteryvoltage2;
private float batterytemperature0;
private float batterytemperature1;
private float batterytemperature2;
private boolean batterycurrentdir0;
private boolean packedheaterstatus0;
private boolean packedheaterstatus1;
private boolean packedheaterstatus2;

public Bat() {
// do nothing
}

public Bat(BitInputStream dis) throws IOException {
batterycurrent2 = dis.readUnsignedInt(10) * 14.662757f;
batteryvoltage2 = dis.readUnsignedInt(10) * 0.008993f;
batterytemperature0 = dis.readUnsignedInt(10) * 0.3976f - 238.57f;
batterytemperature1 = dis.readUnsignedInt(10) * 0.3976f - 238.57f;
batterytemperature2 = dis.readUnsignedInt(10) * 0.3976f - 238.57f;
batterycurrentdir0 = dis.readBoolean();
packedheaterstatus0 = dis.readBoolean();
packedheaterstatus1 = dis.readBoolean();
packedheaterstatus2 = dis.readBoolean();
}

public float getBatterycurrent2() {
return batterycurrent2;
}

public void setBatterycurrent2(float batterycurrent2) {
this.batterycurrent2 = batterycurrent2;
}

public float getBatteryvoltage2() {
return batteryvoltage2;
}

public void setBatteryvoltage2(float batteryvoltage2) {
this.batteryvoltage2 = batteryvoltage2;
}

public float getBatterytemperature0() {
return batterytemperature0;
}

public void setBatterytemperature0(float batterytemperature0) {
this.batterytemperature0 = batterytemperature0;
}

public float getBatterytemperature1() {
return batterytemperature1;
}

public void setBatterytemperature1(float batterytemperature1) {
this.batterytemperature1 = batterytemperature1;
}

public float getBatterytemperature2() {
return batterytemperature2;
}

public void setBatterytemperature2(float batterytemperature2) {
this.batterytemperature2 = batterytemperature2;
}

public boolean isBatterycurrentdir0() {
return batterycurrentdir0;
}

public void setBatterycurrentdir0(boolean batterycurrentdir0) {
this.batterycurrentdir0 = batterycurrentdir0;
}

public boolean isPackedheaterstatus0() {
return packedheaterstatus0;
}

public void setPackedheaterstatus0(boolean packedheaterstatus0) {
this.packedheaterstatus0 = packedheaterstatus0;
}

public boolean isPackedheaterstatus1() {
return packedheaterstatus1;
}

public void setPackedheaterstatus1(boolean packedheaterstatus1) {
this.packedheaterstatus1 = packedheaterstatus1;
}

public boolean isPackedheaterstatus2() {
return packedheaterstatus2;
}

public void setPackedheaterstatus2(boolean packedheaterstatus2) {
this.packedheaterstatus2 = packedheaterstatus2;
}

}
22 changes: 22 additions & 0 deletions src/main/java/ru/r2cloud/jradio/eirsat/BootImage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package ru.r2cloud.jradio.eirsat;

public enum BootImage {

FAILSAFE(0), PRIMARY1(1), PRIMARY2(2), UNKNOWN(255);

private final int code;

private BootImage(int code) {
this.code = code;
}

public static BootImage valueOfCode(int code) {
for (BootImage cur : values()) {
if (cur.code == code) {
return cur;
}
}
return UNKNOWN;
}

}
Loading

0 comments on commit 38e8d76

Please sign in to comment.