Skip to content

Commit 25c89ce

Browse files
committed
Updated dependencies
1 parent 18a848f commit 25c89ce

14 files changed

Lines changed: 79 additions & 83 deletions

BluetoothExplorer.swiftpm/AppIntents/Entity/CharacteristicEntity.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ extension CharacteristicEntity {
6666

6767
var displayRepresentation: DisplayRepresentation {
6868
DisplayRepresentation(
69-
title: "\(BluetoothUUID(rawValue: uuid)?.name ?? uuid)",
69+
title: "\(BluetoothUUID(rawValue: uuid)?.metadata?.name ?? uuid)",
7070
subtitle: """
7171
Peripheral \(id.peripheral.description)
7272
Properties \(Store.Characteristic.Properties(rawValue: properties).description)

BluetoothExplorer.swiftpm/AppIntents/Entity/ServiceEntity.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extension ServiceEntity {
6464

6565
var displayRepresentation: DisplayRepresentation {
6666
DisplayRepresentation(
67-
title: "\(BluetoothUUID(rawValue: uuid)?.name ?? uuid)",
67+
title: "\(BluetoothUUID(rawValue: uuid)?.metadata?.name ?? uuid)",
6868
subtitle: "Peripheral \(id.peripheral.description)"
6969
)
7070
}

BluetoothExplorer.swiftpm/Model/BluetoothUUID.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ internal extension BluetoothUUID {
1212

1313
func description(for value: Data) -> String? {
1414
switch self {
15-
case .batteryLevel:
15+
case BluetoothUUID.Characteristic.batteryLevel:
1616
return value.first.flatMap { $0.description + "%" }
17-
case .currentTime:
17+
case BluetoothUUID.Characteristic.currentTime:
1818
return nil
19-
case .deviceName,
20-
.serialNumberString,
21-
.firmwareRevisionString,
22-
.softwareRevisionString,
23-
.hardwareRevisionString,
24-
.modelNumberString,
25-
.manufacturerNameString:
19+
case BluetoothUUID.Characteristic.deviceName,
20+
BluetoothUUID.Characteristic.serialNumberString,
21+
BluetoothUUID.Characteristic.firmwareRevisionString,
22+
BluetoothUUID.Characteristic.softwareRevisionString,
23+
BluetoothUUID.Characteristic.hardwareRevisionString,
24+
BluetoothUUID.Characteristic.modelNumberString,
25+
BluetoothUUID.Characteristic.manufacturerNameString:
2626
return String(data: value, encoding: .utf8)
2727
default:
2828
return nil

BluetoothExplorer.swiftpm/Model/Mock/MockAdvertisement.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extension MockAdvertisementData {
6565
manufacturerData: ManufacturerSpecificData(data: Data([0xd9, 0x01, 0x01, 0x02, 0x00, 0x00, 0x8c, 0x85, 0x90, 0xcb, 0x31, 0x74, 0x00, 0x60])),
6666
txPowerLevel: nil,
6767
serviceData: nil,
68-
serviceUUIDs: [.savantSystems2],
68+
serviceUUIDs: [BluetoothUUID.Member.savantSystems2],
6969
solicitedServiceUUIDs: nil
7070
)
7171
}

BluetoothExplorer.swiftpm/Model/Mock/MockAttributes.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ extension MockService {
1919
static var deviceInformation: MockService {
2020
Service(
2121
id: 10,
22-
uuid: .deviceInformation,
22+
uuid: BluetoothUUID.Service.deviceInformation,
2323
peripheral: .beacon
2424
)
2525
}
2626

2727
static var battery: MockService {
2828
Service(
2929
id: 20,
30-
uuid: .batteryService,
30+
uuid: BluetoothUUID.Service.battery,
3131
peripheral: .beacon
3232
)
3333
}
3434

3535
static var savantSystems: MockService {
3636
Service(
3737
id: 30,
38-
uuid: .savantSystems2,
38+
uuid: BluetoothUUID.Member.savantSystems2,
3939
peripheral: .smartThermostat
4040
)
4141
}
@@ -46,7 +46,7 @@ extension MockCharacteristic {
4646
static var deviceName: MockCharacteristic {
4747
Characteristic(
4848
id: 11,
49-
uuid: .deviceName,
49+
uuid: BluetoothUUID.Characteristic.deviceName,
5050
peripheral: .beacon,
5151
properties: [.read]
5252
)
@@ -55,7 +55,7 @@ extension MockCharacteristic {
5555
static var manufacturerName: MockCharacteristic {
5656
Characteristic(
5757
id: 12,
58-
uuid: .manufacturerNameString,
58+
uuid: BluetoothUUID.Characteristic.manufacturerNameString,
5959
peripheral: .beacon,
6060
properties: [.read]
6161
)
@@ -64,7 +64,7 @@ extension MockCharacteristic {
6464
static var modelNumber: MockCharacteristic {
6565
Characteristic(
6666
id: 13,
67-
uuid: .modelNumberString,
67+
uuid: BluetoothUUID.Characteristic.modelNumberString,
6868
peripheral: .beacon,
6969
properties: [.read]
7070
)
@@ -73,7 +73,7 @@ extension MockCharacteristic {
7373
static var serialNumber: MockCharacteristic {
7474
Characteristic(
7575
id: 14,
76-
uuid: .serialNumberString,
76+
uuid: BluetoothUUID.Characteristic.serialNumberString,
7777
peripheral: .beacon,
7878
properties: [.read]
7979
)
@@ -82,7 +82,7 @@ extension MockCharacteristic {
8282
static var batteryLevel: MockCharacteristic {
8383
Characteristic(
8484
id: 21,
85-
uuid: .batteryLevel,
85+
uuid: BluetoothUUID.Characteristic.batteryLevel,
8686
peripheral: .beacon,
8787
properties: [.read, .notify]
8888
)
@@ -101,7 +101,7 @@ extension MockDescriptor {
101101
static func clientCharacteristicConfiguration(_ peripheral: Peripheral) -> MockDescriptor {
102102
Descriptor(
103103
id: 99,
104-
uuid: .clientCharacteristicConfiguration,
104+
uuid: BluetoothUUID.Descriptor.clientCharacteristicConfiguration,
105105
peripheral: peripheral
106106
)
107107
}

BluetoothExplorer.swiftpm/Model/NativeCentral.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Bluetooth
1212
import GATT
1313
import DarwinGATT
1414

15-
#if os(iOS) && targetEnvironment(simulator)
15+
#if os(Android) || os(iOS) && targetEnvironment(simulator)
1616
typealias NativeCentral = MockCentral
1717

1818
extension NativeCentral {

BluetoothExplorer.swiftpm/Package.resolved

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BluetoothExplorer.swiftpm/Views/AttributeCell.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct AttributeCell: View {
1616
var body: some View {
1717
VStack(alignment: .leading, spacing: nil) {
1818
Text(uuid.rawValue)
19-
if let name = uuid.name {
19+
if let name = uuid.metadata?.name {
2020
Text(name)
2121
.font(.subheadline)
2222
.foregroundColor(.gray)
@@ -29,19 +29,19 @@ struct AttributeCell: View {
2929
struct AttributeCell_Preview: PreviewProvider {
3030
static var previews: some View {
3131
Group {
32-
AttributeCell(uuid: .deviceInformation)
32+
AttributeCell(uuid: BluetoothUUID.Service.deviceInformation)
3333
.previewLayout(.sizeThatFits)
34-
AttributeCell(uuid: .deviceInformation)
34+
AttributeCell(uuid: BluetoothUUID.Service.deviceInformation)
3535
.previewLayout(.sizeThatFits)
36-
AttributeCell(uuid: .deviceName)
36+
AttributeCell(uuid: BluetoothUUID.Characteristic.deviceName)
3737
.previewLayout(.sizeThatFits)
38-
AttributeCell(uuid: .modelNumberString)
38+
AttributeCell(uuid: BluetoothUUID.Characteristic.modelNumberString)
3939
.previewLayout(.sizeThatFits)
40-
AttributeCell(uuid: .serialNumberString)
40+
AttributeCell(uuid: BluetoothUUID.Characteristic.serialNumberString)
4141
.previewLayout(.sizeThatFits)
42-
AttributeCell(uuid: .batteryLevel)
42+
AttributeCell(uuid: BluetoothUUID.Characteristic.batteryLevel)
4343
.previewLayout(.sizeThatFits)
44-
AttributeCell(uuid: .clientCharacteristicConfiguration)
44+
AttributeCell(uuid: BluetoothUUID.Descriptor.clientCharacteristicConfiguration)
4545
.previewLayout(.sizeThatFits)
4646
}
4747
}

BluetoothExplorer.swiftpm/Views/AttributeValueCell.swift

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -79,43 +79,38 @@ extension AttributeValueCell {
7979
}
8080

8181
#if DEBUG
82-
struct AttributeValueCell_Preview: PreviewProvider {
83-
static var previews: some View {
84-
Group {
85-
AttributeValueCell(
86-
uuid: .deviceName,
87-
attributeValue: AttributeValue(
88-
date: Date(),
89-
type: .read,
90-
data: Data("iPhone".utf8)
91-
)
92-
)
93-
.previewLayout(.sizeThatFits)
94-
.previewDisplayName("Read")
95-
96-
AttributeValueCell(
97-
uuid: BluetoothUUID(),
98-
attributeValue: AttributeValue(
99-
date: Date(),
100-
type: .write,
101-
data: Data("12345".utf8)
102-
)
103-
)
104-
.previewLayout(.sizeThatFits)
105-
.previewDisplayName("Write")
106-
107-
AttributeValueCell(
108-
uuid: .batteryLevel,
109-
attributeValue:
110-
AttributeValue(
111-
date: Date(),
112-
type: .notification,
113-
data: Data([99])
114-
)
82+
#Preview("Read") {
83+
AttributeValueCell(
84+
uuid: BluetoothUUID.Characteristic.deviceName,
85+
attributeValue: AttributeValue(
86+
date: Date(),
87+
type: .read,
88+
data: Data("iPhone".utf8)
89+
)
90+
)
91+
}
92+
93+
#Preview("Write") {
94+
95+
AttributeValueCell(
96+
uuid: BluetoothUUID(),
97+
attributeValue: AttributeValue(
98+
date: Date(),
99+
type: .write,
100+
data: Data("12345".utf8)
101+
)
102+
)
103+
}
104+
105+
#Preview("Notification") {
106+
AttributeValueCell(
107+
uuid: BluetoothUUID.Characteristic.batteryLevel,
108+
attributeValue:
109+
AttributeValue(
110+
date: Date(),
111+
type: .notification,
112+
data: Data([99])
115113
)
116-
.previewLayout(.sizeThatFits)
117-
.previewDisplayName("Notification")
118-
}
119-
}
114+
)
120115
}
121116
#endif

BluetoothExplorer.swiftpm/Views/AttributeValuesSection.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct AttributeValuesSection: View {
2828
})
2929
}
3030
}
31-
31+
/*
3232
#if DEBUG
3333
struct AttributeValuesSection_Preview: PreviewProvider {
3434
static var previews: some View {
@@ -99,3 +99,4 @@ struct AttributeValuesSection_Preview: PreviewProvider {
9999
}
100100
}
101101
#endif
102+
*/

0 commit comments

Comments
 (0)