display2.0/app/src/main/java/com/iflyings/android/fpgadetect/FpgaDetect.java
2024-09-03 08:41:23 +08:00

51 lines
1.9 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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=R0表示正常其它值表示异常</param>
/// <returns>错误码</returns>
public native int checkRecvCardBadPoint(int netPort, int cardIndex, long vcsNumber, int boxWidth, int boxHeight, byte[] array);
static {
System.loadLibrary("fpga-detect");
}
}