<commit_before>package ru.r2cloud.jradio.swampsat2;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;

import ru.r2cloud.jradio.Beacon;
import ru.r2cloud.jradio.ax25.Header;
import ru.r2cloud.jradio.fec.ccsds.UncorrectableException;
import ru.r2cloud.jradio.util.LittleEndianDataInputStream;

public class Swampsat2Beacon extends Beacon {

	private static final byte[] ACKNOWLEDGE_BODY = new byte[] { (byte) 0x47, (byte) 0x61, (byte) 0x74, (byte) 0x6f, (byte) 0x72, (byte) 0x20, (byte) 0x4e, (byte) 0x61, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x20, (byte) 0x49, (byte) 0x73, (byte) 0x20, (byte) 0x45, (byte) 0x76, (byte) 0x65, (byte) 0x72, (byte) 0x79, (byte) 0x77, (byte) 0x68, (byte) 0x65, (byte) 0x72, (byte) 0x65, (byte) 0x21, (byte) 0x20, (byte) 0x46, (byte) 0x72, (byte) 0x6f, (byte) 0x6d, (byte) 0x20,
			(byte) 0x53, (byte) 0x77, (byte) 0x61, (byte) 0x6d, (byte) 0x70, (byte) 0x53, (byte) 0x61, (byte) 0x74, (byte) 0x20, (byte) 0x49, 0x49 };

	private Header header;
	private Boolean acknowledge;
	private Eps eps;
	private Battery battery;
	private Vutrx vutrx;
	private Antennas antennas;
	private Stx stx;
	private byte[] unknownPayload;

	@Override
	public void readBeacon(byte[] data) throws IOException, UncorrectableException {
		DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data));
		header = new Header(dis);
		LittleEndianDataInputStream ldis = new LittleEndianDataInputStream(dis);
		if (isAckMessage(data)) {
			acknowledge = true;
			return;
		} else if (dis.available() == 185) {
			eps = new Eps(ldis);
			battery = new Battery(ldis);
			vutrx = new Vutrx(ldis);
			antennas = new Antennas(ldis);
			stx = new Stx(ldis);
		} else if (dis.available() == 163) {
			eps = new Eps(ldis);
			battery = new Battery(ldis);
			vutrx = new Vutrx(ldis);
			antennas = new Antennas(ldis);
		} else {<commit_msg>fixing code smells<commit_after>package ru.r2cloud.jradio.swampsat2;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;

import ru.r2cloud.jradio.Beacon;
import ru.r2cloud.jradio.ax25.Header;
import ru.r2cloud.jradio.fec.ccsds.UncorrectableException;
import ru.r2cloud.jradio.util.LittleEndianDataInputStream;

public class Swampsat2Beacon extends Beacon {

	private static final byte[] ACKNOWLEDGE_BODY = new byte[] { (byte) 0x47, (byte) 0x61, (byte) 0x74, (byte) 0x6f, (byte) 0x72, (byte) 0x20, (byte) 0x4e, (byte) 0x61, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x20, (byte) 0x49, (byte) 0x73, (byte) 0x20, (byte) 0x45, (byte) 0x76, (byte) 0x65, (byte) 0x72, (byte) 0x79, (byte) 0x77, (byte) 0x68, (byte) 0x65, (byte) 0x72, (byte) 0x65, (byte) 0x21, (byte) 0x20, (byte) 0x46, (byte) 0x72, (byte) 0x6f, (byte) 0x6d, (byte) 0x20,
			(byte) 0x53, (byte) 0x77, (byte) 0x61, (byte) 0x6d, (byte) 0x70, (byte) 0x53, (byte) 0x61, (byte) 0x74, (byte) 0x20, (byte) 0x49, 0x49 };

	private Header header;
	private Boolean acknowledge;
	private Eps eps;
	private Battery battery;
	private Vutrx vutrx;
	private Antennas antennas;
	private Stx stx;
	private byte[] unknownPayload;

	@Override
	public void readBeacon(byte[] data) throws IOException, UncorrectableException {
		DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data));
		header = new Header(dis);
		LittleEndianDataInputStream ldis = new LittleEndianDataInputStream(dis);
		if (isAckMessage(data)) {
			acknowledge = true;
		} else if (dis.available() == 185) {
			eps = new Eps(ldis);
			battery = new Battery(ldis);
			vutrx = new Vutrx(ldis);
			antennas = new Antennas(ldis);
			stx = new Stx(ldis);
		} else if (dis.available() == 163) {
			eps = new Eps(ldis);
			battery = new Battery(ldis);
			vutrx = new Vutrx(ldis);
			antennas = new Antennas(ldis);
		} else {
{'fraction_non_alphanumeric': 0.14050235478806908, 'fraction_numerical': 0.07326007326007326, 'mean_word_length': 4.982785602503912, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4263200', 'n_tokens_mistral': 1799, 'n_tokens_neox': 1533, 'n_words': 401}