Example usage for com.facebook.react.bridge WritableNativeMap putInt

List of usage examples for com.facebook.react.bridge WritableNativeMap putInt

Introduction

In this page you can find the example usage for com.facebook.react.bridge WritableNativeMap putInt.

Prototype

@Override
    public native void putInt(@NonNull String key, int value);

Source Link

Usage

From source file:io.github.douglasjunior.ReactNativeEasyBluetooth.core.CoreModule.java

License:Open Source License

private WritableNativeMap wrapDevice(BluetoothDevice bluetoothDevice, int RSSI) {
    WritableNativeMap device = new WritableNativeMap();
    device.putString("address", bluetoothDevice.getAddress());
    device.putString("name", bluetoothDevice.getName());
    device.putInt("rssi", RSSI);
    WritableArray uuids = new WritableNativeArray();
    if (bluetoothDevice.getUuids() != null) {
        for (ParcelUuid uuid : bluetoothDevice.getUuids()) {
            uuids.pushString(uuid.toString());
        }//from   w w  w . jav a  2  s  . co  m
    }
    device.putArray("uuids", uuids);
    return device;
}