munim-bluetooth 0.3.26 → 0.4.0
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/CHANGELOG.md +16 -0
- package/README.md +476 -74
- package/android/gradle.properties +2 -2
- package/android/src/main/AndroidManifest.xml +3 -1
- package/android/src/main/cpp/cpp-adapter.cpp +4 -1
- package/android/src/main/java/com/munimbluetooth/BluetoothPermissionUtils.kt +40 -0
- package/android/src/main/java/com/munimbluetooth/HybridMunimBluetooth.kt +2116 -217
- package/android/src/main/java/com/munimbluetooth/MunimBluetoothBackgroundService.kt +591 -56
- package/app.plugin.js +155 -0
- package/ios/HybridMunimBluetooth.swift +2123 -298
- package/ios/MunimBluetoothEventEmitter.swift +68 -8
- package/lib/commonjs/index.js +272 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +243 -11
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +310 -7
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/munim-bluetooth.nitro.d.ts +219 -5
- package/lib/typescript/src/specs/munim-bluetooth.nitro.d.ts.map +1 -1
- package/nitro.json +9 -3
- package/nitrogen/generated/android/c++/JAdvertisingDataTypes.hpp +96 -96
- package/nitrogen/generated/android/c++/JAdvertisingOptions.hpp +8 -8
- package/nitrogen/generated/android/c++/JBackgroundSessionOptions.hpp +8 -8
- package/nitrogen/generated/android/c++/JBluetoothCapabilities.hpp +105 -0
- package/nitrogen/generated/android/c++/JBluetoothPhy.hpp +61 -0
- package/nitrogen/generated/android/c++/JBluetoothPhyOption.hpp +61 -0
- package/nitrogen/generated/android/c++/JBondState.hpp +64 -0
- package/nitrogen/generated/android/c++/JDescriptorValue.hpp +69 -0
- package/nitrogen/generated/android/c++/JExtendedAdvertisingOptions.hpp +131 -0
- package/nitrogen/generated/android/c++/JGATTCharacteristic.hpp +35 -11
- package/nitrogen/generated/android/c++/JGATTDescriptor.hpp +85 -0
- package/nitrogen/generated/android/c++/JGATTService.hpp +33 -9
- package/nitrogen/generated/android/c++/JHybridMunimBluetoothSpec.cpp +422 -12
- package/nitrogen/generated/android/c++/JHybridMunimBluetoothSpec.hpp +29 -0
- package/nitrogen/generated/android/c++/JL2CAPChannel.hpp +66 -0
- package/nitrogen/generated/android/c++/JMultipeerDiscoveryInfoEntry.hpp +61 -0
- package/nitrogen/generated/android/c++/JMultipeerEncryptionPreference.hpp +61 -0
- package/nitrogen/generated/android/c++/JMultipeerPeer.hpp +93 -0
- package/nitrogen/generated/android/c++/JMultipeerPeerState.hpp +61 -0
- package/nitrogen/generated/android/c++/JMultipeerSessionOptions.hpp +105 -0
- package/nitrogen/generated/android/c++/JPhyStatus.hpp +62 -0
- package/nitrogen/generated/android/c++/JScanOptions.hpp +8 -8
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/AdvertisingDataTypes.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/AdvertisingOptions.kt +19 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BackgroundSessionOptions.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothCapabilities.kt +111 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothPhy.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothPhyOption.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BondState.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/CharacteristicValue.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/DescriptorValue.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ExtendedAdvertisingOptions.kt +111 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTCharacteristic.kt +25 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTDescriptor.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTService.kt +23 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/HybridMunimBluetoothSpec.kt +138 -22
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/L2CAPChannel.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerDiscoveryInfoEntry.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerEncryptionPreference.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerPeer.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerPeerState.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerSessionOptions.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/PhyStatus.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ScanOptions.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ServiceDataEntry.kt +15 -0
- package/nitrogen/generated/ios/MunimBluetooth+autolinking.rb +2 -0
- package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Bridge.cpp +61 -5
- package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Bridge.hpp +494 -49
- package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Umbrella.hpp +42 -0
- package/nitrogen/generated/ios/c++/HybridMunimBluetoothSpecSwift.hpp +254 -0
- package/nitrogen/generated/ios/swift/BluetoothCapabilities.swift +89 -0
- package/nitrogen/generated/ios/swift/BluetoothPhy.swift +44 -0
- package/nitrogen/generated/ios/swift/BluetoothPhyOption.swift +44 -0
- package/nitrogen/generated/ios/swift/BondState.swift +48 -0
- package/nitrogen/generated/ios/swift/DescriptorValue.swift +44 -0
- package/nitrogen/generated/ios/swift/ExtendedAdvertisingOptions.swift +243 -0
- package/nitrogen/generated/ios/swift/Func_void_BluetoothCapabilities.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_BondState.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_DescriptorValue.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_L2CAPChannel.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PhyStatus.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_MultipeerPeer_.swift +46 -0
- package/nitrogen/generated/ios/swift/GATTCharacteristic.swift +25 -1
- package/nitrogen/generated/ios/swift/GATTDescriptor.swift +71 -0
- package/nitrogen/generated/ios/swift/GATTService.swift +25 -1
- package/nitrogen/generated/ios/swift/HybridMunimBluetoothSpec.swift +29 -0
- package/nitrogen/generated/ios/swift/HybridMunimBluetoothSpec_cxx.swift +556 -23
- package/nitrogen/generated/ios/swift/L2CAPChannel.swift +52 -0
- package/nitrogen/generated/ios/swift/MultipeerDiscoveryInfoEntry.swift +34 -0
- package/nitrogen/generated/ios/swift/MultipeerEncryptionPreference.swift +44 -0
- package/nitrogen/generated/ios/swift/MultipeerPeer.swift +63 -0
- package/nitrogen/generated/ios/swift/MultipeerPeerState.swift +44 -0
- package/nitrogen/generated/ios/swift/MultipeerSessionOptions.swift +136 -0
- package/nitrogen/generated/ios/swift/PhyStatus.swift +34 -0
- package/nitrogen/generated/shared/c++/BluetoothCapabilities.hpp +131 -0
- package/nitrogen/generated/shared/c++/BluetoothPhy.hpp +80 -0
- package/nitrogen/generated/shared/c++/BluetoothPhyOption.hpp +80 -0
- package/nitrogen/generated/shared/c++/BondState.hpp +84 -0
- package/nitrogen/generated/shared/c++/DescriptorValue.hpp +95 -0
- package/nitrogen/generated/shared/c++/ExtendedAdvertisingOptions.hpp +138 -0
- package/nitrogen/generated/shared/c++/GATTCharacteristic.hpp +9 -3
- package/nitrogen/generated/shared/c++/GATTDescriptor.hpp +93 -0
- package/nitrogen/generated/shared/c++/GATTService.hpp +7 -2
- package/nitrogen/generated/shared/c++/HybridMunimBluetoothSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridMunimBluetoothSpec.hpp +61 -2
- package/nitrogen/generated/shared/c++/L2CAPChannel.hpp +92 -0
- package/nitrogen/generated/shared/c++/MultipeerDiscoveryInfoEntry.hpp +87 -0
- package/nitrogen/generated/shared/c++/MultipeerEncryptionPreference.hpp +80 -0
- package/nitrogen/generated/shared/c++/MultipeerPeer.hpp +102 -0
- package/nitrogen/generated/shared/c++/MultipeerPeerState.hpp +80 -0
- package/nitrogen/generated/shared/c++/MultipeerSessionOptions.hpp +114 -0
- package/nitrogen/generated/shared/c++/PhyStatus.hpp +88 -0
- package/package.json +22 -11
- package/src/index.ts +416 -31
- package/src/specs/munim-bluetooth.nitro.ts +298 -14
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JL2CAPChannel.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "L2CAPChannel.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::munimbluetooth {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "L2CAPChannel" and the the Kotlin data class "L2CAPChannel".
|
|
22
|
+
*/
|
|
23
|
+
struct JL2CAPChannel final: public jni::JavaClass<JL2CAPChannel> {
|
|
24
|
+
public:
|
|
25
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/munimbluetooth/L2CAPChannel;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct L2CAPChannel by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
L2CAPChannel toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldId = clazz->getField<jni::JString>("id");
|
|
36
|
+
jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
|
|
37
|
+
static const auto fieldPsm = clazz->getField<double>("psm");
|
|
38
|
+
double psm = this->getFieldValue(fieldPsm);
|
|
39
|
+
static const auto fieldDeviceId = clazz->getField<jni::JString>("deviceId");
|
|
40
|
+
jni::local_ref<jni::JString> deviceId = this->getFieldValue(fieldDeviceId);
|
|
41
|
+
return L2CAPChannel(
|
|
42
|
+
id->toStdString(),
|
|
43
|
+
psm,
|
|
44
|
+
deviceId != nullptr ? std::make_optional(deviceId->toStdString()) : std::nullopt
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
/**
|
|
50
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
51
|
+
*/
|
|
52
|
+
[[maybe_unused]]
|
|
53
|
+
static jni::local_ref<JL2CAPChannel::javaobject> fromCpp(const L2CAPChannel& value) {
|
|
54
|
+
using JSignature = JL2CAPChannel(jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JString>);
|
|
55
|
+
static const auto clazz = javaClassStatic();
|
|
56
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
57
|
+
return create(
|
|
58
|
+
clazz,
|
|
59
|
+
jni::make_jstring(value.id),
|
|
60
|
+
value.psm,
|
|
61
|
+
value.deviceId.has_value() ? jni::make_jstring(value.deviceId.value()) : nullptr
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
} // namespace margelo::nitro::munimbluetooth
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMultipeerDiscoveryInfoEntry.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MultipeerDiscoveryInfoEntry.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::munimbluetooth {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "MultipeerDiscoveryInfoEntry" and the the Kotlin data class "MultipeerDiscoveryInfoEntry".
|
|
21
|
+
*/
|
|
22
|
+
struct JMultipeerDiscoveryInfoEntry final: public jni::JavaClass<JMultipeerDiscoveryInfoEntry> {
|
|
23
|
+
public:
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/munimbluetooth/MultipeerDiscoveryInfoEntry;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MultipeerDiscoveryInfoEntry by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
MultipeerDiscoveryInfoEntry toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldKey = clazz->getField<jni::JString>("key");
|
|
35
|
+
jni::local_ref<jni::JString> key = this->getFieldValue(fieldKey);
|
|
36
|
+
static const auto fieldValue = clazz->getField<jni::JString>("value");
|
|
37
|
+
jni::local_ref<jni::JString> value = this->getFieldValue(fieldValue);
|
|
38
|
+
return MultipeerDiscoveryInfoEntry(
|
|
39
|
+
key->toStdString(),
|
|
40
|
+
value->toStdString()
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
/**
|
|
46
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
47
|
+
*/
|
|
48
|
+
[[maybe_unused]]
|
|
49
|
+
static jni::local_ref<JMultipeerDiscoveryInfoEntry::javaobject> fromCpp(const MultipeerDiscoveryInfoEntry& value) {
|
|
50
|
+
using JSignature = JMultipeerDiscoveryInfoEntry(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
51
|
+
static const auto clazz = javaClassStatic();
|
|
52
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
53
|
+
return create(
|
|
54
|
+
clazz,
|
|
55
|
+
jni::make_jstring(value.key),
|
|
56
|
+
jni::make_jstring(value.value)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::munimbluetooth
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMultipeerEncryptionPreference.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MultipeerEncryptionPreference.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::munimbluetooth {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "MultipeerEncryptionPreference" and the the Kotlin enum "MultipeerEncryptionPreference".
|
|
19
|
+
*/
|
|
20
|
+
struct JMultipeerEncryptionPreference final: public jni::JavaClass<JMultipeerEncryptionPreference> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/munimbluetooth/MultipeerEncryptionPreference;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum MultipeerEncryptionPreference.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
MultipeerEncryptionPreference toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<MultipeerEncryptionPreference>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JMultipeerEncryptionPreference> fromCpp(MultipeerEncryptionPreference value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case MultipeerEncryptionPreference::NONE:
|
|
46
|
+
static const auto fieldNONE = clazz->getStaticField<JMultipeerEncryptionPreference>("NONE");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldNONE);
|
|
48
|
+
case MultipeerEncryptionPreference::OPTIONAL:
|
|
49
|
+
static const auto fieldOPTIONAL = clazz->getStaticField<JMultipeerEncryptionPreference>("OPTIONAL");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldOPTIONAL);
|
|
51
|
+
case MultipeerEncryptionPreference::REQUIRED:
|
|
52
|
+
static const auto fieldREQUIRED = clazz->getStaticField<JMultipeerEncryptionPreference>("REQUIRED");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldREQUIRED);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::munimbluetooth
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMultipeerPeer.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MultipeerPeer.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JMultipeerDiscoveryInfoEntry.hpp"
|
|
14
|
+
#include "JMultipeerPeerState.hpp"
|
|
15
|
+
#include "MultipeerDiscoveryInfoEntry.hpp"
|
|
16
|
+
#include "MultipeerPeerState.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <vector>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::munimbluetooth {
|
|
22
|
+
|
|
23
|
+
using namespace facebook;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The C++ JNI bridge between the C++ struct "MultipeerPeer" and the the Kotlin data class "MultipeerPeer".
|
|
27
|
+
*/
|
|
28
|
+
struct JMultipeerPeer final: public jni::JavaClass<JMultipeerPeer> {
|
|
29
|
+
public:
|
|
30
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/munimbluetooth/MultipeerPeer;";
|
|
31
|
+
|
|
32
|
+
public:
|
|
33
|
+
/**
|
|
34
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MultipeerPeer by copying all values to C++.
|
|
35
|
+
*/
|
|
36
|
+
[[maybe_unused]]
|
|
37
|
+
[[nodiscard]]
|
|
38
|
+
MultipeerPeer toCpp() const {
|
|
39
|
+
static const auto clazz = javaClassStatic();
|
|
40
|
+
static const auto fieldId = clazz->getField<jni::JString>("id");
|
|
41
|
+
jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
|
|
42
|
+
static const auto fieldDisplayName = clazz->getField<jni::JString>("displayName");
|
|
43
|
+
jni::local_ref<jni::JString> displayName = this->getFieldValue(fieldDisplayName);
|
|
44
|
+
static const auto fieldState = clazz->getField<JMultipeerPeerState>("state");
|
|
45
|
+
jni::local_ref<JMultipeerPeerState> state = this->getFieldValue(fieldState);
|
|
46
|
+
static const auto fieldDiscoveryInfo = clazz->getField<jni::JArrayClass<JMultipeerDiscoveryInfoEntry>>("discoveryInfo");
|
|
47
|
+
jni::local_ref<jni::JArrayClass<JMultipeerDiscoveryInfoEntry>> discoveryInfo = this->getFieldValue(fieldDiscoveryInfo);
|
|
48
|
+
return MultipeerPeer(
|
|
49
|
+
id->toStdString(),
|
|
50
|
+
displayName->toStdString(),
|
|
51
|
+
state->toCpp(),
|
|
52
|
+
discoveryInfo != nullptr ? std::make_optional([&](auto&& __input) {
|
|
53
|
+
size_t __size = __input->size();
|
|
54
|
+
std::vector<MultipeerDiscoveryInfoEntry> __vector;
|
|
55
|
+
__vector.reserve(__size);
|
|
56
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
57
|
+
auto __element = __input->getElement(__i);
|
|
58
|
+
__vector.push_back(__element->toCpp());
|
|
59
|
+
}
|
|
60
|
+
return __vector;
|
|
61
|
+
}(discoveryInfo)) : std::nullopt
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
/**
|
|
67
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
68
|
+
*/
|
|
69
|
+
[[maybe_unused]]
|
|
70
|
+
static jni::local_ref<JMultipeerPeer::javaobject> fromCpp(const MultipeerPeer& value) {
|
|
71
|
+
using JSignature = JMultipeerPeer(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<JMultipeerPeerState>, jni::alias_ref<jni::JArrayClass<JMultipeerDiscoveryInfoEntry>>);
|
|
72
|
+
static const auto clazz = javaClassStatic();
|
|
73
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
74
|
+
return create(
|
|
75
|
+
clazz,
|
|
76
|
+
jni::make_jstring(value.id),
|
|
77
|
+
jni::make_jstring(value.displayName),
|
|
78
|
+
JMultipeerPeerState::fromCpp(value.state),
|
|
79
|
+
value.discoveryInfo.has_value() ? [&](auto&& __input) {
|
|
80
|
+
size_t __size = __input.size();
|
|
81
|
+
jni::local_ref<jni::JArrayClass<JMultipeerDiscoveryInfoEntry>> __array = jni::JArrayClass<JMultipeerDiscoveryInfoEntry>::newArray(__size);
|
|
82
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
83
|
+
const auto& __element = __input[__i];
|
|
84
|
+
auto __elementJni = JMultipeerDiscoveryInfoEntry::fromCpp(__element);
|
|
85
|
+
__array->setElement(__i, *__elementJni);
|
|
86
|
+
}
|
|
87
|
+
return __array;
|
|
88
|
+
}(value.discoveryInfo.value()) : nullptr
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
} // namespace margelo::nitro::munimbluetooth
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMultipeerPeerState.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MultipeerPeerState.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::munimbluetooth {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "MultipeerPeerState" and the the Kotlin enum "MultipeerPeerState".
|
|
19
|
+
*/
|
|
20
|
+
struct JMultipeerPeerState final: public jni::JavaClass<JMultipeerPeerState> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/munimbluetooth/MultipeerPeerState;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum MultipeerPeerState.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
MultipeerPeerState toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<MultipeerPeerState>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JMultipeerPeerState> fromCpp(MultipeerPeerState value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case MultipeerPeerState::NOTCONNECTED:
|
|
46
|
+
static const auto fieldNOTCONNECTED = clazz->getStaticField<JMultipeerPeerState>("NOTCONNECTED");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldNOTCONNECTED);
|
|
48
|
+
case MultipeerPeerState::CONNECTING:
|
|
49
|
+
static const auto fieldCONNECTING = clazz->getStaticField<JMultipeerPeerState>("CONNECTING");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldCONNECTING);
|
|
51
|
+
case MultipeerPeerState::CONNECTED:
|
|
52
|
+
static const auto fieldCONNECTED = clazz->getStaticField<JMultipeerPeerState>("CONNECTED");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldCONNECTED);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::munimbluetooth
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMultipeerSessionOptions.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MultipeerSessionOptions.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JMultipeerDiscoveryInfoEntry.hpp"
|
|
14
|
+
#include "JMultipeerEncryptionPreference.hpp"
|
|
15
|
+
#include "MultipeerDiscoveryInfoEntry.hpp"
|
|
16
|
+
#include "MultipeerEncryptionPreference.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <vector>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::munimbluetooth {
|
|
22
|
+
|
|
23
|
+
using namespace facebook;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The C++ JNI bridge between the C++ struct "MultipeerSessionOptions" and the the Kotlin data class "MultipeerSessionOptions".
|
|
27
|
+
*/
|
|
28
|
+
struct JMultipeerSessionOptions final: public jni::JavaClass<JMultipeerSessionOptions> {
|
|
29
|
+
public:
|
|
30
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/munimbluetooth/MultipeerSessionOptions;";
|
|
31
|
+
|
|
32
|
+
public:
|
|
33
|
+
/**
|
|
34
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MultipeerSessionOptions by copying all values to C++.
|
|
35
|
+
*/
|
|
36
|
+
[[maybe_unused]]
|
|
37
|
+
[[nodiscard]]
|
|
38
|
+
MultipeerSessionOptions toCpp() const {
|
|
39
|
+
static const auto clazz = javaClassStatic();
|
|
40
|
+
static const auto fieldServiceType = clazz->getField<jni::JString>("serviceType");
|
|
41
|
+
jni::local_ref<jni::JString> serviceType = this->getFieldValue(fieldServiceType);
|
|
42
|
+
static const auto fieldDisplayName = clazz->getField<jni::JString>("displayName");
|
|
43
|
+
jni::local_ref<jni::JString> displayName = this->getFieldValue(fieldDisplayName);
|
|
44
|
+
static const auto fieldDiscoveryInfo = clazz->getField<jni::JArrayClass<JMultipeerDiscoveryInfoEntry>>("discoveryInfo");
|
|
45
|
+
jni::local_ref<jni::JArrayClass<JMultipeerDiscoveryInfoEntry>> discoveryInfo = this->getFieldValue(fieldDiscoveryInfo);
|
|
46
|
+
static const auto fieldAutoInvite = clazz->getField<jni::JBoolean>("autoInvite");
|
|
47
|
+
jni::local_ref<jni::JBoolean> autoInvite = this->getFieldValue(fieldAutoInvite);
|
|
48
|
+
static const auto fieldAutoAcceptInvitations = clazz->getField<jni::JBoolean>("autoAcceptInvitations");
|
|
49
|
+
jni::local_ref<jni::JBoolean> autoAcceptInvitations = this->getFieldValue(fieldAutoAcceptInvitations);
|
|
50
|
+
static const auto fieldInviteTimeout = clazz->getField<jni::JDouble>("inviteTimeout");
|
|
51
|
+
jni::local_ref<jni::JDouble> inviteTimeout = this->getFieldValue(fieldInviteTimeout);
|
|
52
|
+
static const auto fieldEncryptionPreference = clazz->getField<JMultipeerEncryptionPreference>("encryptionPreference");
|
|
53
|
+
jni::local_ref<JMultipeerEncryptionPreference> encryptionPreference = this->getFieldValue(fieldEncryptionPreference);
|
|
54
|
+
return MultipeerSessionOptions(
|
|
55
|
+
serviceType->toStdString(),
|
|
56
|
+
displayName != nullptr ? std::make_optional(displayName->toStdString()) : std::nullopt,
|
|
57
|
+
discoveryInfo != nullptr ? std::make_optional([&](auto&& __input) {
|
|
58
|
+
size_t __size = __input->size();
|
|
59
|
+
std::vector<MultipeerDiscoveryInfoEntry> __vector;
|
|
60
|
+
__vector.reserve(__size);
|
|
61
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
62
|
+
auto __element = __input->getElement(__i);
|
|
63
|
+
__vector.push_back(__element->toCpp());
|
|
64
|
+
}
|
|
65
|
+
return __vector;
|
|
66
|
+
}(discoveryInfo)) : std::nullopt,
|
|
67
|
+
autoInvite != nullptr ? std::make_optional(static_cast<bool>(autoInvite->value())) : std::nullopt,
|
|
68
|
+
autoAcceptInvitations != nullptr ? std::make_optional(static_cast<bool>(autoAcceptInvitations->value())) : std::nullopt,
|
|
69
|
+
inviteTimeout != nullptr ? std::make_optional(inviteTimeout->value()) : std::nullopt,
|
|
70
|
+
encryptionPreference != nullptr ? std::make_optional(encryptionPreference->toCpp()) : std::nullopt
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public:
|
|
75
|
+
/**
|
|
76
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
77
|
+
*/
|
|
78
|
+
[[maybe_unused]]
|
|
79
|
+
static jni::local_ref<JMultipeerSessionOptions::javaobject> fromCpp(const MultipeerSessionOptions& value) {
|
|
80
|
+
using JSignature = JMultipeerSessionOptions(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<JMultipeerDiscoveryInfoEntry>>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JMultipeerEncryptionPreference>);
|
|
81
|
+
static const auto clazz = javaClassStatic();
|
|
82
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
83
|
+
return create(
|
|
84
|
+
clazz,
|
|
85
|
+
jni::make_jstring(value.serviceType),
|
|
86
|
+
value.displayName.has_value() ? jni::make_jstring(value.displayName.value()) : nullptr,
|
|
87
|
+
value.discoveryInfo.has_value() ? [&](auto&& __input) {
|
|
88
|
+
size_t __size = __input.size();
|
|
89
|
+
jni::local_ref<jni::JArrayClass<JMultipeerDiscoveryInfoEntry>> __array = jni::JArrayClass<JMultipeerDiscoveryInfoEntry>::newArray(__size);
|
|
90
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
91
|
+
const auto& __element = __input[__i];
|
|
92
|
+
auto __elementJni = JMultipeerDiscoveryInfoEntry::fromCpp(__element);
|
|
93
|
+
__array->setElement(__i, *__elementJni);
|
|
94
|
+
}
|
|
95
|
+
return __array;
|
|
96
|
+
}(value.discoveryInfo.value()) : nullptr,
|
|
97
|
+
value.autoInvite.has_value() ? jni::JBoolean::valueOf(value.autoInvite.value()) : nullptr,
|
|
98
|
+
value.autoAcceptInvitations.has_value() ? jni::JBoolean::valueOf(value.autoAcceptInvitations.value()) : nullptr,
|
|
99
|
+
value.inviteTimeout.has_value() ? jni::JDouble::valueOf(value.inviteTimeout.value()) : nullptr,
|
|
100
|
+
value.encryptionPreference.has_value() ? JMultipeerEncryptionPreference::fromCpp(value.encryptionPreference.value()) : nullptr
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
} // namespace margelo::nitro::munimbluetooth
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JPhyStatus.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "PhyStatus.hpp"
|
|
12
|
+
|
|
13
|
+
#include "BluetoothPhy.hpp"
|
|
14
|
+
#include "JBluetoothPhy.hpp"
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::munimbluetooth {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "PhyStatus" and the the Kotlin data class "PhyStatus".
|
|
22
|
+
*/
|
|
23
|
+
struct JPhyStatus final: public jni::JavaClass<JPhyStatus> {
|
|
24
|
+
public:
|
|
25
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/munimbluetooth/PhyStatus;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct PhyStatus by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
PhyStatus toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldTxPhy = clazz->getField<JBluetoothPhy>("txPhy");
|
|
36
|
+
jni::local_ref<JBluetoothPhy> txPhy = this->getFieldValue(fieldTxPhy);
|
|
37
|
+
static const auto fieldRxPhy = clazz->getField<JBluetoothPhy>("rxPhy");
|
|
38
|
+
jni::local_ref<JBluetoothPhy> rxPhy = this->getFieldValue(fieldRxPhy);
|
|
39
|
+
return PhyStatus(
|
|
40
|
+
txPhy->toCpp(),
|
|
41
|
+
rxPhy->toCpp()
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
/**
|
|
47
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
48
|
+
*/
|
|
49
|
+
[[maybe_unused]]
|
|
50
|
+
static jni::local_ref<JPhyStatus::javaobject> fromCpp(const PhyStatus& value) {
|
|
51
|
+
using JSignature = JPhyStatus(jni::alias_ref<JBluetoothPhy>, jni::alias_ref<JBluetoothPhy>);
|
|
52
|
+
static const auto clazz = javaClassStatic();
|
|
53
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
54
|
+
return create(
|
|
55
|
+
clazz,
|
|
56
|
+
JBluetoothPhy::fromCpp(value.txPhy),
|
|
57
|
+
JBluetoothPhy::fromCpp(value.rxPhy)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro::munimbluetooth
|
|
@@ -42,16 +42,16 @@ namespace margelo::nitro::munimbluetooth {
|
|
|
42
42
|
static const auto fieldScanMode = clazz->getField<JScanMode>("scanMode");
|
|
43
43
|
jni::local_ref<JScanMode> scanMode = this->getFieldValue(fieldScanMode);
|
|
44
44
|
return ScanOptions(
|
|
45
|
-
serviceUUIDs != nullptr ? std::make_optional([&]() {
|
|
46
|
-
size_t __size =
|
|
45
|
+
serviceUUIDs != nullptr ? std::make_optional([&](auto&& __input) {
|
|
46
|
+
size_t __size = __input->size();
|
|
47
47
|
std::vector<std::string> __vector;
|
|
48
48
|
__vector.reserve(__size);
|
|
49
49
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
50
|
-
auto __element =
|
|
50
|
+
auto __element = __input->getElement(__i);
|
|
51
51
|
__vector.push_back(__element->toStdString());
|
|
52
52
|
}
|
|
53
53
|
return __vector;
|
|
54
|
-
}()) : std::nullopt,
|
|
54
|
+
}(serviceUUIDs)) : std::nullopt,
|
|
55
55
|
allowDuplicates != nullptr ? std::make_optional(static_cast<bool>(allowDuplicates->value())) : std::nullopt,
|
|
56
56
|
scanMode != nullptr ? std::make_optional(scanMode->toCpp()) : std::nullopt
|
|
57
57
|
);
|
|
@@ -68,16 +68,16 @@ namespace margelo::nitro::munimbluetooth {
|
|
|
68
68
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
69
69
|
return create(
|
|
70
70
|
clazz,
|
|
71
|
-
value.serviceUUIDs.has_value() ? [&]() {
|
|
72
|
-
size_t __size =
|
|
71
|
+
value.serviceUUIDs.has_value() ? [&](auto&& __input) {
|
|
72
|
+
size_t __size = __input.size();
|
|
73
73
|
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
74
74
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
75
|
-
const auto& __element =
|
|
75
|
+
const auto& __element = __input[__i];
|
|
76
76
|
auto __elementJni = jni::make_jstring(__element);
|
|
77
77
|
__array->setElement(__i, *__elementJni);
|
|
78
78
|
}
|
|
79
79
|
return __array;
|
|
80
|
-
}() : nullptr,
|
|
80
|
+
}(value.serviceUUIDs.value()) : nullptr,
|
|
81
81
|
value.allowDuplicates.has_value() ? jni::JBoolean::valueOf(value.allowDuplicates.value()) : nullptr,
|
|
82
82
|
value.scanMode.has_value() ? JScanMode::fromCpp(value.scanMode.value()) : nullptr
|
|
83
83
|
);
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/AdvertisingDataTypes.kt
CHANGED
|
@@ -9,6 +9,7 @@ package com.margelo.nitro.munimbluetooth
|
|
|
9
9
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -74,6 +75,52 @@ data class AdvertisingDataTypes(
|
|
|
74
75
|
) {
|
|
75
76
|
/* primary constructor */
|
|
76
77
|
|
|
78
|
+
override fun equals(other: Any?): Boolean {
|
|
79
|
+
if (this === other) return true
|
|
80
|
+
if (other !is AdvertisingDataTypes) return false
|
|
81
|
+
return Objects.deepEquals(this.flags, other.flags)
|
|
82
|
+
&& Objects.deepEquals(this.incompleteServiceUUIDs16, other.incompleteServiceUUIDs16)
|
|
83
|
+
&& Objects.deepEquals(this.completeServiceUUIDs16, other.completeServiceUUIDs16)
|
|
84
|
+
&& Objects.deepEquals(this.incompleteServiceUUIDs32, other.incompleteServiceUUIDs32)
|
|
85
|
+
&& Objects.deepEquals(this.completeServiceUUIDs32, other.completeServiceUUIDs32)
|
|
86
|
+
&& Objects.deepEquals(this.incompleteServiceUUIDs128, other.incompleteServiceUUIDs128)
|
|
87
|
+
&& Objects.deepEquals(this.completeServiceUUIDs128, other.completeServiceUUIDs128)
|
|
88
|
+
&& Objects.deepEquals(this.shortenedLocalName, other.shortenedLocalName)
|
|
89
|
+
&& Objects.deepEquals(this.completeLocalName, other.completeLocalName)
|
|
90
|
+
&& Objects.deepEquals(this.txPowerLevel, other.txPowerLevel)
|
|
91
|
+
&& Objects.deepEquals(this.serviceSolicitationUUIDs16, other.serviceSolicitationUUIDs16)
|
|
92
|
+
&& Objects.deepEquals(this.serviceSolicitationUUIDs128, other.serviceSolicitationUUIDs128)
|
|
93
|
+
&& Objects.deepEquals(this.serviceData16, other.serviceData16)
|
|
94
|
+
&& Objects.deepEquals(this.serviceData32, other.serviceData32)
|
|
95
|
+
&& Objects.deepEquals(this.serviceData128, other.serviceData128)
|
|
96
|
+
&& Objects.deepEquals(this.appearance, other.appearance)
|
|
97
|
+
&& Objects.deepEquals(this.serviceSolicitationUUIDs32, other.serviceSolicitationUUIDs32)
|
|
98
|
+
&& Objects.deepEquals(this.manufacturerData, other.manufacturerData)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
override fun hashCode(): Int {
|
|
102
|
+
return arrayOf(
|
|
103
|
+
flags,
|
|
104
|
+
incompleteServiceUUIDs16,
|
|
105
|
+
completeServiceUUIDs16,
|
|
106
|
+
incompleteServiceUUIDs32,
|
|
107
|
+
completeServiceUUIDs32,
|
|
108
|
+
incompleteServiceUUIDs128,
|
|
109
|
+
completeServiceUUIDs128,
|
|
110
|
+
shortenedLocalName,
|
|
111
|
+
completeLocalName,
|
|
112
|
+
txPowerLevel,
|
|
113
|
+
serviceSolicitationUUIDs16,
|
|
114
|
+
serviceSolicitationUUIDs128,
|
|
115
|
+
serviceData16,
|
|
116
|
+
serviceData32,
|
|
117
|
+
serviceData128,
|
|
118
|
+
appearance,
|
|
119
|
+
serviceSolicitationUUIDs32,
|
|
120
|
+
manufacturerData
|
|
121
|
+
).contentDeepHashCode()
|
|
122
|
+
}
|
|
123
|
+
|
|
77
124
|
companion object {
|
|
78
125
|
/**
|
|
79
126
|
* Constructor called from C++
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/AdvertisingOptions.kt
CHANGED
|
@@ -9,6 +9,7 @@ package com.margelo.nitro.munimbluetooth
|
|
|
9
9
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -32,6 +33,24 @@ data class AdvertisingOptions(
|
|
|
32
33
|
) {
|
|
33
34
|
/* primary constructor */
|
|
34
35
|
|
|
36
|
+
override fun equals(other: Any?): Boolean {
|
|
37
|
+
if (this === other) return true
|
|
38
|
+
if (other !is AdvertisingOptions) return false
|
|
39
|
+
return Objects.deepEquals(this.serviceUUIDs, other.serviceUUIDs)
|
|
40
|
+
&& Objects.deepEquals(this.localName, other.localName)
|
|
41
|
+
&& Objects.deepEquals(this.manufacturerData, other.manufacturerData)
|
|
42
|
+
&& Objects.deepEquals(this.advertisingData, other.advertisingData)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
override fun hashCode(): Int {
|
|
46
|
+
return arrayOf(
|
|
47
|
+
serviceUUIDs,
|
|
48
|
+
localName,
|
|
49
|
+
manufacturerData,
|
|
50
|
+
advertisingData
|
|
51
|
+
).contentDeepHashCode()
|
|
52
|
+
}
|
|
53
|
+
|
|
35
54
|
companion object {
|
|
36
55
|
/**
|
|
37
56
|
* Constructor called from C++
|