Skip to content

Commit

Permalink
Merge pull request #36 from eu-digital-identity-wallet/develop
Browse files Browse the repository at this point in the history
Refactor MdocGattServer and MdocOfflineDelegate classes
  • Loading branch information
phisakel authored Oct 11, 2024
2 parents 5c1812a + 048f2dd commit 2f00a68
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
10 changes: 5 additions & 5 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"originHash" : "c2280e9a08e51034151015bda509fa109a1bef75c66d1cabed12b4b4025a1474",
"originHash" : "fc60708f41996a66ff09913bb5bc0934ff3d47779d3ec833bf24adbed0bb2ad4",
"pins" : [
{
"identity" : "eudi-lib-ios-iso18013-data-model",
"kind" : "remoteSourceControl",
"location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git",
"state" : {
"revision" : "39ba199744ad478544fbad3a73c4a47677f34ec7",
"version" : "0.3.2"
"revision" : "c1b4383d6fc3387a8ed4c79177548624c4e34e3a",
"version" : "0.3.3"
}
},
{
"identity" : "eudi-lib-ios-iso18013-security",
"kind" : "remoteSourceControl",
"location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-security.git",
"state" : {
"revision" : "89cccb0dec4e675d3d83e9e78076822d98d024bb",
"version" : "0.2.5"
"revision" : "13d65a1010ee9e6219f8bccbab6eb32f67405d86",
"version" : "0.2.6"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ let package = Package(
targets: ["MdocDataTransfer18013"]),
],
dependencies: [
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git", exact: "0.3.2"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-security.git", exact: "0.2.5"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git", exact: "0.3.3"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-security.git", exact: "0.2.6"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import MdocDataModel18013
import MdocSecurity18013

/// BLE Gatt server implementation of mdoc transfer manager
@MainActor
public class MdocGattServer: ObservableObject {
public class MdocGattServer: @unchecked Sendable, ObservableObject {
var peripheralManager: CBPeripheralManager!
var bleDelegate: Delegate!
var remoteCentral: CBCentral!
Expand Down Expand Up @@ -65,8 +64,7 @@ public class MdocGattServer: ObservableObject {
handleStatusChange(status)
}

@MainActor
@objc(CBPeripheralManagerDelegate)
@objc(CBPeripheralManagerDelegate)
class Delegate: NSObject, @preconcurrency CBPeripheralManagerDelegate {
unowned var server: MdocGattServer

Expand Down Expand Up @@ -251,7 +249,6 @@ public class MdocGattServer: ObservableObject {
prepareDataToSend(bytesToSend)
DispatchQueue.main.asyncAfter(deadline: .now()+0.2) {
self.sendDataWithUpdates()
self.error = errorToSend
}
}
if !b { errorToSend = MdocHelpers.makeError(code: .userRejected) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import MdocDataModel18013
import MdocSecurity18013

/// delegate protocol for clients of the mdoc offline transfer manager
@MainActor
public protocol MdocOfflineDelegate: AnyObject {
func didChangeStatus(_ newStatus: TransferStatus)
func didFinishedWithError(_ error: Error)
Expand Down

0 comments on commit 2f00a68

Please sign in to comment.