build: include bob lib output
This commit is contained in:
28
lib/module/index.js
Normal file
28
lib/module/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
import { NativeModules, Platform } from 'react-native';
|
||||
const {
|
||||
BplScale
|
||||
} = NativeModules;
|
||||
|
||||
/**
|
||||
* Scan BLE devices and return weight and impedance.
|
||||
* @param scanDurationMs Duration of scan in milliseconds
|
||||
* @returns Promise resolving to a list of BLE devices with weight & impedance
|
||||
*/
|
||||
export const scanDevices = async scanDurationMs => {
|
||||
if (Platform.OS !== 'android') {
|
||||
throw new Error('BplScale module is only supported on Android.');
|
||||
}
|
||||
try {
|
||||
const devices = await BplScale.scanDevices(scanDurationMs);
|
||||
return devices;
|
||||
} catch (error) {
|
||||
console.error('BLE Scan Error:', error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
export default {
|
||||
scanDevices
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
Reference in New Issue
Block a user