react-native-ble-nitro 1.9.2 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/ios/BleNitroBleManager.swift +2 -2
- package/lib/commonjs/manager.d.ts +1 -0
- package/lib/commonjs/manager.d.ts.map +1 -1
- package/lib/commonjs/manager.js +2 -0
- package/lib/commonjs/manager.js.map +1 -1
- package/lib/manager.d.ts +1 -0
- package/lib/manager.js +1 -0
- package/nitrogen/generated/android/BleNitro+autolinking.cmake +3 -1
- package/nitrogen/generated/android/BleNitro+autolinking.gradle +1 -1
- package/nitrogen/generated/android/BleNitroOnLoad.cpp +3 -3
- package/nitrogen/generated/android/BleNitroOnLoad.hpp +1 -1
- package/nitrogen/generated/android/c++/JAndroidScanMode.hpp +5 -6
- package/nitrogen/generated/android/c++/JBLEDevice.hpp +8 -4
- package/nitrogen/generated/android/c++/JBLEState.hpp +7 -8
- package/nitrogen/generated/android/c++/JFunc_void_BLEState.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_bool_double_std__string.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_bool_std__shared_ptr_ArrayBuffer__std__string.hpp +3 -3
- package/nitrogen/generated/android/c++/JFunc_void_bool_std__string.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_bool_std__string_std__string.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__.hpp +91 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string_bool_std__string.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_std__string_std__shared_ptr_ArrayBuffer_.hpp +3 -3
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_BLEDevice_.hpp +5 -4
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroFactorySpec.cpp +15 -4
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroFactorySpec.hpp +3 -1
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroSpec.cpp +27 -9
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroSpec.hpp +4 -2
- package/nitrogen/generated/android/c++/JManufacturerData.hpp +8 -4
- package/nitrogen/generated/android/c++/JManufacturerDataEntry.hpp +6 -3
- package/nitrogen/generated/android/c++/JOperationResult.hpp +6 -2
- package/nitrogen/generated/android/c++/JScanFilter.hpp +8 -3
- package/nitrogen/generated/android/c++/JVariant_NullType_BLEDevice.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_BLEDevice.hpp +79 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_String.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_String.hpp +70 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/AndroidScanMode.kt +3 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BLEDevice.kt +34 -25
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BLEState.kt +3 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleNitroOnLoad.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_BLEState.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_bool_double_std__string.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_bool_std__shared_ptr_ArrayBuffer__std__string.kt +2 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_bool_std__string.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_bool_std__string_std__string.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{Func_void_std__optional_BLEDevice__std__optional_std__string_.kt → Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__.kt} +11 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__string_bool_std__string.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__string_std__shared_ptr_ArrayBuffer_.kt +2 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__vector_BLEDevice_.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridNativeBleNitroFactorySpec.kt +8 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridNativeBleNitroSpec.kt +13 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ManufacturerData.kt +16 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ManufacturerDataEntry.kt +20 -11
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/OperationResult.kt +19 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanFilter.kt +25 -16
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Variant_NullType_BLEDevice.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Variant_NullType_String.kt +59 -0
- package/nitrogen/generated/ios/BleNitro+autolinking.rb +2 -2
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.cpp +6 -5
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.hpp +99 -27
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Umbrella.hpp +3 -3
- package/nitrogen/generated/ios/BleNitroAutolinking.mm +1 -1
- package/nitrogen/generated/ios/BleNitroAutolinking.swift +13 -15
- package/nitrogen/generated/ios/c++/HybridNativeBleNitroFactorySpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridNativeBleNitroFactorySpecSwift.hpp +10 -3
- package/nitrogen/generated/ios/c++/HybridNativeBleNitroSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridNativeBleNitroSpecSwift.hpp +13 -4
- package/nitrogen/generated/ios/swift/AndroidScanMode.swift +1 -1
- package/nitrogen/generated/ios/swift/BLEDevice.swift +15 -63
- package/nitrogen/generated/ios/swift/BLEState.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_BLEState.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_bool_double_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_bool_std__shared_ptr_ArrayBuffer__std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_bool_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_bool_std__string_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__.swift +84 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string_bool_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__string_std__shared_ptr_ArrayBuffer_.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__vector_BLEDevice_.swift +1 -2
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroFactorySpec.swift +10 -4
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroFactorySpec_cxx.swift +18 -3
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroSpec.swift +11 -5
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroSpec_cxx.swift +48 -12
- package/nitrogen/generated/ios/swift/ManufacturerData.swift +3 -15
- package/nitrogen/generated/ios/swift/ManufacturerDataEntry.swift +5 -17
- package/nitrogen/generated/ios/swift/OperationResult.swift +12 -30
- package/nitrogen/generated/ios/swift/ScanFilter.swift +9 -39
- package/nitrogen/generated/ios/swift/Variant_NullType_BLEDevice.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_String.swift +18 -0
- package/nitrogen/generated/shared/c++/AndroidScanMode.hpp +1 -1
- package/nitrogen/generated/shared/c++/BLEDevice.hpp +31 -23
- package/nitrogen/generated/shared/c++/BLEState.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroFactorySpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroFactorySpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroSpec.hpp +4 -4
- package/nitrogen/generated/shared/c++/ManufacturerData.hpp +13 -5
- package/nitrogen/generated/shared/c++/ManufacturerDataEntry.hpp +17 -10
- package/nitrogen/generated/shared/c++/OperationResult.hpp +16 -8
- package/nitrogen/generated/shared/c++/ScanFilter.hpp +22 -14
- package/package.json +10 -10
- package/src/manager.ts +2 -1
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_BLEDevice__std__optional_std__string_.hpp +0 -86
- package/nitrogen/generated/ios/swift/Func_void_std__optional_BLEDevice__std__optional_std__string_.swift +0 -54
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_NullType_BLEDevice.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.co.zyke.ble
|
|
9
|
+
|
|
10
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
11
|
+
import com.margelo.nitro.core.NullType
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the TypeScript variant "NullType | BLEDevice".
|
|
15
|
+
*/
|
|
16
|
+
@Suppress("ClassName")
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
sealed class Variant_NullType_BLEDevice {
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
data class First(@DoNotStrip val value: NullType): Variant_NullType_BLEDevice()
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
data class Second(@DoNotStrip val value: BLEDevice): Variant_NullType_BLEDevice()
|
|
23
|
+
|
|
24
|
+
@Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
|
|
25
|
+
inline fun <reified T> getAs(): T? = when (this) {
|
|
26
|
+
is First -> value as? T
|
|
27
|
+
is Second -> value as? T
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
val isFirst: Boolean
|
|
31
|
+
get() = this is First
|
|
32
|
+
val isSecond: Boolean
|
|
33
|
+
get() = this is Second
|
|
34
|
+
|
|
35
|
+
fun asFirstOrNull(): NullType? {
|
|
36
|
+
val value = (this as? First)?.value ?: return null
|
|
37
|
+
return value
|
|
38
|
+
}
|
|
39
|
+
fun asSecondOrNull(): BLEDevice? {
|
|
40
|
+
val value = (this as? Second)?.value ?: return null
|
|
41
|
+
return value
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
inline fun <R> match(first: (NullType) -> R, second: (BLEDevice) -> R): R {
|
|
45
|
+
return when (this) {
|
|
46
|
+
is First -> first(value)
|
|
47
|
+
is Second -> second(value)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
companion object {
|
|
52
|
+
@JvmStatic
|
|
53
|
+
@DoNotStrip
|
|
54
|
+
fun create(value: NullType): Variant_NullType_BLEDevice = First(value)
|
|
55
|
+
@JvmStatic
|
|
56
|
+
@DoNotStrip
|
|
57
|
+
fun create(value: BLEDevice): Variant_NullType_BLEDevice = Second(value)
|
|
58
|
+
}
|
|
59
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Variant_NullType_String.kt
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_NullType_String.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.co.zyke.ble
|
|
9
|
+
|
|
10
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
11
|
+
import com.margelo.nitro.core.NullType
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the TypeScript variant "NullType | String".
|
|
15
|
+
*/
|
|
16
|
+
@Suppress("ClassName")
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
sealed class Variant_NullType_String {
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
data class First(@DoNotStrip val value: NullType): Variant_NullType_String()
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
data class Second(@DoNotStrip val value: String): Variant_NullType_String()
|
|
23
|
+
|
|
24
|
+
@Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
|
|
25
|
+
inline fun <reified T> getAs(): T? = when (this) {
|
|
26
|
+
is First -> value as? T
|
|
27
|
+
is Second -> value as? T
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
val isFirst: Boolean
|
|
31
|
+
get() = this is First
|
|
32
|
+
val isSecond: Boolean
|
|
33
|
+
get() = this is Second
|
|
34
|
+
|
|
35
|
+
fun asFirstOrNull(): NullType? {
|
|
36
|
+
val value = (this as? First)?.value ?: return null
|
|
37
|
+
return value
|
|
38
|
+
}
|
|
39
|
+
fun asSecondOrNull(): String? {
|
|
40
|
+
val value = (this as? Second)?.value ?: return null
|
|
41
|
+
return value
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
inline fun <R> match(first: (NullType) -> R, second: (String) -> R): R {
|
|
45
|
+
return when (this) {
|
|
46
|
+
is First -> first(value)
|
|
47
|
+
is Second -> second(value)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
companion object {
|
|
52
|
+
@JvmStatic
|
|
53
|
+
@DoNotStrip
|
|
54
|
+
fun create(value: NullType): Variant_NullType_String = First(value)
|
|
55
|
+
@JvmStatic
|
|
56
|
+
@DoNotStrip
|
|
57
|
+
fun create(value: String): Variant_NullType_String = Second(value)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# BleNitro+autolinking.rb
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# This is a Ruby script that adds all files generated by Nitrogen
|
|
@@ -52,7 +52,7 @@ def add_nitrogen_files(spec)
|
|
|
52
52
|
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
53
|
# Use C++ 20
|
|
54
54
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
-
# Enables C++ <-> Swift interop (by default it's only
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
56
|
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
57
|
# Enables stricter modular headers
|
|
58
58
|
"DEFINES_MODULE" => "YES",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BleNitro-Swift-Cxx-Bridge.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "BleNitro-Swift-Cxx-Bridge.hpp"
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#include "BleNitro-Swift-Cxx-Umbrella.hpp"
|
|
12
12
|
#include "HybridNativeBleNitroFactorySpecSwift.hpp"
|
|
13
13
|
#include "HybridNativeBleNitroSpecSwift.hpp"
|
|
14
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
15
|
|
|
15
16
|
namespace margelo::nitro::co::zyke::ble::bridge::swift {
|
|
16
17
|
|
|
@@ -22,10 +23,10 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
|
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
// pragma MARK: std::function<void(const std::optional<BLEDevice
|
|
26
|
-
|
|
27
|
-
auto swiftClosure = BleNitro::
|
|
28
|
-
return [swiftClosure = std::move(swiftClosure)](const std::optional<BLEDevice
|
|
26
|
+
// pragma MARK: std::function<void(const std::optional<std::variant<nitro::NullType, BLEDevice>>& /* device */, const std::optional<std::variant<nitro::NullType, std::string>>& /* error */)>
|
|
27
|
+
Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__ create_Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
28
|
+
auto swiftClosure = BleNitro::Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__::fromUnsafe(swiftClosureWrapper);
|
|
29
|
+
return [swiftClosure = std::move(swiftClosure)](const std::optional<std::variant<nitro::NullType, BLEDevice>>& device, const std::optional<std::variant<nitro::NullType, std::string>>& error) mutable -> void {
|
|
29
30
|
swiftClosure.call(device, error);
|
|
30
31
|
};
|
|
31
32
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BleNitro-Swift-Cxx-Bridge.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `ArrayBufferHolder` to properly resolve imports.
|
|
12
12
|
namespace NitroModules { class ArrayBufferHolder; }
|
|
13
|
-
// Forward declaration of `ArrayBuffer` to properly resolve imports.
|
|
14
|
-
namespace NitroModules { class ArrayBuffer; }
|
|
15
13
|
// Forward declaration of `BLEDevice` to properly resolve imports.
|
|
16
14
|
namespace margelo::nitro::co::zyke::ble { struct BLEDevice; }
|
|
17
15
|
// Forward declaration of `BLEState` to properly resolve imports.
|
|
@@ -43,7 +41,7 @@ namespace BleNitro { class HybridNativeBleNitroSpec_cxx; }
|
|
|
43
41
|
#include "OperationResult.hpp"
|
|
44
42
|
#include <NitroModules/ArrayBuffer.hpp>
|
|
45
43
|
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
46
|
-
#include <NitroModules/
|
|
44
|
+
#include <NitroModules/Null.hpp>
|
|
47
45
|
#include <NitroModules/Promise.hpp>
|
|
48
46
|
#include <NitroModules/PromiseHolder.hpp>
|
|
49
47
|
#include <NitroModules/Result.hpp>
|
|
@@ -52,6 +50,7 @@ namespace BleNitro { class HybridNativeBleNitroSpec_cxx; }
|
|
|
52
50
|
#include <memory>
|
|
53
51
|
#include <optional>
|
|
54
52
|
#include <string>
|
|
53
|
+
#include <variant>
|
|
55
54
|
#include <vector>
|
|
56
55
|
|
|
57
56
|
/**
|
|
@@ -72,7 +71,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
|
|
|
72
71
|
return optional.has_value();
|
|
73
72
|
}
|
|
74
73
|
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
75
|
-
return
|
|
74
|
+
return optional.value();
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
// pragma MARK: std::vector<ManufacturerDataEntry>
|
|
@@ -130,41 +129,114 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
|
|
|
130
129
|
return Func_void_std__vector_BLEDevice__Wrapper(std::move(value));
|
|
131
130
|
}
|
|
132
131
|
|
|
133
|
-
// pragma MARK: std::
|
|
132
|
+
// pragma MARK: std::variant<nitro::NullType, BLEDevice>
|
|
134
133
|
/**
|
|
135
|
-
*
|
|
134
|
+
* Wrapper struct for `std::variant<nitro::NullType, BLEDevice>`.
|
|
135
|
+
* std::variant cannot be used in Swift because of a Swift bug.
|
|
136
|
+
* Not even specializing it works. So we create a wrapper struct.
|
|
136
137
|
*/
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
struct std__variant_nitro__NullType__BLEDevice_ final {
|
|
139
|
+
std::variant<nitro::NullType, BLEDevice> variant;
|
|
140
|
+
std__variant_nitro__NullType__BLEDevice_(std::variant<nitro::NullType, BLEDevice> variant): variant(variant) { }
|
|
141
|
+
operator std::variant<nitro::NullType, BLEDevice>() const noexcept {
|
|
142
|
+
return variant;
|
|
143
|
+
}
|
|
144
|
+
inline size_t index() const noexcept {
|
|
145
|
+
return variant.index();
|
|
146
|
+
}
|
|
147
|
+
inline nitro::NullType get_0() const noexcept {
|
|
148
|
+
return std::get<0>(variant);
|
|
149
|
+
}
|
|
150
|
+
inline BLEDevice get_1() const noexcept {
|
|
151
|
+
return std::get<1>(variant);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
inline std__variant_nitro__NullType__BLEDevice_ create_std__variant_nitro__NullType__BLEDevice_(nitro::NullType value) noexcept {
|
|
155
|
+
return std__variant_nitro__NullType__BLEDevice_(value);
|
|
156
|
+
}
|
|
157
|
+
inline std__variant_nitro__NullType__BLEDevice_ create_std__variant_nitro__NullType__BLEDevice_(const BLEDevice& value) noexcept {
|
|
158
|
+
return std__variant_nitro__NullType__BLEDevice_(value);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// pragma MARK: std::optional<std::variant<nitro::NullType, BLEDevice>>
|
|
162
|
+
/**
|
|
163
|
+
* Specialized version of `std::optional<std::variant<nitro::NullType, BLEDevice>>`.
|
|
164
|
+
*/
|
|
165
|
+
using std__optional_std__variant_nitro__NullType__BLEDevice__ = std::optional<std::variant<nitro::NullType, BLEDevice>>;
|
|
166
|
+
inline std::optional<std::variant<nitro::NullType, BLEDevice>> create_std__optional_std__variant_nitro__NullType__BLEDevice__(const std::variant<nitro::NullType, BLEDevice>& value) noexcept {
|
|
167
|
+
return std::optional<std::variant<nitro::NullType, BLEDevice>>(value);
|
|
168
|
+
}
|
|
169
|
+
inline bool has_value_std__optional_std__variant_nitro__NullType__BLEDevice__(const std::optional<std::variant<nitro::NullType, BLEDevice>>& optional) noexcept {
|
|
170
|
+
return optional.has_value();
|
|
171
|
+
}
|
|
172
|
+
inline std::variant<nitro::NullType, BLEDevice> get_std__optional_std__variant_nitro__NullType__BLEDevice__(const std::optional<std::variant<nitro::NullType, BLEDevice>>& optional) noexcept {
|
|
173
|
+
return optional.value();
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// pragma MARK: std::variant<nitro::NullType, std::string>
|
|
177
|
+
/**
|
|
178
|
+
* Wrapper struct for `std::variant<nitro::NullType, std::string>`.
|
|
179
|
+
* std::variant cannot be used in Swift because of a Swift bug.
|
|
180
|
+
* Not even specializing it works. So we create a wrapper struct.
|
|
181
|
+
*/
|
|
182
|
+
struct std__variant_nitro__NullType__std__string_ final {
|
|
183
|
+
std::variant<nitro::NullType, std::string> variant;
|
|
184
|
+
std__variant_nitro__NullType__std__string_(std::variant<nitro::NullType, std::string> variant): variant(variant) { }
|
|
185
|
+
operator std::variant<nitro::NullType, std::string>() const noexcept {
|
|
186
|
+
return variant;
|
|
187
|
+
}
|
|
188
|
+
inline size_t index() const noexcept {
|
|
189
|
+
return variant.index();
|
|
190
|
+
}
|
|
191
|
+
inline nitro::NullType get_0() const noexcept {
|
|
192
|
+
return std::get<0>(variant);
|
|
193
|
+
}
|
|
194
|
+
inline std::string get_1() const noexcept {
|
|
195
|
+
return std::get<1>(variant);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
inline std__variant_nitro__NullType__std__string_ create_std__variant_nitro__NullType__std__string_(nitro::NullType value) noexcept {
|
|
199
|
+
return std__variant_nitro__NullType__std__string_(value);
|
|
200
|
+
}
|
|
201
|
+
inline std__variant_nitro__NullType__std__string_ create_std__variant_nitro__NullType__std__string_(const std::string& value) noexcept {
|
|
202
|
+
return std__variant_nitro__NullType__std__string_(value);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// pragma MARK: std::optional<std::variant<nitro::NullType, std::string>>
|
|
206
|
+
/**
|
|
207
|
+
* Specialized version of `std::optional<std::variant<nitro::NullType, std::string>>`.
|
|
208
|
+
*/
|
|
209
|
+
using std__optional_std__variant_nitro__NullType__std__string__ = std::optional<std::variant<nitro::NullType, std::string>>;
|
|
210
|
+
inline std::optional<std::variant<nitro::NullType, std::string>> create_std__optional_std__variant_nitro__NullType__std__string__(const std::variant<nitro::NullType, std::string>& value) noexcept {
|
|
211
|
+
return std::optional<std::variant<nitro::NullType, std::string>>(value);
|
|
140
212
|
}
|
|
141
|
-
inline bool
|
|
213
|
+
inline bool has_value_std__optional_std__variant_nitro__NullType__std__string__(const std::optional<std::variant<nitro::NullType, std::string>>& optional) noexcept {
|
|
142
214
|
return optional.has_value();
|
|
143
215
|
}
|
|
144
|
-
inline
|
|
145
|
-
return
|
|
216
|
+
inline std::variant<nitro::NullType, std::string> get_std__optional_std__variant_nitro__NullType__std__string__(const std::optional<std::variant<nitro::NullType, std::string>>& optional) noexcept {
|
|
217
|
+
return optional.value();
|
|
146
218
|
}
|
|
147
219
|
|
|
148
|
-
// pragma MARK: std::function<void(const std::optional<BLEDevice
|
|
220
|
+
// pragma MARK: std::function<void(const std::optional<std::variant<nitro::NullType, BLEDevice>>& /* device */, const std::optional<std::variant<nitro::NullType, std::string>>& /* error */)>
|
|
149
221
|
/**
|
|
150
|
-
* Specialized version of `std::function<void(const std::optional<BLEDevice
|
|
222
|
+
* Specialized version of `std::function<void(const std::optional<std::variant<nitro::NullType, BLEDevice>>&, const std::optional<std::variant<nitro::NullType, std::string>>&)>`.
|
|
151
223
|
*/
|
|
152
|
-
using
|
|
224
|
+
using Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__ = std::function<void(const std::optional<std::variant<nitro::NullType, BLEDevice>>& /* device */, const std::optional<std::variant<nitro::NullType, std::string>>& /* error */)>;
|
|
153
225
|
/**
|
|
154
|
-
* Wrapper class for a `std::function<void(const std::optional<BLEDevice
|
|
226
|
+
* Wrapper class for a `std::function<void(const std::optional<std::variant<nitro::NullType, BLEDevice>>& / * device * /, const std::optional<std::variant<nitro::NullType, std::string>>& / * error * /)>`, this can be used from Swift.
|
|
155
227
|
*/
|
|
156
|
-
class
|
|
228
|
+
class Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string___Wrapper final {
|
|
157
229
|
public:
|
|
158
|
-
explicit
|
|
159
|
-
inline void call(std::optional<BLEDevice
|
|
230
|
+
explicit Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string___Wrapper(std::function<void(const std::optional<std::variant<nitro::NullType, BLEDevice>>& /* device */, const std::optional<std::variant<nitro::NullType, std::string>>& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::optional<std::variant<nitro::NullType, BLEDevice>>& /* device */, const std::optional<std::variant<nitro::NullType, std::string>>& /* error */)>>(std::move(func))) {}
|
|
231
|
+
inline void call(std::optional<std::variant<nitro::NullType, BLEDevice>> device, std::optional<std::variant<nitro::NullType, std::string>> error) const noexcept {
|
|
160
232
|
_function->operator()(device, error);
|
|
161
233
|
}
|
|
162
234
|
private:
|
|
163
|
-
std::unique_ptr<std::function<void(const std::optional<BLEDevice
|
|
235
|
+
std::unique_ptr<std::function<void(const std::optional<std::variant<nitro::NullType, BLEDevice>>& /* device */, const std::optional<std::variant<nitro::NullType, std::string>>& /* error */)>> _function;
|
|
164
236
|
} SWIFT_NONCOPYABLE;
|
|
165
|
-
|
|
166
|
-
inline
|
|
167
|
-
return
|
|
237
|
+
Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__ create_Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
238
|
+
inline Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string___Wrapper wrap_Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__(Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__ value) noexcept {
|
|
239
|
+
return Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string___Wrapper(std::move(value));
|
|
168
240
|
}
|
|
169
241
|
|
|
170
242
|
// pragma MARK: std::function<void(bool /* success */, const std::string& /* deviceId */, const std::string& /* error */)>
|
|
@@ -223,7 +295,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
|
|
|
223
295
|
return optional.has_value();
|
|
224
296
|
}
|
|
225
297
|
inline std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)> get_std__optional_std__function_void_const_std__string_____deviceId_____bool____interrupted_____const_std__string_____error______(const std::optional<std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>>& optional) noexcept {
|
|
226
|
-
return
|
|
298
|
+
return optional.value();
|
|
227
299
|
}
|
|
228
300
|
|
|
229
301
|
// pragma MARK: std::optional<bool>
|
|
@@ -238,7 +310,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
|
|
|
238
310
|
return optional.has_value();
|
|
239
311
|
}
|
|
240
312
|
inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
241
|
-
return
|
|
313
|
+
return optional.value();
|
|
242
314
|
}
|
|
243
315
|
|
|
244
316
|
// pragma MARK: std::function<void(bool /* success */, const std::string& /* error */)>
|
|
@@ -503,7 +575,7 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
|
|
|
503
575
|
return optional.has_value();
|
|
504
576
|
}
|
|
505
577
|
inline std::function<void(const std::vector<BLEDevice>& /* peripherals */)> get_std__optional_std__function_void_const_std__vector_BLEDevice______peripherals______(const std::optional<std::function<void(const std::vector<BLEDevice>& /* peripherals */)>>& optional) noexcept {
|
|
506
|
-
return
|
|
578
|
+
return optional.value();
|
|
507
579
|
}
|
|
508
580
|
|
|
509
581
|
// pragma MARK: std::shared_ptr<HybridNativeBleNitroFactorySpec>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BleNitro-Swift-Cxx-Umbrella.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `AndroidScanMode` to properly resolve imports.
|
|
12
12
|
namespace margelo::nitro::co::zyke::ble { enum class AndroidScanMode; }
|
|
13
|
-
// Forward declaration of `ArrayBuffer` to properly resolve imports.
|
|
14
|
-
namespace NitroModules { class ArrayBuffer; }
|
|
15
13
|
// Forward declaration of `BLEDevice` to properly resolve imports.
|
|
16
14
|
namespace margelo::nitro::co::zyke::ble { struct BLEDevice; }
|
|
17
15
|
// Forward declaration of `BLEState` to properly resolve imports.
|
|
@@ -40,6 +38,7 @@ namespace margelo::nitro::co::zyke::ble { struct ScanFilter; }
|
|
|
40
38
|
#include "OperationResult.hpp"
|
|
41
39
|
#include "ScanFilter.hpp"
|
|
42
40
|
#include <NitroModules/ArrayBuffer.hpp>
|
|
41
|
+
#include <NitroModules/Null.hpp>
|
|
43
42
|
#include <NitroModules/Promise.hpp>
|
|
44
43
|
#include <NitroModules/Result.hpp>
|
|
45
44
|
#include <exception>
|
|
@@ -47,6 +46,7 @@ namespace margelo::nitro::co::zyke::ble { struct ScanFilter; }
|
|
|
47
46
|
#include <memory>
|
|
48
47
|
#include <optional>
|
|
49
48
|
#include <string>
|
|
49
|
+
#include <variant>
|
|
50
50
|
#include <vector>
|
|
51
51
|
|
|
52
52
|
// C++ helpers for Swift
|
|
@@ -2,19 +2,16 @@
|
|
|
2
2
|
/// BleNitroAutolinking.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
+
// See: https://github.com/swiftlang/swift/pull/83616
|
|
8
12
|
public final class BleNitroAutolinking {
|
|
9
13
|
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
10
14
|
|
|
11
|
-
/**
|
|
12
|
-
* Creates an instance of a Swift class that implements `HybridNativeBleNitroSpec`,
|
|
13
|
-
* and wraps it in a Swift class that can directly interop with C++ (`HybridNativeBleNitroSpec_cxx`)
|
|
14
|
-
*
|
|
15
|
-
* This is generated by Nitrogen and will initialize the class specified
|
|
16
|
-
* in the `"autolinking"` property of `nitro.json` (in this case, `BleNitroBleManager`).
|
|
17
|
-
*/
|
|
18
15
|
public static func createNativeBleNitro() -> bridge.std__shared_ptr_HybridNativeBleNitroSpec_ {
|
|
19
16
|
let hybridObject = BleNitroBleManager()
|
|
20
17
|
return { () -> bridge.std__shared_ptr_HybridNativeBleNitroSpec_ in
|
|
@@ -23,13 +20,10 @@ public final class BleNitroAutolinking {
|
|
|
23
20
|
}()
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* This is generated by Nitrogen and will initialize the class specified
|
|
31
|
-
* in the `"autolinking"` property of `nitro.json` (in this case, `BleNitroBleManagerFactory`).
|
|
32
|
-
*/
|
|
23
|
+
public static func isNativeBleNitroRecyclable() -> Bool {
|
|
24
|
+
return BleNitroBleManager.self is any RecyclableView.Type
|
|
25
|
+
}
|
|
26
|
+
|
|
33
27
|
public static func createNativeBleNitroFactory() -> bridge.std__shared_ptr_HybridNativeBleNitroFactorySpec_ {
|
|
34
28
|
let hybridObject = BleNitroBleManagerFactory()
|
|
35
29
|
return { () -> bridge.std__shared_ptr_HybridNativeBleNitroFactorySpec_ in
|
|
@@ -37,4 +31,8 @@ public final class BleNitroAutolinking {
|
|
|
37
31
|
return __cxxWrapped.getCxxPart()
|
|
38
32
|
}()
|
|
39
33
|
}
|
|
34
|
+
|
|
35
|
+
public static func isNativeBleNitroFactoryRecyclable() -> Bool {
|
|
36
|
+
return BleNitroBleManagerFactory.self is any RecyclableView.Type
|
|
37
|
+
}
|
|
40
38
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridNativeBleNitroFactorySpecSwift.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridNativeBleNitroFactorySpecSwift.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridNativeBleNitroFactorySpecSwift.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -20,8 +20,6 @@ namespace margelo::nitro::co::zyke::ble { struct BLEDevice; }
|
|
|
20
20
|
namespace margelo::nitro::co::zyke::ble { struct ManufacturerData; }
|
|
21
21
|
// Forward declaration of `ManufacturerDataEntry` to properly resolve imports.
|
|
22
22
|
namespace margelo::nitro::co::zyke::ble { struct ManufacturerDataEntry; }
|
|
23
|
-
// Forward declaration of `ArrayBuffer` to properly resolve imports.
|
|
24
|
-
namespace NitroModules { class ArrayBuffer; }
|
|
25
23
|
// Forward declaration of `ArrayBufferHolder` to properly resolve imports.
|
|
26
24
|
namespace NitroModules { class ArrayBufferHolder; }
|
|
27
25
|
|
|
@@ -68,9 +66,18 @@ namespace margelo::nitro::co::zyke::ble {
|
|
|
68
66
|
inline size_t getExternalMemorySize() noexcept override {
|
|
69
67
|
return _swiftPart.getMemorySize();
|
|
70
68
|
}
|
|
69
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
70
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridNativeBleNitroFactorySpecSwift>(other)) {
|
|
71
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
71
75
|
void dispose() noexcept override {
|
|
72
76
|
_swiftPart.dispose();
|
|
73
77
|
}
|
|
78
|
+
std::string toString() override {
|
|
79
|
+
return _swiftPart.toString();
|
|
80
|
+
}
|
|
74
81
|
|
|
75
82
|
public:
|
|
76
83
|
// Properties
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridNativeBleNitroSpecSwift.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridNativeBleNitroSpecSwift.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridNativeBleNitroSpecSwift.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -18,8 +18,6 @@ namespace margelo::nitro::co::zyke::ble { struct BLEDevice; }
|
|
|
18
18
|
namespace margelo::nitro::co::zyke::ble { struct ManufacturerData; }
|
|
19
19
|
// Forward declaration of `ManufacturerDataEntry` to properly resolve imports.
|
|
20
20
|
namespace margelo::nitro::co::zyke::ble { struct ManufacturerDataEntry; }
|
|
21
|
-
// Forward declaration of `ArrayBuffer` to properly resolve imports.
|
|
22
|
-
namespace NitroModules { class ArrayBuffer; }
|
|
23
21
|
// Forward declaration of `ArrayBufferHolder` to properly resolve imports.
|
|
24
22
|
namespace NitroModules { class ArrayBufferHolder; }
|
|
25
23
|
// Forward declaration of `ScanFilter` to properly resolve imports.
|
|
@@ -42,6 +40,8 @@ namespace margelo::nitro::co::zyke::ble { struct OperationResult; }
|
|
|
42
40
|
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
43
41
|
#include "ScanFilter.hpp"
|
|
44
42
|
#include "AndroidScanMode.hpp"
|
|
43
|
+
#include <NitroModules/Null.hpp>
|
|
44
|
+
#include <variant>
|
|
45
45
|
#include "BLEState.hpp"
|
|
46
46
|
#include "OperationResult.hpp"
|
|
47
47
|
#include <NitroModules/Promise.hpp>
|
|
@@ -77,9 +77,18 @@ namespace margelo::nitro::co::zyke::ble {
|
|
|
77
77
|
inline size_t getExternalMemorySize() noexcept override {
|
|
78
78
|
return _swiftPart.getMemorySize();
|
|
79
79
|
}
|
|
80
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
81
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridNativeBleNitroSpecSwift>(other)) {
|
|
82
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
83
|
+
}
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
80
86
|
void dispose() noexcept override {
|
|
81
87
|
_swiftPart.dispose();
|
|
82
88
|
}
|
|
89
|
+
std::string toString() override {
|
|
90
|
+
return _swiftPart.toString();
|
|
91
|
+
}
|
|
83
92
|
|
|
84
93
|
public:
|
|
85
94
|
// Properties
|
|
@@ -99,7 +108,7 @@ namespace margelo::nitro::co::zyke::ble {
|
|
|
99
108
|
std::rethrow_exception(__result.error());
|
|
100
109
|
}
|
|
101
110
|
}
|
|
102
|
-
inline void startScan(const ScanFilter& filter, const std::function<void(const std::optional<BLEDevice
|
|
111
|
+
inline void startScan(const ScanFilter& filter, const std::function<void(const std::optional<std::variant<nitro::NullType, BLEDevice>>& /* device */, const std::optional<std::variant<nitro::NullType, std::string>>& /* error */)>& callback) override {
|
|
103
112
|
auto __result = _swiftPart.startScan(std::forward<decltype(filter)>(filter), callback);
|
|
104
113
|
if (__result.hasError()) [[unlikely]] {
|
|
105
114
|
std::rethrow_exception(__result.error());
|