[英]Unable to Capture Fingerprint using morpho fingerprint scanner device in android application
Morpho fingerprint scanner device Morpho指纹扫描仪设备
Type: CAPTURE类型:捕捉
content-type: text/xml Accept: text/xml内容类型:文本/xml 接受:文本/xml
When I am using this above API request in Advanced RestClient then I am getting the response shown above but when trying to achieve this by using OkHttpClient library in the android application but getting the following error:当我在 Advanced RestClient 中使用上述 API 请求时,我得到上面显示的响应,但是当我尝试通过在 android 应用程序中使用 OkHttpClient 库来实现此目的时,出现以下错误:
private void captureRdRequest(final String pidOpt, final String reqUrl) {
String pidOpt = "<PidOptions ver=\"1.0\"><Opts fCount=\"1\" fType=\"0\" iCount=\"\" iType=\"\" pCount=\"\" pType=\"\" format=\"1\" pidVer=\"2.0\" timeout=\"10000\" otp=\"\" wadh=\"$WADH\" posh=\"\"/></PidOptions>";
String url = "http://127.0.0.1:42200/capture";
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/xml");
RequestBody body = RequestBody.create(mediaType, pidOpt);
okhttp3.Request request = new okhttp3.Request.Builder()
.url(url)
.method("CAPTURE", body)
.addHeader("Content-Type", "text/xml")
.addHeader("Accept", "text/xml")
.build();
okhttp3.Response response = client.newCall(request).execute();
Log.d("sdf", response.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
});
thread.start();
}
failed to connect to /127.0.0.1 (port 42200) from /127.0.0.1 (port 42104) after 10000ms: isConnected failed: ECONNREFUSED (Connection refused)
Please help me with how to capture the fingerprint for the client app??请帮助我如何捕获客户端应用程序的指纹?
All Capture Ports you will get on 11100 Scan All Ports from 11100 to 11105 on the port when you get reply as device is ready consider this is my port it can be any device当您收到回复时,您将在 11100 上获得所有捕获端口扫描端口上从 11100 到 11105 的所有端口,因为设备已准备好考虑这是我的端口它可以是任何设备
Please try this, it's working fine for me.请试试这个,它对我来说很好用。
String pidOpt='<PidOptions ver=\"1.0\">'+'<Opts fCount=\"1\" fType=\"0\" iCount=\"0\" iType=\"0\" pCount=\"0\" pType=\"0\" format=\"0\" pidVer=\"2.0\" timeout=\"10000\" otp=\"\" wadh=\"\" posh=\"UNKNOWN\" env=\"PP\"/>'+'</PidOptions>';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.