Files
react-native-bpl-scale/lib/module/index.js
Gokulvarthan Ramesh a7a9b2646b
Some checks failed
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / build-library (push) Has been cancelled
CI / build-android (push) Has been cancelled
CI / build-ios (push) Has been cancelled
build: include bob lib output
2025-12-17 11:15:46 +05:30

28 lines
718 B
JavaScript

"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