Skip to content

Commit

Permalink
feat: rawScanRecord to device object
Browse files Browse the repository at this point in the history
  • Loading branch information
dimninik committed Nov 3, 2023
1 parent beba31b commit 8736dc1
Show file tree
Hide file tree
Showing 9 changed files with 696 additions and 908 deletions.
110 changes: 55 additions & 55 deletions example/ios/BlePlxExample.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ PODS:
- React-jsinspector (0.72.4)
- React-logger (0.72.4):
- glog
- react-native-ble-plx (3.0.0):
- react-native-ble-plx (3.1.1):
- MultiplatformBleAdapter (= 0.2.0)
- RCT-Folly (= 2021.07.22.00)
- React-Core
Expand Down Expand Up @@ -708,7 +708,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: c7f826e40fa9cab5d37cab6130b1af237332b594
React-jsinspector: aaed4cf551c4a1c98092436518c2d267b13a673f
React-logger: da1ebe05ae06eb6db4b162202faeafac4b435e77
react-native-ble-plx: 6f7f7d6e57bb109ff5751b8e5fce2654a9d7c033
react-native-ble-plx: 74ef9a718eff574f2072d49b2e8950fb24ecdf22
react-native-safe-area-context: 7aa8e6d9d0f3100a820efb1a98af68aa747f9284
React-NativeModulesApple: edb5ace14f73f4969df6e7b1f3e41bef0012740f
React-perflogger: 496a1a3dc6737f964107cb3ddae7f9e265ddda58
Expand All @@ -734,4 +734,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: e43e14d964b1de567b73b376b4538cddb7c50ca9

COCOAPODS: 1.13.0
COCOAPODS: 1.12.1
1 change: 1 addition & 0 deletions example/src/components/molecules/BleDevice/BleDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function BleDevice({ device, onPress }: BleDeviceProps) {
<DeviceProperty name="localName" value={device.localName} />
<DeviceProperty name="id" value={device.id} />
<DeviceProperty name="manufacturerData" value={device.manufacturerData} />
<DeviceProperty name="rawScanRecord" value={device.rawScanRecord} />
<DeviceProperty name="isConnectable" value={parsedIsConnectable} />
<DeviceProperty name="mtu" value={device.mtu.toString()} />
<DeviceProperty name="rssi" value={device.rssi} />
Expand Down
2 changes: 2 additions & 0 deletions ios/MultiplatformBleAdapter/BleExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ extension ScannedPeripheral {
"solicitedServiceUUIDs": solicitedServiceUUIDs as Any,
"isConnectable": advertisementData.isConnectable as Any,
"overflowServiceUUIDs": overflowServiceUUIDs as Any
"rawScanRecord": advertisementData as Any
]
}
}
Expand Down Expand Up @@ -89,6 +90,7 @@ extension Peripheral {
"solicitedServiceUUIDs": NSNull(),
"isConnectable": NSNull(),
"overflowServiceUUIDs": NSNull()
"rawScanRecord": NSNull()
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public struct AdvertisementData {
public var manufacturerData: Data? {
return advertisementData[CBAdvertisementDataManufacturerDataKey] as? Data
}

/// A dictionary containing service-specific advertisement data.
/// The keys are CBUUID objects, representing CBService UUIDs. The values are Data objects,
/// representing service-specific data.
Expand Down
7 changes: 7 additions & 0 deletions src/BleModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ export interface NativeDevice {
*/
manufacturerData: ?Base64;

/**
* Raw device scan data. When you have specific advertiser data,
* you can implement your own processing.
* @private
*/
rawScanRecord: Base64;

/**
* Map od service UUIDs with associated data.
* @private
Expand Down
7 changes: 7 additions & 0 deletions src/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ export class Device implements NativeDevice {
*/
manufacturerData: ?Base64

/**
* Raw device scan data. When you have specific advertiser data,
* you can implement your own processing.
* @private
*/
rawScanRecord: Base64

/**
* Map of service UUIDs (as keys) with associated data (as values).
*/
Expand Down
14 changes: 14 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,13 @@ declare module 'react-native-ble-plx' {
*/
manufacturerData: Base64 | null

/**
* Raw device scan data. When you have specific advertiser data,
* you can implement your own processing.
* @private
*/
rawScanRecord: Base64

/**
* Map od service UUIDs with associated data.
* @private
Expand Down Expand Up @@ -1430,6 +1437,13 @@ declare module 'react-native-ble-plx' {
*/
manufacturerData: Base64 | null

/**
* Raw device scan data. When you have specific advertiser data,
* you can implement your own processing.
* @private
*/
rawScanRecord: Base64

/**
* Map of service UUIDs (as keys) with associated data (as values).
*/
Expand Down
Loading

0 comments on commit 8736dc1

Please sign in to comment.