瀏覽代碼

'2023年5月16日18:10:13'

master
wq 2 年之前
父節點
當前提交
2d14318fb8

二進制
app/debug/KyushuETC1.0_v1.0.8_debug.apk 查看文件


+ 0
- 18
app/debug/output-metadata.json 查看文件

@@ -1,18 +0,0 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.huntersun.vkyes.etcopencard",
"variantName": "processDebugResources",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 10,
"versionName": "1.0.8",
"outputFile": "KyushuETC1.0_v1.0.8_debug.apk"
}
]
}

+ 1
- 1
app/src/main/java/com/huntersun/vkyes/etcopencard/project/api/MyRetrofit.java 查看文件

@@ -48,7 +48,7 @@ import retrofit2.converter.scalars.ScalarsConverterFactory;
public class MyRetrofit implements ToastAction {
//是否设置缓存
private static final boolean Cache = false;
// private static final String Url = "192.168.100.63"; //8087
// private static final String Url = "192.168.100.63"; //8087 ENSURING_PROFITS
private static final String Url = "222.85.144.89"; //19002

public static final String PORT = "192.168.100.63".equals(Url) ? "8087" : "19002";

+ 0
- 1
app/src/main/java/com/huntersun/vkyes/etcopencard/project/copapply/OBURequest.java 查看文件

@@ -111,7 +111,6 @@ public class OBURequest implements HandlerAction, ToastAction {
}
}
});

}

/**

+ 2
- 2
app/src/main/res/layout-v2/fragment_home_five.xml 查看文件

@@ -28,7 +28,7 @@

<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_35"
android:layout_height="@dimen/dp_40"
android:layout_marginHorizontal="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_15"
android:background="@drawable/item_home_frame3"
@@ -44,7 +44,7 @@
android:id="@+id/etSearch"
style="@style/EditTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:drawablePadding="@dimen/dp_15"
android:hint="请输入关键词"

二進制
library/obublelib.zip 查看文件


+ 1
- 0
library/obublelib/build.gradle 查看文件

@@ -44,6 +44,7 @@ dependencies {
compile 'com.google.code.gson:gson:2.2.4'
testCompile 'junit:junit:4.12'
compile files('libs/hxguizhouSDK.jar')
compile files('libs/WXGuiZhou_v1.0.jar')
compile files('libs/readerle_lib.jar')
compile files('libs/transmissionlib.jar')
compile files('libs/ObuSDK_GuiZhou_14f2d591_20180326.jar')

二進制
library/obublelib/libs/WXGuiZhou_v1.0.jar 查看文件


+ 168
- 136
library/obublelib/src/main/java/com/huntersun/vky/obublelib/box/BoxManagers.java 查看文件

@@ -33,6 +33,8 @@ import com.tendyron.etc.core.guizhou.TDRimpl;
import com.tendyron.etc.guizhou.TianDiBle;
import com.wanji.etcble.service.WJBleAPI;
import com.watchdata.obusdkguizhou.impl.ObuSdkImpl;
import com.wuxian.wxsdk.BleManager;
import com.wuxian.wxsdk.bean.Result;
import com.zj.blueinfoReader.PlkReaderLeLib;
import com.zj.transmission.GattConnectState;
import com.zj.transmission.TransmissionReader;
@@ -121,6 +123,11 @@ public class BoxManagers implements ResponseListener {
*/
public TianDiBle tianDiBle = null;
private static int TianDi = 11;
/**
* 无线感测
*/
public BleManager bleManager = null;
private static int WX = 12;
/**
* 蓝牙链接和断开的回调
*/
@@ -246,157 +253,168 @@ public class BoxManagers implements ResponseListener {
// }
// });
// }
new AsyncTask<Void, Void, BluetoothDevice>() {
@Override
protected BluetoothDevice doInBackground(Void... voids) {
if (null != device.getName() && device.getName().startsWith("PLK_")) {
//连接中交
isPlk = ZJ;
mPlkLib = new ZJReaderLeLib(mContext);
mPlkLib.Open();
mPlkLib.SetReaderLeCallback(plkCallBack);
mPlkLib.Connect(device.toString());
} else if (null != device.getName() && device.getName().startsWith("sdlan")) {
//中交新版SDK,调试时间2017.09.14
isPlk = ZJ_NEW;
return device;
} else if (null != device.getName() && device.getName().startsWith("JY")) {
//链接金益
isPlk = JY;
new AsyncTask<Void, Void, BluetoothDevice>() {
@Override
protected BluetoothDevice doInBackground(Void... voids) {
if (null != device.getName() && device.getName().startsWith("WX")) {
//连接无线感测
isPlk = WX;
bleManager = new BleManager(mContext);
Result _ss = bleManager.connectDevice(device);
if (null != _ss) {
result = getSs("初始化", _ss);
mConnectStatus.ConnectCb(result);
}
} else if (null != device.getName() && device.getName().startsWith("PLK_")) {
//连接中交
isPlk = ZJ;
mPlkLib = new ZJReaderLeLib(mContext);
mPlkLib.Open();
mPlkLib.SetReaderLeCallback(plkCallBack);
mPlkLib.Connect(device.toString());
} else if (null != device.getName() && device.getName().startsWith("sdlan")) {
//中交新版SDK,调试时间2017.09.14
isPlk = ZJ_NEW;
return device;
} else if (null != device.getName() && device.getName().startsWith("JY")) {
//链接金益
isPlk = JY;
/*obuInterface = ObuInterface.getInstance();
obuInterface.initialize(mContext);*/

com.genvict.obusdk.data.ServiceStatus _ss = obuInterface.connectDevice(device
.getAddress());
if (null != _ss) {
result = getJYss("初始化", _ss);
mConnectStatus.ConnectCb(result);
}

} else if (null != device.getName() && device.getName().startsWith("LC")) {
//链接金益
isPlk = LC;
obuInterface = ObuInterface.getInstance();
obuInterface.initialize(mContext);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
com.genvict.obusdk.data.ServiceStatus _ss = obuInterface.connectDevice(device
.getAddress());
if (null != _ss) {
result = getJYss("初始化", _ss);
mConnectStatus.ConnectCb(result);
}

} else if (null != device.getName() && device.getName().startsWith("WJ")) {
isPlk = WJ;
wjBleAPI = WJBleAPI.getInstance(mContext);
com.wanji.etcble.bean.ServiceStatus _ss = wjBleAPI.connectDevice(device);
if (null != _ss) {
result = getWJss("初始化", _ss);
mConnectStatus.ConnectCb(result);
}

} else if (null != device.getName() && device.getName().startsWith("ZZ")) {
isPlk = ZZ;
wjBleAPI = WJBleAPI.getInstance(mContext);
com.wanji.etcble.bean.ServiceStatus _ss = wjBleAPI.connectDevice(device);
if (null != _ss) {
result = getWJss("初始化", _ss);
mConnectStatus.ConnectCb(result);
}
com.genvict.obusdk.data.ServiceStatus _ss = obuInterface.connectDevice(device
.getAddress());
if (null != _ss) {
result = getJYss("初始化", _ss);
mConnectStatus.ConnectCb(result);
}

} else if (null != device.getName() && device.getName().startsWith("AT")) {
isPlk = Artc;
artcBleGuizhouSDK = ArtcBleGuizhouSDK.getInstance(mContext);
ArtcBleGuizhouSDK.ServiceStatus _ss = artcBleGuizhouSDK.connectDevice(device);
if (null != _ss) {
result = getSs("连接设备", _ss);
mConnectStatus.ConnectCb(result);
}
} else if (null != device.getName() && device.getName().startsWith("LC")) {
//链接金益
isPlk = LC;
obuInterface = ObuInterface.getInstance();
obuInterface.initialize(mContext);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
com.genvict.obusdk.data.ServiceStatus _ss = obuInterface.connectDevice(device
.getAddress());
if (null != _ss) {
result = getJYss("初始化", _ss);
mConnectStatus.ConnectCb(result);
}

} else if (null != device.getName() && device.getName().startsWith("JT")) {
isPlk = JT;
if (null == jtObu) {
jtObu = JtObu.getInstance(mContext);
}
} else if (null != device.getName() && device.getName().startsWith("WJ")) {
isPlk = WJ;
wjBleAPI = WJBleAPI.getInstance(mContext);
com.wanji.etcble.bean.ServiceStatus _ss = wjBleAPI.connectDevice(device);
if (null != _ss) {
result = getWJss("初始化", _ss);
mConnectStatus.ConnectCb(result);
}

result = getSs("连接设备", jtObu.connectDevice(device));
} else if (null != device.getName() && device.getName().startsWith("ZZ")) {
isPlk = ZZ;
wjBleAPI = WJBleAPI.getInstance(mContext);
com.wanji.etcble.bean.ServiceStatus _ss = wjBleAPI.connectDevice(device);
if (null != _ss) {
result = getWJss("初始化", _ss);
mConnectStatus.ConnectCb(result);
} else if (null != device.getName() && device.getName().startsWith("WQ")) {
isPlk = WQ;
WoQiObu1 = ObuSdkImpl.getInstance(mContext);
result = getSs("连接设备", WoQiObu1.connectDevice(device));
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}

} else if (null != device.getName() && device.getName().startsWith("AT")) {
isPlk = Artc;
artcBleGuizhouSDK = ArtcBleGuizhouSDK.getInstance(mContext);
ArtcBleGuizhouSDK.ServiceStatus _ss = artcBleGuizhouSDK.connectDevice(device);
if (null != _ss) {
result = getSs("连接设备", _ss);
mConnectStatus.ConnectCb(result);
} else if (null != device.getName() && device.getName().startsWith("CG")) {
isPlk = ChengGu;
ChengGuObu = BluetoothHelper.getInstance();
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
mConnectStatus.ConnectCb(getSs("连接设备", ChengGuObu.connectDevice(device)));
} else if (null != device.getName() && device.getName().startsWith("TD")) {
isPlk = TianDi;
tianDiBle = TDRimpl.getInstance(mContext);
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
mConnectStatus.ConnectCb(getSs("连接设备", tianDiBle.connectDevice(device)));

} else {//连接聚力
//CZFIX 兼容7.0手机的问题,比如锤子手机会报错 Can't create handler inside thread that has not called Looper.prepare()
MainHandler.getInstance().post(new Runnable() {
@Override
public void run() {
isPlk = JL;
mObuMan = new deviceInit(mContext);
mObuMan.setConnectStatusCallback(csCallBack);
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
mObuMan.connectDevice(device);
}
});
}
return null;
}

@Override
protected void onPostExecute(BluetoothDevice bluetoothDevice) {
super.onPostExecute(bluetoothDevice);
if (null != bluetoothDevice) {
mTReader = new TransmissionReader(mContext);
mTReader.setReaderLeCallBack(zjReaderLeCallBack);
mTReader.connectDevice(bluetoothDevice);
deviceName = bluetoothDevice.getName();
} else if (null == bluetoothDevice && 2 == isPlk) {
//中交新版SDK,调试时间2017.09.14
Toast.makeText(mContext, "设备不支持蓝牙4.0", Toast.LENGTH_SHORT).show();
} else if (null != device.getName() && device.getName().startsWith("JT")) {
isPlk = JT;
if (null == jtObu) {
jtObu = JtObu.getInstance(mContext);
}

result = getSs("连接设备", jtObu.connectDevice(device));
mConnectStatus.ConnectCb(result);
} else if (null != device.getName() && device.getName().startsWith("WQ")) {
isPlk = WQ;
WoQiObu1 = ObuSdkImpl.getInstance(mContext);
result = getSs("连接设备", WoQiObu1.connectDevice(device));
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
mConnectStatus.ConnectCb(result);
} else if (null != device.getName() && device.getName().startsWith("CG")) {
isPlk = ChengGu;
ChengGuObu = BluetoothHelper.getInstance();
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
mConnectStatus.ConnectCb(getSs("连接设备", ChengGuObu.connectDevice(device)));
} else if (null != device.getName() && device.getName().startsWith("TD")) {
isPlk = TianDi;
tianDiBle = TDRimpl.getInstance(mContext);
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
mConnectStatus.ConnectCb(getSs("连接设备", tianDiBle.connectDevice(device)));

} else {//连接聚力
//CZFIX 兼容7.0手机的问题,比如锤子手机会报错 Can't create handler inside thread that has not called Looper.prepare()
MainHandler.getInstance().post(new Runnable() {
@Override
public void run() {
isPlk = JL;
mObuMan = new deviceInit(mContext);
mObuMan.setConnectStatusCallback(csCallBack);
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
mObuMan.connectDevice(device);
}
});
}
}.execute();
}
return null;
}

@Override
protected void onPostExecute(BluetoothDevice bluetoothDevice) {
super.onPostExecute(bluetoothDevice);
if (null != bluetoothDevice) {
mTReader = new TransmissionReader(mContext);
mTReader.setReaderLeCallBack(zjReaderLeCallBack);
mTReader.connectDevice(bluetoothDevice);
deviceName = bluetoothDevice.getName();
} else if (null == bluetoothDevice && 2 == isPlk) {
//中交新版SDK,调试时间2017.09.14
Toast.makeText(mContext, "设备不支持蓝牙4.0", Toast.LENGTH_SHORT).show();
}
}
}.execute();
}


/**
* 断开设备
*/
public void disconnect() {
if (isPlk == ZJ) {
if (isPlk == WX) {
bleManager.disconnect();
bleManager = null;
} else if (isPlk == ZJ) {
//0:中交;1:聚力
mPlkLib.Disconnect();
mPlkLib = null;
@@ -570,7 +588,10 @@ public class BoxManagers implements ResponseListener {
*/
public ServiceStatus resetICC() {
result = ServiceStatusBrage.getServiceStatus();
if (isPlk == ZJ) {
if (isPlk == WX) {
Result _ss = bleManager.reset(1);
result = getSs("ICC复位", _ss);
} else if (isPlk == ZJ) {
//0:中交;1:聚力
String str = mPlkLib.GetAtrStr(2000);
result.setServiceCode(0);
@@ -628,7 +649,10 @@ public class BoxManagers implements ResponseListener {
*/
public void resetEsam() {
ServiceStatus result = ServiceStatusBrage.getServiceStatus();
if (isPlk == 1) {
if (isPlk == WX) {
Result _ss = bleManager.reset(1);
result = getSs("ESAM复位", _ss);
} else if (isPlk == 1) {
//聚力
result = mObuMan.resetEsam(5000);
} else if (isPlk == 3) {
@@ -678,6 +702,10 @@ public class BoxManagers implements ResponseListener {
*/
public ServiceStatus sendApduICC(String cmd) {
result = ServiceStatusBrage.getServiceStatus();
if (isPlk == WX) {
Result _ss = bleManager.sendApdu(cmd, 5000);
result = getSs(cmd, _ss);
}else
if (isPlk == ZJ) {
//0:中交;1:聚力
String str = mPlkLib.ApduStr(cmd, 5000);
@@ -752,6 +780,10 @@ public class BoxManagers implements ResponseListener {
*/
public ServiceStatus sendApduEsam(String cmd) {
result = ServiceStatusBrage.getServiceStatus();
if (isPlk == WX) {
Result _ss = bleManager.sendApdu(cmd, 5000);
result = getSs(cmd, _ss);
}else
if (isPlk == JL) {
//聚力6217232402000311359
ServiceStatus ss = mObuMan.sendApduEsam(cmd, 5000);
@@ -807,10 +839,10 @@ public class BoxManagers implements ResponseListener {
j.put("ServiceInfo", result.getServiceInfo());
j.put("ServiceCode", result.getServiceCode());
} catch (JSONException e) {
Log.e("log","打印标题:" + e.getMessage() );
Log.e("log", "打印标题:" + e.getMessage());
e.printStackTrace();
}
Log.e("log","返回结果:" + j.toString() );
Log.e("log", "返回结果:" + j.toString());
return j.toString();
}


Loading…
取消
儲存