-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1116 from dotintent/feature/useIsConnectableForSc…
…anResult feat: added is connectable from scan result object
- Loading branch information
Showing
3 changed files
with
14 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 13 additions & 11 deletions
24
android/src/main/java/com/bleplx/adapter/utils/mapper/RxScanResultToScanResultMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
package com.bleplx.adapter.utils.mapper; | ||
|
||
import static com.polidea.rxandroidble2.scan.IsConnectable.CONNECTABLE; | ||
|
||
import com.bleplx.adapter.AdvertisementData; | ||
import com.bleplx.adapter.ScanResult; | ||
import com.bleplx.adapter.utils.Constants; | ||
|
||
public class RxScanResultToScanResultMapper { | ||
|
||
public ScanResult map(com.polidea.rxandroidble2.scan.ScanResult rxScanResult) { | ||
return new ScanResult( | ||
rxScanResult.getBleDevice().getMacAddress(), | ||
rxScanResult.getBleDevice().getName(), | ||
rxScanResult.getRssi(), | ||
Constants.MINIMUM_MTU, | ||
false, //isConnectable flag is not available on Android | ||
null, //overflowServiceUUIDs are not available on Android | ||
AdvertisementData.parseScanResponseData(rxScanResult.getScanRecord().getBytes()) | ||
); | ||
} | ||
public ScanResult map(com.polidea.rxandroidble2.scan.ScanResult rxScanResult) { | ||
return new ScanResult( | ||
rxScanResult.getBleDevice().getMacAddress(), | ||
rxScanResult.getBleDevice().getName(), | ||
rxScanResult.getRssi(), | ||
Constants.MINIMUM_MTU, | ||
rxScanResult.isConnectable() == CONNECTABLE, | ||
null, //overflowServiceUUIDs are not available on Android | ||
AdvertisementData.parseScanResponseData(rxScanResult.getScanRecord().getBytes()) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters