Implement timestamp in scanResult (#198)
* Implement timestamp in scanResult * Update pigeon * implement windows * Update changelog * Fix Swift formatting * Remove android unused import * Format pigeon generated file
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Autogenerated from Pigeon (v26.1.0), do not edit directly.
|
||||
// Autogenerated from Pigeon (v26.1.4), do not edit directly.
|
||||
// See also: https://pub.dev/packages/pigeon
|
||||
|
||||
import Foundation
|
||||
@@ -205,6 +205,7 @@ struct UniversalBleScanResult: Hashable {
|
||||
var rssi: Int64? = nil
|
||||
var manufacturerDataList: [UniversalManufacturerData]? = nil
|
||||
var services: [String]? = nil
|
||||
var timestamp: Int64? = nil
|
||||
|
||||
|
||||
// swift-format-ignore: AlwaysUseLowerCamelCase
|
||||
@@ -215,6 +216,7 @@ struct UniversalBleScanResult: Hashable {
|
||||
let rssi: Int64? = nilOrValue(pigeonVar_list[3])
|
||||
let manufacturerDataList: [UniversalManufacturerData]? = nilOrValue(pigeonVar_list[4])
|
||||
let services: [String]? = nilOrValue(pigeonVar_list[5])
|
||||
let timestamp: Int64? = nilOrValue(pigeonVar_list[6])
|
||||
|
||||
return UniversalBleScanResult(
|
||||
deviceId: deviceId,
|
||||
@@ -222,7 +224,8 @@ struct UniversalBleScanResult: Hashable {
|
||||
isPaired: isPaired,
|
||||
rssi: rssi,
|
||||
manufacturerDataList: manufacturerDataList,
|
||||
services: services
|
||||
services: services,
|
||||
timestamp: timestamp
|
||||
)
|
||||
}
|
||||
func toList() -> [Any?] {
|
||||
@@ -233,6 +236,7 @@ struct UniversalBleScanResult: Hashable {
|
||||
rssi,
|
||||
manufacturerDataList,
|
||||
services,
|
||||
timestamp,
|
||||
]
|
||||
}
|
||||
static func == (lhs: UniversalBleScanResult, rhs: UniversalBleScanResult) -> Bool {
|
||||
|
||||
@@ -362,7 +362,8 @@ private class BleCentralDarwin: NSObject, UniversalBlePlatformChannel, CBCentral
|
||||
let name = advertisementNameCache[id] ?? discoveredPeripherals[id]?.name ?? peripheral.name ?? ""
|
||||
return UniversalBleScanResult(
|
||||
deviceId: id,
|
||||
name: name
|
||||
name: name,
|
||||
timestamp: Int64(Date().timeIntervalSince1970 * 1000)
|
||||
)
|
||||
}))
|
||||
}
|
||||
@@ -415,7 +416,8 @@ private class BleCentralDarwin: NSObject, UniversalBlePlatformChannel, CBCentral
|
||||
isPaired: nil,
|
||||
rssi: RSSI as? Int64,
|
||||
manufacturerDataList: manufacturerDataList,
|
||||
services: services?.map { $0.uuidStr }
|
||||
services: services?.map { $0.uuidStr },
|
||||
timestamp: Int64(Date().timeIntervalSince1970 * 1000)
|
||||
)) { _ in }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user