$ npm install react-native-blemulator --save
$ react-native link react-native-blemulator
import { SimulatedPeripheral, SimulatedService } from "react-native-blemulator";
const simulatedPeripheral = new SimulatedPeripheral({
name: "My peripheral",
localName: "My peripheral",
id: "1234",
advertisementInterval: 1000,
isConnectable: true,
serviceUuids: [],
rssi: -90,
services: [
new SimulatedService({
// ...
}),
],
});
import { blemulator } from "react-native-blemulator";
blemulator.addPeripheral(simulatedPeripheral);
blemulator.simulate();
import { BleManager } from "react-native-ble-plx";
const manager = new BleManager();