package com.iflyings.android.fpgadetect; import android.util.Log; import com.xixun.display.MyLog; import com.xixun.display.backup.SendData; public class FpgaDetect { public SendData sendData; public FpgaDetect() { sendData = new SendData(); getRecvCardRamBuffer(0, 0, 0, 0L, null, 0); } /// /// 读取接收卡数据 /// /// 发送卡索引 /// 接收卡索引 /// 读取的地址,地址以4字节为单位 /// 读取的字节数(4字节对齐) /// 返回的读取数据 /// 错误码, 成功返回 0 private int getRecvCardRamBuffer(int netPort, int cardIndex, long vcsNumber, long memAddress, byte[] buffer, int size) { if (size == 0) { return 0; } if(sendData == null){ MyLog.e("sendData is null...."); } int i = sendData.vcs_dat_r_badPoint(netPort, cardIndex, vcsNumber, memAddress, buffer, size/4, 2); Log.i("zwf", "getRecvCardRamBuffer....."+i); return i; } /// /// 读取接收卡坏点信息 /// /// 发送卡索引 /// 接收卡索引 /// 箱体宽 /// 箱体高 /// 返回的点状态,每个点一个字节,坐标根据箱体宽高索引,bit6.7=unused, bit4.5=B, bit2.3=G,bit0.1=R,0表示正常,其它值表示异常 /// 错误码 public native int checkRecvCardBadPoint(int netPort, int cardIndex, long vcsNumber, int boxWidth, int boxHeight, byte[] array); static { System.loadLibrary("fpga-detect"); } }