Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
升级远程依赖库版本到1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jackie committed Jun 3, 2021
1 parent bc66bc3 commit e8a3630
Show file tree
Hide file tree
Showing 17 changed files with 98 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/libraries/Gradle__com_sscl_brvahlibrary_0_0_2_aar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules/blelibrary/BleSample.blelibrary.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions blelibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
defaultConfig {
minSdkVersion 18
targetSdkVersion 30
versionCode 24
versionName "1.0.5"
versionCode 25
versionName "1.0.6"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
22 changes: 22 additions & 0 deletions blelibrary/src/main/java/com/sscl/blelibrary/BleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,24 @@ public static boolean unBound(@Nullable Context context, @NonNull String address
return result;
}

/**
* 设置调试开启状态
*
* @param debugFlag 调试开启状态
*/
public static void setDebugFlag(boolean debugFlag) {
DebugUtil.setDebugFlag(debugFlag);
}

/**
* set logcat default tag
*
* @param tag default tag
*/
public static void setDefaultTAG(String tag) {
DebugUtil.setDefaultTAG(tag);
}

/**
* Determine if the phone supports BLE
*
Expand Down Expand Up @@ -565,4 +583,8 @@ static ThreadFactory getThreadFactory() {
static void setBluetoothLeService(BluetoothLeService bluetoothLeService) {
BleManager.bluetoothLeService = bluetoothLeService;
}

public static void warnOut(String tag, String message) {
DebugUtil.warnOut(tag, message);
}
}
4 changes: 2 additions & 2 deletions blelibrary/src/main/java/com/sscl/blelibrary/DebugUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
*
* @author jackie
*/
public class DebugUtil {
class DebugUtil {

/*-----------------------------------private static variables-----------------------------------*/

/**
* default TAG
*/
private static String defaultTag = "AlmLibrary->";
private static String defaultTag = "BleLibrary->";
/**
* Whether to print debug information
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.bluetooth.le.AdvertisingSet;
import android.bluetooth.le.BluetoothLeAdvertiser;

import com.sscl.blelibrary.DebugUtil;
import com.sscl.blelibrary.BleManager;


/**
Expand All @@ -23,7 +23,7 @@ public class DefaultOnBleAdvertiseStateChangedListener implements OnBleAdvertise
*/
@Override
public void onBroadCastStartSuccess(AdvertiseSettings settingsInEffect) {
DebugUtil.warnOut(TAG, "onBroadCastStartSuccess");
BleManager.warnOut(TAG, "onBroadCastStartSuccess");
}

/**
Expand All @@ -34,15 +34,15 @@ public void onBroadCastStartSuccess(AdvertiseSettings settingsInEffect) {
*/
@Override
public void onBroadCastStartFailure(int errorCode) {
DebugUtil.warnOut(TAG, "onBroadCastStartFailure");
BleManager.warnOut(TAG, "onBroadCastStartFailure");
}

/**
* 如果设置了超时时间,在超时结束后,会执行此回调
*/
@Override
public void onBroadCastStopped() {
DebugUtil.warnOut(TAG, "onBroadCastStopped");
BleManager.warnOut(TAG, "onBroadCastStopped");
}

/**
Expand All @@ -57,7 +57,7 @@ public void onBroadCastStopped() {
*/
@Override
public void onAdvertisingSetStarted(AdvertisingSet advertisingSet, int txPower, int status) {
DebugUtil.warnOut(TAG, "onAdvertisingSetStarted");
BleManager.warnOut(TAG, "onAdvertisingSetStarted");
}

/**
Expand All @@ -68,7 +68,7 @@ public void onAdvertisingSetStarted(AdvertisingSet advertisingSet, int txPower,
*/
@Override
public void onAdvertisingSetStopped(AdvertisingSet advertisingSet) {
DebugUtil.warnOut(TAG, "onAdvertisingSetStopped");
BleManager.warnOut(TAG, "onAdvertisingSetStopped");
}

/**
Expand All @@ -81,7 +81,7 @@ public void onAdvertisingSetStopped(AdvertisingSet advertisingSet) {
*/
@Override
public void onAdvertisingEnabled(AdvertisingSet advertisingSet, boolean enable, int status) {
DebugUtil.warnOut(TAG, "onAdvertisingEnabled");
BleManager.warnOut(TAG, "onAdvertisingEnabled");
}

/**
Expand All @@ -93,7 +93,7 @@ public void onAdvertisingEnabled(AdvertisingSet advertisingSet, boolean enable,
*/
@Override
public void onScanResponseDataSet(AdvertisingSet advertisingSet, int status) {
DebugUtil.warnOut(TAG, "onScanResponseDataSet");
BleManager.warnOut(TAG, "onScanResponseDataSet");
}

/**
Expand All @@ -106,7 +106,7 @@ public void onScanResponseDataSet(AdvertisingSet advertisingSet, int status) {
*/
@Override
public void onAdvertisingParametersUpdated(AdvertisingSet advertisingSet, int txPower, int status) {
DebugUtil.warnOut(TAG, "onAdvertisingParametersUpdated");
BleManager.warnOut(TAG, "onAdvertisingParametersUpdated");
}

/**
Expand All @@ -118,7 +118,7 @@ public void onAdvertisingParametersUpdated(AdvertisingSet advertisingSet, int tx
*/
@Override
public void onPeriodicAdvertisingParametersUpdated(AdvertisingSet advertisingSet, int status) {
DebugUtil.warnOut(TAG, "onPeriodicAdvertisingParametersUpdated");
BleManager.warnOut(TAG, "onPeriodicAdvertisingParametersUpdated");
}

/**
Expand All @@ -130,7 +130,7 @@ public void onPeriodicAdvertisingParametersUpdated(AdvertisingSet advertisingSet
*/
@Override
public void onPeriodicAdvertisingDataSet(AdvertisingSet advertisingSet, int status) {
DebugUtil.warnOut(TAG, "onPeriodicAdvertisingDataSet");
BleManager.warnOut(TAG, "onPeriodicAdvertisingDataSet");
}

/**
Expand All @@ -143,7 +143,7 @@ public void onPeriodicAdvertisingDataSet(AdvertisingSet advertisingSet, int stat
*/
@Override
public void onPeriodicAdvertisingEnabled(AdvertisingSet advertisingSet, boolean enable, int status) {
DebugUtil.warnOut(TAG, "onPeriodicAdvertisingEnabled");
BleManager.warnOut(TAG, "onPeriodicAdvertisingEnabled");
}

/**
Expand All @@ -155,6 +155,6 @@ public void onPeriodicAdvertisingEnabled(AdvertisingSet advertisingSet, boolean
*/
@Override
public void onAdvertisingDataSet(AdvertisingSet advertisingSet, int status) {
DebugUtil.warnOut(TAG, "onAdvertisingDataSet");
BleManager.warnOut(TAG, "onAdvertisingDataSet");
}
}
Loading

0 comments on commit e8a3630

Please sign in to comment.