|
@@ -97,7 +97,7 @@ class BaseSdk {
|
|
|
}
|
|
|
}
|
|
|
return;
|
|
|
- } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
|
|
|
+ } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
|
|
|
onBTSearchResultListener.onSearchResult(new SearchResultUtils(StatusConstant.BLE_SEARCH_COMPLETE).toJSONObject());
|
|
|
}
|
|
|
}
|
|
@@ -148,6 +148,10 @@ class BaseSdk {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void setLogEnable(Application context, boolean enable) {
|
|
|
+ LogUtil.setEnable(context, enable);
|
|
|
+ }
|
|
|
+
|
|
|
//权限检查
|
|
|
public JSONObject checkPermission() {
|
|
|
//
|
|
@@ -286,14 +290,14 @@ class BaseSdk {
|
|
|
}
|
|
|
|
|
|
Collection<Device> devices = null;
|
|
|
- if( !StringUtils.isEmpty(type) ){
|
|
|
+ if (!StringUtils.isEmpty(type)) {
|
|
|
HashMap<String, Device> list = deviceMapsByTypes.get(type);
|
|
|
- if(list == null || list.size() == 0 ) {
|
|
|
+ if (list == null || list.size() == 0) {
|
|
|
onBleSearchResultListener.onSearchResult(new SearchResultUtils(StatusConstant.BLE_NOTFOUND).toJSONObject());
|
|
|
return;
|
|
|
}
|
|
|
devices = list.values();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
devices = deviceMapsByModels.values();
|
|
|
}
|
|
|
|
|
@@ -309,7 +313,7 @@ class BaseSdk {
|
|
|
context.registerReceiver(mReceiver, filter);
|
|
|
|
|
|
if (onBleSearchResultListener != null) {
|
|
|
- onBTSearchResultListener =onBleSearchResultListener;
|
|
|
+ onBTSearchResultListener = onBleSearchResultListener;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -404,10 +408,10 @@ class BaseSdk {
|
|
|
}
|
|
|
|
|
|
/// 新增自动测试
|
|
|
- public void autoTest(String model) {
|
|
|
+ public void autoTest(String model) {
|
|
|
BaseDevices instanceDevice = instanceDevices.get(model);
|
|
|
if (instanceDevice != null) {
|
|
|
- instanceDevice.autoTest();
|
|
|
+ instanceDevice.autoTest();
|
|
|
}
|
|
|
}
|
|
|
|