51 lines
1.9 KiB
Java
51 lines
1.9 KiB
Java
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);
|
||
}
|
||
/// <summary>
|
||
/// 读取接收卡数据
|
||
/// </summary>
|
||
/// <param name="netPort">发送卡索引</param>
|
||
/// <param name="cardIndex">接收卡索引</param>
|
||
/// <param name="memAddress">读取的地址,地址以4字节为单位</param>
|
||
/// <param name="size">读取的字节数(4字节对齐)</param>
|
||
/// <param name="buffer">返回的读取数据</param>
|
||
/// <returns>错误码, 成功返回 0</returns>
|
||
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;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 读取接收卡坏点信息
|
||
/// </summary>
|
||
/// <param name="netPort">发送卡索引</param>
|
||
/// <param name="cardIndex">接收卡索引</param>
|
||
/// <param name="boxWidth">箱体宽</param>
|
||
/// <param name="boxHeight">箱体高</param>
|
||
/// <param name="array">返回的点状态,每个点一个字节,坐标根据箱体宽高索引,bit6.7=unused, bit4.5=B, bit2.3=G,bit0.1=R,0表示正常,其它值表示异常</param>
|
||
/// <returns>错误码</returns>
|
||
public native int checkRecvCardBadPoint(int netPort, int cardIndex, long vcsNumber, int boxWidth, int boxHeight, byte[] array);
|
||
|
||
static {
|
||
System.loadLibrary("fpga-detect");
|
||
}
|
||
} |