react-native-beidou 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/src/main/java/com/cmcc_rn_module/BeiDouBluetoothModule.java +1 -1
- package/android/src/main/libs/bluetooth-sdk.aar +0 -0
- package/index.ts +4 -4
- package/package.json +1 -1
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
2
|
-
gradle.version=8.
|
|
1
|
+
#Fri Oct 24 11:21:51 CST 2025
|
|
2
|
+
gradle.version=8.10
|
|
@@ -143,7 +143,7 @@ public class BeiDouBluetoothModule extends ReactContextBaseJavaModule {
|
|
|
143
143
|
|
|
144
144
|
// 开始扫描蓝牙设备
|
|
145
145
|
@ReactMethod
|
|
146
|
-
public void startScanForService() {
|
|
146
|
+
public void startScanForService(Callback callback) {
|
|
147
147
|
BluetoothSDK instance = BluetoothSDK.getInstance(reactContext);
|
|
148
148
|
Log.d("BluetoothSDK", "MyModule-> 开始扫描");
|
|
149
149
|
instance.startScan();
|
|
Binary file
|
package/index.ts
CHANGED
|
@@ -80,7 +80,7 @@ export interface MessageInfo {
|
|
|
80
80
|
interface BeiDouBluetoothModuleType {
|
|
81
81
|
// 原有蓝牙相关方法
|
|
82
82
|
getAllConversations(): Promise<string>; // 更新为Promise版本
|
|
83
|
-
startScanForService(): void;
|
|
83
|
+
startScanForService(callback: (res: number) => void): void;
|
|
84
84
|
stopScanning(): void;
|
|
85
85
|
getDiscoveredDevices(): Promise<string>; // JSON string of BlueDeviceInfoEntity[]
|
|
86
86
|
connectToDeviceFromCloudDeviceNO(deviceNO: string, a: number): Promise<'ok' | 'fail'>;
|
|
@@ -89,7 +89,7 @@ interface BeiDouBluetoothModuleType {
|
|
|
89
89
|
shouldShowBlueToothPermissionRationale(params: string, callback: (status: BluetoothPermissionRationaleStatus) => void): void;
|
|
90
90
|
initializeBluetooth(callback: (status: BluetoothStatus) => void): void;
|
|
91
91
|
generateRandom16BytesString(): string;
|
|
92
|
-
writeData(randomString: string, deviceNo: string, command: number, attrType: number,
|
|
92
|
+
writeData(randomString: string, deviceNo: string, command: number, attrType: number, callback: (result: number) => void): void;
|
|
93
93
|
|
|
94
94
|
// 新增的iOS兼容方法
|
|
95
95
|
writeInfo(base64Payload: string | null, deviceNO: string, command: number, opCode: number, attrType: number, encrypted: boolean): Promise<WriteInfoResponse>;
|
|
@@ -355,8 +355,8 @@ export const setBeiDouBLEKey = async (bleKey: string): Promise<boolean> => {
|
|
|
355
355
|
export const BeiDouModule = {
|
|
356
356
|
// 蓝牙相关
|
|
357
357
|
bluetooth: {
|
|
358
|
-
startScan: () => BeiDouBluetoothModule.startScanForService(),
|
|
359
|
-
|
|
358
|
+
// startScan: () => BeiDouBluetoothModule.startScanForService(),
|
|
359
|
+
startScan: (callback: (result: number) => void) => BeiDouBluetoothModule.startScanForService(callback),
|
|
360
360
|
stopScan: () => BeiDouBluetoothModule.stopScanning(),
|
|
361
361
|
getDevices: getDiscoveredDevicesArray,
|
|
362
362
|
connect: (deviceNo: string) => BeiDouBluetoothModule.connectToDeviceFromCloudDeviceNO(deviceNo, 0),
|