-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into improvement/Handle-not-valid-bluetooth-add…
…ress-native-error
- Loading branch information
Showing
15 changed files
with
330 additions
and
36 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
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
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { fullUUID } from 'react-native-ble-plx' | ||
import base64 from 'react-native-base64' | ||
import { getDateAsBase64 } from '../utils/getDateAsBase64' | ||
|
||
export const deviceTimeService = fullUUID('1847') | ||
export const currentTimeCharacteristic = fullUUID('2A2B') | ||
export const deviceTimeCharacteristic = fullUUID('2B90') | ||
export const currentTimeCharacteristicTimeTriggerDescriptor = fullUUID('290E') | ||
|
||
export const writeWithResponseBase64Time = getDateAsBase64(new Date('2022-08-11T08:17:19Z')) | ||
export const writeWithoutResponseBase64Time = getDateAsBase64(new Date('2023-09-12T10:12:16Z')) | ||
export const monitorExpectedMessage = 'Hi, it works!' | ||
export const currentTimeCharacteristicTimeTriggerDescriptorValue = base64.encode('BLE-PLX') |
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
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
Oops, something went wrong.