package gmt.common.ecc;

import java.util.Arrays;

public class ECC {
	public final static int CRC_LENGTH = 2;
	//------------------------------------------------------------------------------
	// |  Data(16) |   CRC(2)    | ECC(4)  |
	//------------------------------------------------------------------------------
	// RS(22,18) NPAR=4
	public final static int  DATA_LEN_X = 16;
	public final static int  NPAR_LEN_X = 4;
	public static int TOTAL_LEN_X;
	
	public ECC() {
		TOTAL_LEN_X = DATA_LEN_X + CRC_LENGTH + NPAR_LEN_X;
	}
	
	
	public int AppendRsCodeForTX(char[] vMsgData, int nMsgLen, int nRsLen, char[] pTxData) {
		
		return (nMsgLen + nRsLen);
	}
	
	public void RunRsTestCode(int nDataLen, int nRsLen, int nErrPos, int nErrCnt) {
		int i, nTotLen;
	    int nError;
	    char[] vMsgData = new char[256];
	    char[] vTxData = new char[256];
	    char[] vRxData = new char[256];
	    char[] vTempX = new char[256];
	    char[] wCrcValueX;
	    
	    nTotLen = nDataLen + CRC_LENGTH + nRsLen;
	    
	    Arrays.fill(vMsgData, 0, nDataLen-1, '1');

	}
}
