Example usage for android.bluetooth BluetoothGattService getInstanceId

List of usage examples for android.bluetooth BluetoothGattService getInstanceId

Introduction

In this page you can find the example usage for android.bluetooth BluetoothGattService getInstanceId.

Prototype

public int getInstanceId() 

Source Link

Document

Returns the instance ID for this service

If a remote device offers multiple services with the same UUID (ex.

Usage

From source file:com.cypress.cysmart.CommonFragments.CarouselFragment.java

/**
 * Fragment new Instance creation with arguments
 *
 * @param pos/*from   w  w w  .j a v a2  s .  c om*/
 * @param scale
 * @param name
 * @param uuid
 * @param service
 * @return CarouselFragment
 */
public static Fragment newInstance(int pos, float scale, String name, String uuid,
        BluetoothGattService service) {
    CarouselFragment fragment = new CarouselFragment();
    if (service.getInstanceId() > 0) {
        uuid = uuid + service.getInstanceId();
    }
    bleHashMap.put(uuid, service);
    Bundle b = new Bundle();
    b.putInt(EXTRA_FRAG_POS, pos);
    b.putFloat(EXTRA_FRAG_SCALE, scale);
    b.putString(EXTRA_FRAG_NAME, name);
    b.putString(EXTRA_FRAG_UUID, uuid);
    fragment.setArguments(b);
    return fragment;

}