Java Code Examples for android.bluetooth.le.ScanRecord#getDeviceName()

The following examples show how to use android.bluetooth.le.ScanRecord#getDeviceName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScanRecordCompat.java    From EFRConnect-android with Apache License 2.0 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static ScanRecordCompat from(Object lollipopScanRecord) {
    if (lollipopScanRecord == null) {
        return null;
    }

    sr = (ScanRecord) lollipopScanRecord;
    ScanRecordCompat retVal = new ScanRecordCompat();
    retVal.advertiseFlags = sr.getAdvertiseFlags();
    retVal.bytes = sr.getBytes();
    retVal.deviceName = sr.getDeviceName();
    retVal.manufacturerSpecificData = sr.getManufacturerSpecificData();
    retVal.serviceData = sr.getServiceData();
    retVal.serviceUuids = sr.getServiceUuids();
    retVal.txPowerLevel = sr.getTxPowerLevel();
    return retVal;

}
 
Example 2
Source File: ScanRecordCompat.java    From AndroidBleManager with Apache License 2.0 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
ScanRecordCompat(ScanRecord record) {
    mServiceUuids = record.getServiceUuids();
    mManufacturerSpecificData = record.getManufacturerSpecificData();
    mServiceData = record.getServiceData();
    mDeviceName = record.getDeviceName();
    mAdvertiseFlags = record.getAdvertiseFlags();
    mTxPowerLevel = record.getTxPowerLevel();
    mBytes = record.getBytes();
}