Skip to content

Commit 3f77cd2

Browse files
committed
merge feat-style-compile-251012
2 parents b9f374c + b2d2ee3 commit 3f77cd2

54 files changed

Lines changed: 2242 additions & 278 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/api-proxy/@types/index.d.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,36 @@ export const offError: WechatMiniprogram.Wx['offError']
4545
export const createInnerAudioContext: WechatMiniprogram.Wx['createInnerAudioContext']
4646
export const base64ToArrayBuffer: WechatMiniprogram.Wx['base64ToArrayBuffer']
4747
export const arrayBufferToBase64: WechatMiniprogram.Wx['arrayBufferToBase64']
48+
export const openBluetoothAdapter: WechatMiniprogram.Wx['openBluetoothAdapter']
49+
export const closeBluetoothAdapter: WechatMiniprogram.Wx['closeBluetoothAdapter']
50+
export const startBluetoothDevicesDiscovery: WechatMiniprogram.Wx['startBluetoothDevicesDiscovery']
51+
export const stopBluetoothDevicesDiscovery: WechatMiniprogram.Wx['stopBluetoothDevicesDiscovery']
52+
export const onBluetoothDeviceFound: WechatMiniprogram.Wx['onBluetoothDeviceFound']
53+
export const offBluetoothDeviceFound: WechatMiniprogram.Wx['offBluetoothDeviceFound']
54+
export const getConnectedBluetoothDevices: WechatMiniprogram.Wx['getConnectedBluetoothDevices']
55+
export const getBluetoothAdapterState: WechatMiniprogram.Wx['getBluetoothAdapterState']
56+
export const onBluetoothAdapterStateChange: WechatMiniprogram.Wx['onBluetoothAdapterStateChange']
57+
export const offBluetoothAdapterStateChange: WechatMiniprogram.Wx['offBluetoothAdapterStateChange']
58+
export const getBluetoothDevices: WechatMiniprogram.Wx['getBluetoothDevices']
59+
export const writeBLECharacteristicValue: WechatMiniprogram.Wx['writeBLECharacteristicValue']
60+
export const readBLECharacteristicValue: WechatMiniprogram.Wx['readBLECharacteristicValue']
61+
export const notifyBLECharacteristicValueChange: WechatMiniprogram.Wx['notifyBLECharacteristicValueChange']
62+
export const onBLECharacteristicValueChange: WechatMiniprogram.Wx['onBLECharacteristicValueChange']
63+
export const offBLECharacteristicValueChange: WechatMiniprogram.Wx['offBLECharacteristicValueChange']
64+
export const setBLEMTU: WechatMiniprogram.Wx['setBLEMTU']
65+
export const getBLEDeviceRSSI: WechatMiniprogram.Wx['getBLEDeviceRSSI']
66+
export const getBLEDeviceServices: WechatMiniprogram.Wx['getBLEDeviceServices']
67+
export const getBLEDeviceCharacteristics: WechatMiniprogram.Wx['getBLEDeviceCharacteristics']
4868
export const closeBLEConnection: WechatMiniprogram.Wx['closeBLEConnection']
4969
export const createBLEConnection: WechatMiniprogram.Wx['createBLEConnection']
5070
export const onBLEConnectionStateChange: WechatMiniprogram.Wx['onBLEConnectionStateChange']
71+
export const offBLEConnectionStateChange: WechatMiniprogram.Wx['offBLEConnectionStateChange']
72+
export const startWifi: WechatMiniprogram.Wx['startWifi']
73+
export const stopWifi: WechatMiniprogram.Wx['stopWifi']
74+
export const getWifiList: WechatMiniprogram.Wx['getWifiList']
75+
export const onGetWifiList: WechatMiniprogram.Wx['onGetWifiList']
76+
export const offGetWifiList: WechatMiniprogram.Wx['offGetWifiList']
77+
export const getConnectedWifi: WechatMiniprogram.Wx['getConnectedWifi']
5178
export const createCanvasContext: WechatMiniprogram.Wx['createCanvasContext']
5279
export const canvasToTempFilePath: WechatMiniprogram.Wx['canvasToTempFilePath']
5380
export const canvasGetImageData: WechatMiniprogram.Wx['canvasGetImageData']

packages/api-proxy/package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mpxjs/api-proxy",
3-
"version": "2.10.17",
3+
"version": "2.10.17-beta.1",
44
"description": "convert miniprogram API at each end",
55
"module": "src/index.js",
66
"types": "@types/index.d.ts",
@@ -46,7 +46,9 @@
4646
"react-native-device-info": "*",
4747
"react-native-get-location": "*",
4848
"react-native-haptic-feedback": "*",
49-
"react-native-safe-area-context": "*"
49+
"react-native-safe-area-context": "*",
50+
"react-native-ble-manager": "*",
51+
"react-native-wifi-reborn": "*"
5052
},
5153
"peerDependenciesMeta": {
5254
"@react-native-async-storage/async-storage": {
@@ -66,6 +68,12 @@
6668
},
6769
"react-native-haptic-feedback": {
6870
"optional": true
71+
},
72+
"react-native-ble-manager": {
73+
"optional": true
74+
},
75+
"react-native-wifi-reborn": {
76+
"optional": true
6977
}
7078
}
7179
}

packages/api-proxy/src/platform/api/ble-connection/index.ali.js

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ENV_OBJ } from '../../../common/js'
1+
import { ENV_OBJ, envError } from '../../../common/js'
22

33
function closeBLEConnection (options = {}) {
44
return ENV_OBJ.disconnectBLEDevice(options)
@@ -12,8 +12,73 @@ function onBLEConnectionStateChange (callback) {
1212
return ENV_OBJ.onBLEConnectionStateChanged(callback)
1313
}
1414

15+
function offBLEConnectionStateChange (callback) {
16+
return ENV_OBJ.offBLEConnectionStateChanged(callback)
17+
}
18+
19+
const openBluetoothAdapter = ENV_OBJ.openBluetoothAdapter || envError('openBluetoothAdapter')
20+
21+
const closeBluetoothAdapter = ENV_OBJ.closeBluetoothAdapter || envError('closeBluetoothAdapter')
22+
23+
const startBluetoothDevicesDiscovery = ENV_OBJ.startBluetoothDevicesDiscovery || envError('startBluetoothDevicesDiscovery')
24+
25+
const stopBluetoothDevicesDiscovery = ENV_OBJ.stopBluetoothDevicesDiscovery || envError('stopBluetoothDevicesDiscovery')
26+
27+
const onBluetoothDeviceFound = ENV_OBJ.onBluetoothDeviceFound || envError('onBluetoothDeviceFound')
28+
29+
const offBluetoothDeviceFound = ENV_OBJ.offBluetoothDeviceFound || envError('offBluetoothDeviceFound')
30+
31+
const getConnectedBluetoothDevices = ENV_OBJ.getConnectedBluetoothDevices || envError('getConnectedBluetoothDevices')
32+
33+
const getBluetoothAdapterState = ENV_OBJ.getBluetoothAdapterState || envError('getBluetoothAdapterState')
34+
35+
const onBluetoothAdapterStateChange = ENV_OBJ.onBluetoothAdapterStateChange || envError('onBluetoothAdapterStateChange')
36+
37+
const offBluetoothAdapterStateChange = ENV_OBJ.offBluetoothAdapterStateChange || envError('offBluetoothAdapterStateChange')
38+
39+
const getBluetoothDevices = ENV_OBJ.getBluetoothDevices || envError('getBluetoothDevices')
40+
41+
const writeBLECharacteristicValue = ENV_OBJ.writeBLECharacteristicValue || envError('writeBLECharacteristicValue')
42+
43+
const readBLECharacteristicValue = ENV_OBJ.readBLECharacteristicValue || envError('readBLECharacteristicValue')
44+
45+
const notifyBLECharacteristicValueChange = ENV_OBJ.notifyBLECharacteristicValueChange || envError('notifyBLECharacteristicValueChange')
46+
47+
const onBLECharacteristicValueChange = ENV_OBJ.onBLECharacteristicValueChange || envError('onBLECharacteristicValueChange')
48+
49+
const offBLECharacteristicValueChange = ENV_OBJ.offBLECharacteristicValueChange || envError('offBLECharacteristicValueChange')
50+
51+
const setBLEMTU = ENV_OBJ.setBLEMTU || envError('setBLEMTU')
52+
53+
const getBLEDeviceRSSI = ENV_OBJ.getBLEDeviceRSSI || envError('getBLEDeviceRSSI')
54+
55+
const getBLEDeviceServices = ENV_OBJ.getBLEDeviceServices || envError('getBLEDeviceServices')
56+
57+
const getBLEDeviceCharacteristics = ENV_OBJ.getBLEDeviceCharacteristics || envError('getBLEDeviceCharacteristics')
58+
1559
export {
1660
closeBLEConnection,
1761
createBLEConnection,
18-
onBLEConnectionStateChange
62+
onBLEConnectionStateChange,
63+
offBLEConnectionStateChange,
64+
openBluetoothAdapter,
65+
closeBluetoothAdapter,
66+
startBluetoothDevicesDiscovery,
67+
stopBluetoothDevicesDiscovery,
68+
onBluetoothDeviceFound,
69+
offBluetoothDeviceFound,
70+
getConnectedBluetoothDevices,
71+
getBluetoothAdapterState,
72+
onBluetoothAdapterStateChange,
73+
offBluetoothAdapterStateChange,
74+
getBluetoothDevices,
75+
writeBLECharacteristicValue,
76+
readBLECharacteristicValue,
77+
notifyBLECharacteristicValueChange,
78+
onBLECharacteristicValueChange,
79+
offBLECharacteristicValueChange,
80+
setBLEMTU,
81+
getBLEDeviceRSSI,
82+
getBLEDeviceServices,
83+
getBLEDeviceCharacteristics
1984
}

0 commit comments

Comments
 (0)