-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6ab41d
commit b621fb9
Showing
7 changed files
with
845 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
package ru.r2cloud.jradio.enso; | ||
|
||
import java.io.DataInputStream; | ||
import java.io.IOException; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
import ru.r2cloud.jradio.ax25.Ax25Beacon; | ||
import ru.r2cloud.jradio.fec.ccsds.UncorrectableException; | ||
import ru.r2cloud.jradio.util.LittleEndianDataInputStream; | ||
|
||
public class EnsoBeacon extends Ax25Beacon { | ||
|
||
private int size; | ||
private int frameType; | ||
private long ts; | ||
private Obdh obdh; | ||
private Eps eps; | ||
private Ttc ttc; | ||
private byte[] customPayload; | ||
private String tweet; | ||
|
||
@Override | ||
public void readBeacon(DataInputStream dis) throws IOException, UncorrectableException { | ||
size = dis.readUnsignedByte(); | ||
frameType = dis.readUnsignedByte(); | ||
LittleEndianDataInputStream ldis = new LittleEndianDataInputStream(dis); | ||
ts = ldis.readUnsignedInt(); | ||
obdh = new Obdh(ldis); | ||
eps = new Eps(ldis); | ||
ttc = new Ttc(ldis); | ||
customPayload = new byte[48]; | ||
dis.readFully(customPayload); | ||
if (dis.available() > 0) { | ||
byte[] tweetBytes = new byte[dis.available()]; | ||
tweet = new String(tweetBytes, StandardCharsets.US_ASCII).trim(); | ||
if (tweet.length() == 0) { | ||
tweet = null; | ||
} | ||
} | ||
} | ||
|
||
public int getSize() { | ||
return size; | ||
} | ||
|
||
public void setSize(int size) { | ||
this.size = size; | ||
} | ||
|
||
public int getFrameType() { | ||
return frameType; | ||
} | ||
|
||
public void setFrameType(int frameType) { | ||
this.frameType = frameType; | ||
} | ||
|
||
public long getTs() { | ||
return ts; | ||
} | ||
|
||
public void setTs(long ts) { | ||
this.ts = ts; | ||
} | ||
|
||
public Obdh getObdh() { | ||
return obdh; | ||
} | ||
|
||
public void setObdh(Obdh obdh) { | ||
this.obdh = obdh; | ||
} | ||
|
||
public Eps getEps() { | ||
return eps; | ||
} | ||
|
||
public void setEps(Eps eps) { | ||
this.eps = eps; | ||
} | ||
|
||
public Ttc getTtc() { | ||
return ttc; | ||
} | ||
|
||
public void setTtc(Ttc ttc) { | ||
this.ttc = ttc; | ||
} | ||
|
||
public byte[] getCustomPayload() { | ||
return customPayload; | ||
} | ||
|
||
public void setCustomPayload(byte[] customPayload) { | ||
this.customPayload = customPayload; | ||
} | ||
|
||
public String getTweet() { | ||
return tweet; | ||
} | ||
|
||
public void setTweet(String tweet) { | ||
this.tweet = tweet; | ||
} | ||
|
||
} |
Oops, something went wrong.