Skip to content

Commit

Permalink
Fix BluetoothAccessoryServer advertising
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Mar 3, 2024
1 parent 8eaf68a commit 99247fc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Sources/BluetoothAccessory/Server/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ public actor BluetoothAccessoryServer <Peripheral: AccessoryPeripheralManager>:

public private(set) var state: GlobalStateNumber = .setup

internal var beacon: AccessoryBeacon {
.init(id: id, type: type, state: state)
}

var services: [any AccessoryService]

weak var delegate: BluetoothAccessoryServerDelegate?
Expand Down Expand Up @@ -116,6 +112,8 @@ public actor BluetoothAccessoryServer <Peripheral: AccessoryPeripheralManager>:

private func start() async throws {
try await peripheral.start()
// start advertising
let beacon = AccessoryBeacon.accessory(id, type, state)
try await advertise(beacon: beacon)
}

Expand Down

0 comments on commit 99247fc

Please sign in to comment.