demo更新

This commit is contained in:
denggaofeng 2026-03-18 18:06:33 +08:00
parent ac5b0956dd
commit 740f41a1d5
12 changed files with 111 additions and 862 deletions

View File

@ -5,7 +5,8 @@
xmlns:viewModels="clr-namespace:NFCLockDemoV2.ViewModels"
xmlns:converter="clr-namespace:NFCLockDemoV2.Converters"
Shell.TabBarIsVisible="False"
Shell.NavBarIsVisible="False">
Shell.NavBarIsVisible="False"
x:DataType="viewModels:MainViewModel">
<!--<ContentPage.BindingContext>
<viewModels:MainViewModel></viewModels:MainViewModel>
</ContentPage.BindingContext>-->
@ -18,7 +19,7 @@
<VerticalStackLayout
Padding="16"
Spacing="16">
<!-- 圆形进度指示器和状态 -->
<Grid RowDefinitions="Auto,Auto"
HorizontalOptions="Center"
@ -84,6 +85,23 @@
BackgroundColor="{Binding Operation, Converter={StaticResource OperationColorConverter}, ConverterParameter=SET_PASSWORD}"
TextColor="Black"
HorizontalOptions="Fill" />-->
<CollectionView ItemsSource="{Binding Devices}"
HorizontalOptions="Fill"
HeightRequest="100">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="x:String">
<Grid>
<Label Text="{Binding .}" TextDecorations="Underline" TextColor="Aqua">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:MainViewModel}}, Path=CopyCommand}" CommandParameter="{Binding .}"></TapGestureRecognizer>
</Label.GestureRecognizers>
</Label>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ContentPage>

View File

@ -1,5 +1,8 @@
using Microsoft.Extensions.Logging;
using NFCLockDemoV2.ViewModels;
#if ANDROID
using NFCLockDemoV2.Platforms.Android;
#endif
namespace NFCLockDemoV2
{
@ -20,6 +23,9 @@ namespace NFCLockDemoV2
builder.Logging.AddDebug();
#endif
builder.Services.AddSingleton<MainViewModel>();
#if ANDROID
builder.Services.AddSingleton<NFCCallbacks>();
#endif
return builder.Build();
}
}

View File

@ -80,6 +80,7 @@
<PropertyGroup Condition="'$(TargetFramework)'=='net10.0-ios'">
<ProvisioningType>manual</ProvisioningType>
<CodesignKey>iPhone Distribution</CodesignKey>
<CodesignProvision>nfclockdemoProfile</CodesignProvision>
</PropertyGroup>
<ItemGroup>

View File

@ -19,44 +19,24 @@ namespace NFCLockAppV2;
public class MainActivity : MauiAppCompatActivity
{
private NFCHelper? nfcHelper;
private MainViewModel mainViewModel;
private NFCCallbacks? NFCCallbacks;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
InitializeNFC();
}
private void InitializeNFC()
{
if (!TryInitializeNFC())
{
Microsoft.Maui.Controls.Application.Current.Dispatcher.Dispatch(() =>
{
TryInitializeNFC();
});
}
}
private bool TryInitializeNFC()
{
if (nfcHelper != null && mainViewModel != null)
return true;
MainViewModel viewModel = null;
if (Microsoft.Maui.Controls.Application.Current?.Handler?.MauiContext?.Services != null)
{
viewModel = Microsoft.Maui.Controls.Application.Current.Handler.MauiContext.Services.GetService<MainViewModel>();
}
if (viewModel != null)
{
NFCCallbacks nFCCallbacks = new NFCCallbacks(viewModel);
nfcHelper = new NFCHelper(this, nFCCallbacks);
return true;
NFCCallbacks = Microsoft.Maui.Controls.Application.Current.Handler.MauiContext.Services.GetService<NFCCallbacks>();
}
return false;
if (NFCCallbacks != null)
{
nfcHelper = new NFCHelper(this, NFCCallbacks);
}
}
protected override void OnResume()
@ -64,18 +44,18 @@ public class MainActivity : MauiAppCompatActivity
base.OnResume();
// 确保NFC功能在每次恢复时都已初始化
InitializeNFC();
nfcHelper.OnResume();
nfcHelper?.OnResume();
}
protected override void OnPause()
{
base.OnPause();
nfcHelper.OnPause();
nfcHelper?.OnPause();
}
protected override void OnNewIntent(Intent intent)
{
base.OnNewIntent(intent);
nfcHelper.OnNewIntent(intent);
nfcHelper?.OnNewIntent(intent);
}
}

View File

@ -3,14 +3,13 @@ using Com.Lvcheng.Lock.Shared.Nfc.Example.Java;
using NFCLockDemoV2.ViewModels;
using Android.Util;
using Exception = System.Exception;
using Microsoft.Maui.ApplicationModel;
namespace NFCLockDemoV2.Platforms.Android
{
public class NFCCallbacks : Java.Lang.Object, INFCCallbacks
{
private readonly MainViewModel mainViewModel;
private ViewModels.OperationType? operation => mainViewModel.Operation;
private ViewModels.OperationType? Operation => mainViewModel.Operation;
public NFCCallbacks(MainViewModel mainViewModel)
{
this.mainViewModel = mainViewModel;
@ -18,32 +17,25 @@ namespace NFCLockDemoV2.Platforms.Android
public void OnFinished()
{
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.DeviceId = "--";
mainViewModel.DeviceRssi = "--";
mainViewModel.DeviceStatus = "NFC操作完成";
mainViewModel.Operation = null;
mainViewModel.ArcProgress = 0;
});
mainViewModel.DeviceId = "--";
mainViewModel.DeviceRssi = "--";
mainViewModel.DeviceStatus = "NFC操作完成";
//mainViewModel.Operation = null;
mainViewModel.ArcProgress = 0;
}
public Java.Lang.Boolean? OnLoop(DeviceManagerWrapper? wrapper, Long? id, Java.Lang.Boolean? isNew, Integer? rssi)
{
try
{
// 在主线程上更新UI
MainThread.BeginInvokeOnMainThread(() =>
{
// 更新设备信息
mainViewModel.DeviceId = id?.ToString() ?? "--";
mainViewModel.DeviceRssi = rssi?.ToString() ?? "--";
});
// 更新设备信息
mainViewModel.DeviceId = id?.ToString() ?? "--";
mainViewModel.DeviceRssi = rssi?.ToString() ?? "--";
string password = mainViewModel.Password;
// 开关锁需要先充电
if (operation == ViewModels.OperationType.LOCK || operation == ViewModels.OperationType.UNLOCK)
if (Operation == ViewModels.OperationType.LOCK || Operation == ViewModels.OperationType.UNLOCK)
{
while (true)
{
@ -52,19 +44,16 @@ namespace NFCLockDemoV2.Platforms.Android
{
Integer? level = wrapper.MGetChargeLevel();
string levelText = level?.ToString() ?? "0";
// 在主线程上更新UI
MainThread.BeginInvokeOnMainThread(() =>
mainViewModel.UpdateMessage("充电中(" + levelText + "%)");
// 更新进度条
if (level != null)
{
mainViewModel.UpdateMessage("充电中(" + levelText + "%)");
// 更新进度条
if (level != null)
{
mainViewModel.ArcProgress = level.IntValue();
}
});
mainViewModel.ArcProgress = level.IntValue();
}
if (level != null && level.IntValue() >= 100)
{
break;
@ -72,19 +61,13 @@ namespace NFCLockDemoV2.Platforms.Android
}
else if (result == Com.Lvcheng.Lock.Shared.Nfc.Result.Unauthorized)
{
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.UpdateMessage("验证失败");
});
mainViewModel.UpdateMessage("验证失败");
// 返回 false 手动结束 NFC 连接
return new Java.Lang.Boolean(false);
}
else
{
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.UpdateMessage("充电失败");
});
mainViewModel.UpdateMessage("充电失败");
return new Java.Lang.Boolean(false);
}
@ -93,58 +76,40 @@ namespace NFCLockDemoV2.Platforms.Android
}
}
if (operation != null)
if (Operation != null)
{
switch (operation)
switch (Operation)
{
case ViewModels.OperationType.UNLOCK:
if (wrapper.Control(password, false) == Com.Lvcheng.Lock.Shared.Nfc.Result.Ok)
{
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.UpdateMessage("开锁成功");
});
mainViewModel.UpdateMessage("开锁成功");
}
else
{
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.UpdateMessage("开锁失败");
});
mainViewModel.UpdateMessage("开锁失败");
}
return new Java.Lang.Boolean(false);
case ViewModels.OperationType.LOCK:
if (wrapper.Control(password, true) == Com.Lvcheng.Lock.Shared.Nfc.Result.Ok)
{
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.UpdateMessage("关锁成功");
});
mainViewModel.UpdateMessage("关锁成功");
}
else
{
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.UpdateMessage("关锁失败");
});
mainViewModel.UpdateMessage("关锁失败");
}
return new Java.Lang.Boolean(false);
case ViewModels.OperationType.SET_PASSWORD:
if (wrapper.SetKey(password, "") == Com.Lvcheng.Lock.Shared.Nfc.Result.Ok)
{
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.UpdateMessage("设置密码成功");
});
mainViewModel.UpdateMessage("设置密码成功");
}
else
{
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.UpdateMessage("设置密码失败");
});
mainViewModel.UpdateMessage("设置密码失败");
}
return new Java.Lang.Boolean(false);
}
@ -155,24 +120,18 @@ namespace NFCLockDemoV2.Platforms.Android
catch (Exception ex)
{
Log.Error("NFCCallbacks", "Error in OnLoop: " + ex.Message);
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.UpdateMessage("操作异常: " + ex.Message);
});
mainViewModel.UpdateMessage("操作异常: " + ex.Message);
return new Java.Lang.Boolean(false);
}
}
public void OnLost()
{
MainThread.BeginInvokeOnMainThread(() =>
{
mainViewModel.DeviceId = "--";
mainViewModel.DeviceRssi = "--";
mainViewModel.DeviceStatus = "设备连接断开";
mainViewModel.Operation = null;
mainViewModel.ArcProgress = 0;
});
{
mainViewModel.DeviceId = "--";
mainViewModel.DeviceRssi = "--";
mainViewModel.DeviceStatus = "设备连接断开";
//mainViewModel.Operation = null;
mainViewModel.ArcProgress = 0;
}
}
}

View File

@ -36,6 +36,8 @@
<string>nfc-tag-reading</string>
</array>
<key>CFBundleIdentifier</key>
<string></string>
<string>com.elitesys.nfclockdemov2</string>
<key>MinimumOSVersion</key>
<string>15.0</string>
</dict>
</plist>

View File

@ -1,3 +1,4 @@
using System.Collections.ObjectModel;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@ -24,7 +25,13 @@ public class MainViewModel : ObservableObject
public string DeviceId
{
get => _deviceId;
set => SetProperty(ref _deviceId, value);
set
{
if (SetProperty(ref _deviceId, value))
{
AddDevice(value);
}
}
}
private string _deviceStatus = "";
@ -49,14 +56,32 @@ public class MainViewModel : ObservableObject
}
public ICommand ControlCommand { get; set; }
public ICommand CopyCommand { get; set; }
public void UpdateMessage(string message)
{
DeviceStatus = message;
}
public ObservableCollection<string> Devices { get; set; }
private void AddDevice(string deviceId)
{
if (deviceId != "--" && !Devices.Contains(deviceId))
{
Devices.Add(deviceId);
}
}
private async Task CopyToDeviceClipboardAsync(string text)
{
await Clipboard.SetTextAsync(text);
await Application.Current.MainPage.DisplayAlert("提示", $"已复制:{text}", "确定");
}
public MainViewModel()
{
Devices = new ObservableCollection<string>();
ControlCommand = new AsyncRelayCommand<string>(val =>
{
switch (val)
@ -77,5 +102,13 @@ public class MainViewModel : ObservableObject
return Task.CompletedTask;
});
CopyCommand = new AsyncRelayCommand<string>(async (text) =>
{
if (!string.IsNullOrEmpty(text))
{
await CopyToDeviceClipboardAsync(text);
}
});
}
}

View File

@ -1,707 +0,0 @@
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSError.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSSet.h>
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
@class NFCSDKCV, NFCSDKCVCompanion, NFCSDKCallFunctionTask, NFCSDKChargeLevel, NFCSDKCommonTask, NFCSDKControlProgress, NFCSDKControlTask, NFCSDKCtrl, NFCSDKCtrlCompanion, NFCSDKDevice, NFCSDKDeviceInfo, NFCSDKDeviceLog, NFCSDKDeviceManager, NFCSDKGetLogTask, NFCSDKKotlinArray<T>, NFCSDKKotlinByteArray, NFCSDKKotlinByteIterator, NFCSDKKotlinEnum<E>, NFCSDKKotlinEnumCompanion, NFCSDKKotlinException, NFCSDKKotlinIllegalStateException, NFCSDKKotlinPair<__covariant A, __covariant B>, NFCSDKKotlinRuntimeException, NFCSDKKotlinThrowable, NFCSDKKotlinUnit, NFCSDKMet, NFCSDKMetCompanion, NFCSDKParameters, NFCSDKResult, NFCSDKSetKeyTask, NFCSDKSetParametersTask, NFCSDKUserType, NFCSDKUserTypeCompanion;
@protocol NFCSDKKotlinComparable, NFCSDKKotlinIterator, NFCSDKNFCCallbacks, NFCSDKNFCTag;
NS_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wincompatible-property-type"
#pragma clang diagnostic ignored "-Wnullability"
#pragma push_macro("_Nullable_result")
#if !__has_feature(nullability_nullable_result)
#undef _Nullable_result
#define _Nullable_result _Nullable
#endif
__attribute__((swift_name("KotlinBase")))
@interface NFCSDKBase : NSObject
- (instancetype)init __attribute__((unavailable));
+ (instancetype)new __attribute__((unavailable));
+ (void)initialize __attribute__((objc_requires_super));
@end
@interface NFCSDKBase (NFCSDKBaseCopying) <NSCopying>
@end
__attribute__((swift_name("KotlinMutableSet")))
@interface NFCSDKMutableSet<ObjectType> : NSMutableSet<ObjectType>
@end
__attribute__((swift_name("KotlinMutableDictionary")))
@interface NFCSDKMutableDictionary<KeyType, ObjectType> : NSMutableDictionary<KeyType, ObjectType>
@end
@interface NSError (NSErrorNFCSDKKotlinException)
@property (readonly) id _Nullable kotlinException;
@end
__attribute__((swift_name("KotlinNumber")))
@interface NFCSDKNumber : NSNumber
- (instancetype)initWithChar:(char)value __attribute__((unavailable));
- (instancetype)initWithUnsignedChar:(unsigned char)value __attribute__((unavailable));
- (instancetype)initWithShort:(short)value __attribute__((unavailable));
- (instancetype)initWithUnsignedShort:(unsigned short)value __attribute__((unavailable));
- (instancetype)initWithInt:(int)value __attribute__((unavailable));
- (instancetype)initWithUnsignedInt:(unsigned int)value __attribute__((unavailable));
- (instancetype)initWithLong:(long)value __attribute__((unavailable));
- (instancetype)initWithUnsignedLong:(unsigned long)value __attribute__((unavailable));
- (instancetype)initWithLongLong:(long long)value __attribute__((unavailable));
- (instancetype)initWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable));
- (instancetype)initWithFloat:(float)value __attribute__((unavailable));
- (instancetype)initWithDouble:(double)value __attribute__((unavailable));
- (instancetype)initWithBool:(BOOL)value __attribute__((unavailable));
- (instancetype)initWithInteger:(NSInteger)value __attribute__((unavailable));
- (instancetype)initWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable));
+ (instancetype)numberWithChar:(char)value __attribute__((unavailable));
+ (instancetype)numberWithUnsignedChar:(unsigned char)value __attribute__((unavailable));
+ (instancetype)numberWithShort:(short)value __attribute__((unavailable));
+ (instancetype)numberWithUnsignedShort:(unsigned short)value __attribute__((unavailable));
+ (instancetype)numberWithInt:(int)value __attribute__((unavailable));
+ (instancetype)numberWithUnsignedInt:(unsigned int)value __attribute__((unavailable));
+ (instancetype)numberWithLong:(long)value __attribute__((unavailable));
+ (instancetype)numberWithUnsignedLong:(unsigned long)value __attribute__((unavailable));
+ (instancetype)numberWithLongLong:(long long)value __attribute__((unavailable));
+ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable));
+ (instancetype)numberWithFloat:(float)value __attribute__((unavailable));
+ (instancetype)numberWithDouble:(double)value __attribute__((unavailable));
+ (instancetype)numberWithBool:(BOOL)value __attribute__((unavailable));
+ (instancetype)numberWithInteger:(NSInteger)value __attribute__((unavailable));
+ (instancetype)numberWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable));
@end
__attribute__((swift_name("KotlinByte")))
@interface NFCSDKByte : NFCSDKNumber
- (instancetype)initWithChar:(char)value;
+ (instancetype)numberWithChar:(char)value;
@end
__attribute__((swift_name("KotlinUByte")))
@interface NFCSDKUByte : NFCSDKNumber
- (instancetype)initWithUnsignedChar:(unsigned char)value;
+ (instancetype)numberWithUnsignedChar:(unsigned char)value;
@end
__attribute__((swift_name("KotlinShort")))
@interface NFCSDKShort : NFCSDKNumber
- (instancetype)initWithShort:(short)value;
+ (instancetype)numberWithShort:(short)value;
@end
__attribute__((swift_name("KotlinUShort")))
@interface NFCSDKUShort : NFCSDKNumber
- (instancetype)initWithUnsignedShort:(unsigned short)value;
+ (instancetype)numberWithUnsignedShort:(unsigned short)value;
@end
__attribute__((swift_name("KotlinInt")))
@interface NFCSDKInt : NFCSDKNumber
- (instancetype)initWithInt:(int)value;
+ (instancetype)numberWithInt:(int)value;
@end
__attribute__((swift_name("KotlinUInt")))
@interface NFCSDKUInt : NFCSDKNumber
- (instancetype)initWithUnsignedInt:(unsigned int)value;
+ (instancetype)numberWithUnsignedInt:(unsigned int)value;
@end
__attribute__((swift_name("KotlinLong")))
@interface NFCSDKLong : NFCSDKNumber
- (instancetype)initWithLongLong:(long long)value;
+ (instancetype)numberWithLongLong:(long long)value;
@end
__attribute__((swift_name("KotlinULong")))
@interface NFCSDKULong : NFCSDKNumber
- (instancetype)initWithUnsignedLongLong:(unsigned long long)value;
+ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value;
@end
__attribute__((swift_name("KotlinFloat")))
@interface NFCSDKFloat : NFCSDKNumber
- (instancetype)initWithFloat:(float)value;
+ (instancetype)numberWithFloat:(float)value;
@end
__attribute__((swift_name("KotlinDouble")))
@interface NFCSDKDouble : NFCSDKNumber
- (instancetype)initWithDouble:(double)value;
+ (instancetype)numberWithDouble:(double)value;
@end
__attribute__((swift_name("KotlinBoolean")))
@interface NFCSDKBoolean : NFCSDKNumber
- (instancetype)initWithBool:(BOOL)value;
+ (instancetype)numberWithBool:(BOOL)value;
@end
__attribute__((swift_name("KotlinComparable")))
@protocol NFCSDKKotlinComparable
@required
- (int32_t)compareToOther:(id _Nullable)other __attribute__((swift_name("compareTo(other:)")));
@end
__attribute__((swift_name("KotlinEnum")))
@interface NFCSDKKotlinEnum<E> : NFCSDKBase <NFCSDKKotlinComparable>
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer));
@property (class, readonly, getter=companion) NFCSDKKotlinEnumCompanion *companion __attribute__((swift_name("companion")));
- (int32_t)compareToOther:(E)other __attribute__((swift_name("compareTo(other:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) NSString *name __attribute__((swift_name("name")));
@property (readonly) int32_t ordinal __attribute__((swift_name("ordinal")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("CV")))
@interface NFCSDKCV : NFCSDKKotlinEnum<NFCSDKCV *>
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
@property (class, readonly, getter=companion) NFCSDKCVCompanion *companion __attribute__((swift_name("companion")));
@property (class, readonly) NFCSDKCV *low __attribute__((swift_name("low")));
@property (class, readonly) NFCSDKCV *medium __attribute__((swift_name("medium")));
@property (class, readonly) NFCSDKCV *high __attribute__((swift_name("high")));
+ (NFCSDKKotlinArray<NFCSDKCV *> *)values __attribute__((swift_name("values()")));
@property (class, readonly) NSArray<NFCSDKCV *> *entries __attribute__((swift_name("entries")));
@property (readonly) uint16_t value __attribute__((swift_name("value")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("CV.Companion")))
@interface NFCSDKCVCompanion : NFCSDKBase
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
+ (instancetype)companion __attribute__((swift_name("init()")));
@property (class, readonly, getter=shared) NFCSDKCVCompanion *shared __attribute__((swift_name("shared")));
- (NFCSDKCV * _Nullable)fromValueValue:(uint16_t)value __attribute__((swift_name("fromValue(value:)")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("ChargeLevel")))
@interface NFCSDKChargeLevel : NFCSDKBase
- (instancetype)initWithLevel:(uint16_t)level complete:(BOOL)complete __attribute__((swift_name("init(level:complete:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKChargeLevel *)doCopyLevel:(uint16_t)level complete:(BOOL)complete __attribute__((swift_name("doCopy(level:complete:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) BOOL complete __attribute__((swift_name("complete")));
@property (readonly) uint16_t level __attribute__((swift_name("level")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("ControlProgress")))
@interface NFCSDKControlProgress : NFCSDKBase
- (instancetype)initWithProgress:(uint16_t)progress complete:(BOOL)complete __attribute__((swift_name("init(progress:complete:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKControlProgress *)doCopyProgress:(uint16_t)progress complete:(BOOL)complete __attribute__((swift_name("doCopy(progress:complete:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) BOOL complete __attribute__((swift_name("complete")));
@property (readonly) uint16_t progress __attribute__((swift_name("progress")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Ctrl")))
@interface NFCSDKCtrl : NFCSDKKotlinEnum<NFCSDKCtrl *>
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
@property (class, readonly, getter=companion) NFCSDKCtrlCompanion *companion __attribute__((swift_name("companion")));
@property (class, readonly) NFCSDKCtrl *lock __attribute__((swift_name("lock")));
@property (class, readonly) NFCSDKCtrl *unlock __attribute__((swift_name("unlock")));
+ (NFCSDKKotlinArray<NFCSDKCtrl *> *)values __attribute__((swift_name("values()")));
@property (class, readonly) NSArray<NFCSDKCtrl *> *entries __attribute__((swift_name("entries")));
@property (readonly) uint8_t value __attribute__((swift_name("value")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Ctrl.Companion")))
@interface NFCSDKCtrlCompanion : NFCSDKBase
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
+ (instancetype)companion __attribute__((swift_name("init()")));
@property (class, readonly, getter=shared) NFCSDKCtrlCompanion *shared __attribute__((swift_name("shared")));
- (NFCSDKCtrl * _Nullable)fromValueValue:(uint8_t)value __attribute__((swift_name("fromValue(value:)")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Device")))
@interface NFCSDKDevice : NFCSDKBase
- (instancetype)initWithS:(uint32_t)s __attribute__((swift_name("init(s:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKDevice *)doCopyS:(uint32_t)s __attribute__((swift_name("doCopy(s:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (uint32_t)shiftC:(uint16_t)c __attribute__((swift_name("shift(c:)")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) uint32_t s __attribute__((swift_name("s")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("DeviceInfo")))
@interface NFCSDKDeviceInfo : NFCSDKBase
- (instancetype)initWithId:(uint64_t)id isNew:(BOOL)isNew __attribute__((swift_name("init(id:isNew:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKDeviceInfo *)doCopyId:(uint64_t)id isNew:(BOOL)isNew __attribute__((swift_name("doCopy(id:isNew:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) uint64_t id __attribute__((swift_name("id")));
@property (readonly) BOOL isNew __attribute__((swift_name("isNew")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("DeviceLog")))
@interface NFCSDKDeviceLog : NFCSDKBase
- (instancetype)initWithTimestamp:(uint64_t)timestamp username:(NSString *)username ctrl:(NFCSDKCtrl * _Nullable)ctrl __attribute__((swift_name("init(timestamp:username:ctrl:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKDeviceLog *)doCopyTimestamp:(uint64_t)timestamp username:(NSString *)username ctrl:(NFCSDKCtrl * _Nullable)ctrl __attribute__((swift_name("doCopy(timestamp:username:ctrl:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) NFCSDKCtrl * _Nullable ctrl __attribute__((swift_name("ctrl")));
@property (readonly) uint64_t timestamp __attribute__((swift_name("timestamp")));
@property (readonly) NSString *username __attribute__((swift_name("username")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("DeviceManager")))
@interface NFCSDKDeviceManager : NFCSDKBase
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
+ (instancetype)deviceManager __attribute__((swift_name("init()")));
@property (class, readonly, getter=shared) NFCSDKDeviceManager *shared __attribute__((swift_name("shared")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)controlT:(id<NFCSDKNFCTag>)t d:(NFCSDKDevice *)d key:(NFCSDKKotlinByteArray *)key ctrl:(NFCSDKCtrl *)ctrl completionHandler:(void (^)(NFCSDKResult * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("control(t:d:key:ctrl:completionHandler:)")));
- (NFCSDKKotlinByteArray *)encKey:(NFCSDKKotlinByteArray *)key info:(NFCSDKDeviceInfo *)info __attribute__((swift_name("enc(key:info:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)getChargeLevelT:(id<NFCSDKNFCTag>)t d:(NFCSDKDevice *)d key:(NFCSDKKotlinByteArray *)key completionHandler:(void (^)(NFCSDKKotlinPair<NFCSDKResult *, NFCSDKChargeLevel *> * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("getChargeLevel(t:d:key:completionHandler:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)getControlProgressT:(id<NFCSDKNFCTag>)t d:(NFCSDKDevice *)d key:(NFCSDKKotlinByteArray *)key completionHandler:(void (^)(NFCSDKKotlinPair<NFCSDKResult *, NFCSDKControlProgress *> * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("getControlProgress(t:d:key:completionHandler:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)getInfoT:(id<NFCSDKNFCTag>)t d:(NFCSDKDevice *)d completionHandler:(void (^)(NFCSDKKotlinPair<NFCSDKResult *, NFCSDKDeviceInfo *> * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("getInfo(t:d:completionHandler:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)getLogT:(id<NFCSDKNFCTag>)t d:(NFCSDKDevice *)d key:(NFCSDKKotlinByteArray *)key completionHandler:(void (^)(NFCSDKKotlinPair<NFCSDKResult *, NSArray<NFCSDKDeviceLog *> *> * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("getLog(t:d:key:completionHandler:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)getRssiT:(id<NFCSDKNFCTag>)t d:(NFCSDKDevice *)d completionHandler:(void (^)(NFCSDKKotlinPair<NFCSDKResult *, NFCSDKUInt *> * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("getRssi(t:d:completionHandler:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)getVersionT:(id<NFCSDKNFCTag>)t d:(NFCSDKDevice *)d key:(NFCSDKKotlinByteArray *)key completionHandler:(void (^)(NFCSDKKotlinPair<NFCSDKResult *, NSArray<NFCSDKUInt *> *> * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("getVersion(t:d:key:completionHandler:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)doInitT:(id<NFCSDKNFCTag>)t completionHandler:(void (^)(NFCSDKKotlinPair<NFCSDKResult *, NFCSDKDevice *> * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("doInit(t:completionHandler:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)selectT:(id<NFCSDKNFCTag>)t d:(NFCSDKDevice *)d type:(NFCSDKUserType *)type completionHandler:(void (^)(NFCSDKResult * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("select(t:d:type:completionHandler:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)setKeyT:(id<NFCSDKNFCTag>)t d:(NFCSDKDevice *)d info:(NFCSDKDeviceInfo *)info key:(NFCSDKKotlinByteArray *)key sKey:(NFCSDKKotlinByteArray *)sKey completionHandler:(void (^)(NFCSDKResult * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("setKey(t:d:info:key:sKey:completionHandler:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)setParametersT:(id<NFCSDKNFCTag>)t d:(NFCSDKDevice *)d key:(NFCSDKKotlinByteArray *)key p:(NFCSDKParameters *)p completionHandler:(void (^)(NFCSDKResult * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("setParameters(t:d:key:p:completionHandler:)")));
- (NFCSDKKotlinByteArray *)toFixed16Input:(NSString *)input __attribute__((swift_name("toFixed16(input:)")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("IOSNFCHelper")))
@interface NFCSDKIOSNFCHelper : NFCSDKBase
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
- (void)controlPassword:(NSString *)password ctrl:(NFCSDKCtrl *)ctrl __attribute__((swift_name("control(password:ctrl:)")));
- (void)lockPassword:(NSString *)password __attribute__((swift_name("lock(password:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)processWithCompletionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("process(completionHandler:)")));
- (void)setChargingCbCb:(void (^ _Nullable)(NSString *, NFCSDKInt * _Nullable))cb __attribute__((swift_name("setChargingCb(cb:)")));
- (void)setControllingCbCb:(void (^ _Nullable)(NSString *, NFCSDKInt * _Nullable))cb __attribute__((swift_name("setControllingCb(cb:)")));
- (void)setFinishedCbCb:(void (^ _Nullable)(void))cb __attribute__((swift_name("setFinishedCb(cb:)")));
- (void)setLoopCbCb:(NFCSDKBoolean *(^)(NSString *, NFCSDKBoolean *, NFCSDKInt * _Nullable))cb __attribute__((swift_name("setLoopCb(cb:)")));
- (void)setLostCbCb:(void (^ _Nullable)(void))cb __attribute__((swift_name("setLostCb(cb:)")));
- (void)setTransceiverT:(void (^ _Nullable)(NFCSDKKotlinByteArray *, NFCSDKKotlinUnit *(^)(NFCSDKKotlinByteArray *)))t __attribute__((swift_name("setTransceiver(t:)")));
- (void)unlockPassword:(NSString *)password __attribute__((swift_name("unlock(password:)")));
@property void (^ _Nullable charging)(NSString *, NFCSDKInt * _Nullable) __attribute__((swift_name("charging")));
@property void (^ _Nullable controlling)(NSString *, NFCSDKInt * _Nullable) __attribute__((swift_name("controlling")));
@property void (^ _Nullable finished)(void) __attribute__((swift_name("finished")));
@property NFCSDKBoolean *(^ _Nullable loop)(NSString *, NFCSDKBoolean *, NFCSDKInt * _Nullable) __attribute__((swift_name("loop")));
@property void (^ _Nullable lost)(void) __attribute__((swift_name("lost")));
@property void (^ _Nullable transceiver)(NFCSDKKotlinByteArray *, NFCSDKKotlinUnit *(^)(NFCSDKKotlinByteArray *)) __attribute__((swift_name("transceiver")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Met")))
@interface NFCSDKMet : NFCSDKKotlinEnum<NFCSDKMet *>
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
@property (class, readonly, getter=companion) NFCSDKMetCompanion *companion __attribute__((swift_name("companion")));
@property (class, readonly) NFCSDKMet *single __attribute__((swift_name("single")));
@property (class, readonly) NFCSDKMet *voltage __attribute__((swift_name("voltage")));
@property (class, readonly) NFCSDKMet *timer __attribute__((swift_name("timer")));
+ (NFCSDKKotlinArray<NFCSDKMet *> *)values __attribute__((swift_name("values()")));
@property (class, readonly) NSArray<NFCSDKMet *> *entries __attribute__((swift_name("entries")));
@property (readonly) uint8_t value __attribute__((swift_name("value")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Met.Companion")))
@interface NFCSDKMetCompanion : NFCSDKBase
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
+ (instancetype)companion __attribute__((swift_name("init()")));
@property (class, readonly, getter=shared) NFCSDKMetCompanion *shared __attribute__((swift_name("shared")));
- (NFCSDKMet * _Nullable)fromValueValue:(uint8_t)value __attribute__((swift_name("fromValue(value:)")));
@end
__attribute__((swift_name("NFCTag")))
@protocol NFCSDKNFCTag
@required
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)transceiveData:(NFCSDKKotlinByteArray *)data completionHandler:(void (^)(NFCSDKKotlinByteArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("transceive(data:completionHandler:)")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Parameters")))
@interface NFCSDKParameters : NFCSDKBase
- (instancetype)initWithMethod:(NFCSDKMet *)method clampingVoltage:(NFCSDKCV *)clampingVoltage totalMotorRuntime:(uint16_t)totalMotorRuntime p1:(uint16_t)p1 p2:(uint16_t)p2 __attribute__((swift_name("init(method:clampingVoltage:totalMotorRuntime:p1:p2:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKParameters *)doCopyMethod:(NFCSDKMet *)method clampingVoltage:(NFCSDKCV *)clampingVoltage totalMotorRuntime:(uint16_t)totalMotorRuntime p1:(uint16_t)p1 p2:(uint16_t)p2 __attribute__((swift_name("doCopy(method:clampingVoltage:totalMotorRuntime:p1:p2:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) NFCSDKCV *clampingVoltage __attribute__((swift_name("clampingVoltage")));
@property (readonly) NFCSDKMet *method __attribute__((swift_name("method")));
@property (readonly) uint16_t p1 __attribute__((swift_name("p1")));
@property (readonly) uint16_t p2 __attribute__((swift_name("p2")));
@property (readonly) uint16_t totalMotorRuntime __attribute__((swift_name("totalMotorRuntime")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Result")))
@interface NFCSDKResult : NFCSDKKotlinEnum<NFCSDKResult *>
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
@property (class, readonly) NFCSDKResult *ok __attribute__((swift_name("ok")));
@property (class, readonly) NFCSDKResult *error __attribute__((swift_name("error")));
@property (class, readonly) NFCSDKResult *unauthorized __attribute__((swift_name("unauthorized")));
+ (NFCSDKKotlinArray<NFCSDKResult *> *)values __attribute__((swift_name("values()")));
@property (class, readonly) NSArray<NFCSDKResult *> *entries __attribute__((swift_name("entries")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("UserType")))
@interface NFCSDKUserType : NFCSDKKotlinEnum<NFCSDKUserType *>
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
@property (class, readonly, getter=companion) NFCSDKUserTypeCompanion *companion __attribute__((swift_name("companion")));
@property (class, readonly) NFCSDKUserType *normal __attribute__((swift_name("normal")));
@property (class, readonly) NFCSDKUserType *supervisor __attribute__((swift_name("supervisor")));
+ (NFCSDKKotlinArray<NFCSDKUserType *> *)values __attribute__((swift_name("values()")));
@property (class, readonly) NSArray<NFCSDKUserType *> *entries __attribute__((swift_name("entries")));
@property (readonly) uint8_t value __attribute__((swift_name("value")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("UserType.Companion")))
@interface NFCSDKUserTypeCompanion : NFCSDKBase
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
+ (instancetype)companion __attribute__((swift_name("init()")));
@property (class, readonly, getter=shared) NFCSDKUserTypeCompanion *shared __attribute__((swift_name("shared")));
- (NFCSDKUserType * _Nullable)fromValueValue:(uint8_t)value __attribute__((swift_name("fromValue(value:)")));
@end
__attribute__((swift_name("CommonTask")))
@interface NFCSDKCommonTask : NFCSDKBase
@property (readonly) NSString *password __attribute__((swift_name("password")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("CallFunctionTask")))
@interface NFCSDKCallFunctionTask : NFCSDKCommonTask
- (instancetype)initWithPassword:(NSString *)password data:(NSArray<NFCSDKUInt *> *)data index:(uint8_t)index callback:(void (^)(NFCSDKResult *, NSArray<NFCSDKUInt *> * _Nullable))callback __attribute__((swift_name("init(password:data:index:callback:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKCallFunctionTask *)doCopyPassword:(NSString *)password data:(NSArray<NFCSDKUInt *> *)data index:(uint8_t)index callback:(void (^)(NFCSDKResult *, NSArray<NFCSDKUInt *> * _Nullable))callback __attribute__((swift_name("doCopy(password:data:index:callback:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) void (^callback)(NFCSDKResult *, NSArray<NFCSDKUInt *> * _Nullable) __attribute__((swift_name("callback")));
@property (readonly) NSArray<NFCSDKUInt *> *data __attribute__((swift_name("data")));
@property (readonly) uint8_t index __attribute__((swift_name("index")));
@property (readonly) NSString *password __attribute__((swift_name("password")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("ControlTask")))
@interface NFCSDKControlTask : NFCSDKCommonTask
- (instancetype)initWithPassword:(NSString *)password ctrl:(NFCSDKCtrl *)ctrl ignoreProgress:(BOOL)ignoreProgress chargeCallback:(void (^)(NFCSDKResult *, NFCSDKChargeLevel * _Nullable))chargeCallback controlCallback:(void (^)(NFCSDKResult *, NFCSDKControlProgress * _Nullable))controlCallback __attribute__((swift_name("init(password:ctrl:ignoreProgress:chargeCallback:controlCallback:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKControlTask *)doCopyPassword:(NSString *)password ctrl:(NFCSDKCtrl *)ctrl ignoreProgress:(BOOL)ignoreProgress chargeCallback:(void (^)(NFCSDKResult *, NFCSDKChargeLevel * _Nullable))chargeCallback controlCallback:(void (^)(NFCSDKResult *, NFCSDKControlProgress * _Nullable))controlCallback __attribute__((swift_name("doCopy(password:ctrl:ignoreProgress:chargeCallback:controlCallback:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) void (^chargeCallback)(NFCSDKResult *, NFCSDKChargeLevel * _Nullable) __attribute__((swift_name("chargeCallback")));
@property (readonly) void (^controlCallback)(NFCSDKResult *, NFCSDKControlProgress * _Nullable) __attribute__((swift_name("controlCallback")));
@property (readonly) NFCSDKCtrl *ctrl __attribute__((swift_name("ctrl")));
@property (readonly) BOOL ignoreProgress __attribute__((swift_name("ignoreProgress")));
@property (readonly) NSString *password __attribute__((swift_name("password")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("GetLogTask")))
@interface NFCSDKGetLogTask : NFCSDKCommonTask
- (instancetype)initWithPassword:(NSString *)password callback:(void (^)(NFCSDKResult *, NSArray<NFCSDKDeviceLog *> * _Nullable))callback __attribute__((swift_name("init(password:callback:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKGetLogTask *)doCopyPassword:(NSString *)password callback:(void (^)(NFCSDKResult *, NSArray<NFCSDKDeviceLog *> * _Nullable))callback __attribute__((swift_name("doCopy(password:callback:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) void (^callback)(NFCSDKResult *, NSArray<NFCSDKDeviceLog *> * _Nullable) __attribute__((swift_name("callback")));
@property (readonly) NSString *password __attribute__((swift_name("password")));
@end
__attribute__((swift_name("NFCCallbacks")))
@protocol NFCSDKNFCCallbacks
@required
- (void)onFinished __attribute__((swift_name("onFinished()")));
- (BOOL)onLoopInfo:(NFCSDKDeviceInfo *)info rssi:(NFCSDKUInt * _Nullable)rssi __attribute__((swift_name("onLoop(info:rssi:)")));
- (void)onLost __attribute__((swift_name("onLost()")));
@end
__attribute__((swift_name("NFCHelper")))
@interface NFCSDKNFCHelper : NFCSDKBase
- (instancetype)initWithCallback:(id<NFCSDKNFCCallbacks>)callback __attribute__((swift_name("init(callback:)"))) __attribute__((objc_designated_initializer));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)getNFCTagParameter:(id _Nullable)parameter completionHandler:(void (^)(id<NFCSDKNFCTag> _Nullable_result, NSError * _Nullable))completionHandler __attribute__((swift_name("getNFCTag(parameter:completionHandler:)")));
/**
* @note This method converts instances of CancellationException to errors.
* Other uncaught Kotlin exceptions are fatal.
*/
- (void)processParameter:(id _Nullable)parameter completionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("process(parameter:completionHandler:)")));
- (void)setTaskTask:(NFCSDKCommonTask * _Nullable)task __attribute__((swift_name("setTask(task:)")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("SetKeyTask")))
@interface NFCSDKSetKeyTask : NFCSDKCommonTask
- (instancetype)initWithPassword:(NSString *)password sKey:(NSString *)sKey callback:(void (^)(NFCSDKResult *))callback __attribute__((swift_name("init(password:sKey:callback:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKSetKeyTask *)doCopyPassword:(NSString *)password sKey:(NSString *)sKey callback:(void (^)(NFCSDKResult *))callback __attribute__((swift_name("doCopy(password:sKey:callback:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) void (^callback)(NFCSDKResult *) __attribute__((swift_name("callback")));
@property (readonly) NSString *password __attribute__((swift_name("password")));
@property (readonly) NSString *sKey __attribute__((swift_name("sKey")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("SetParametersTask")))
@interface NFCSDKSetParametersTask : NFCSDKCommonTask
- (instancetype)initWithPassword:(NSString *)password parameters:(NFCSDKParameters *)parameters callback:(void (^)(NFCSDKResult *))callback __attribute__((swift_name("init(password:parameters:callback:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKSetParametersTask *)doCopyPassword:(NSString *)password parameters:(NFCSDKParameters *)parameters callback:(void (^)(NFCSDKResult *))callback __attribute__((swift_name("doCopy(password:parameters:callback:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) void (^callback)(NFCSDKResult *) __attribute__((swift_name("callback")));
@property (readonly) NFCSDKParameters *parameters __attribute__((swift_name("parameters")));
@property (readonly) NSString *password __attribute__((swift_name("password")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Platform_iosKt")))
@interface NFCSDKPlatform_iosKt : NFCSDKBase
+ (int64_t)platformGetCurrentTimestamp __attribute__((swift_name("platformGetCurrentTimestamp()")));
+ (NSString *)platformGetName __attribute__((swift_name("platformGetName()")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("KotlinEnumCompanion")))
@interface NFCSDKKotlinEnumCompanion : NFCSDKBase
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
+ (instancetype)companion __attribute__((swift_name("init()")));
@property (class, readonly, getter=shared) NFCSDKKotlinEnumCompanion *shared __attribute__((swift_name("shared")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("KotlinArray")))
@interface NFCSDKKotlinArray<T> : NFCSDKBase
+ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(NFCSDKInt *))init __attribute__((swift_name("init(size:init:)")));
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)")));
- (id<NFCSDKKotlinIterator>)iterator __attribute__((swift_name("iterator()")));
- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)")));
@property (readonly) int32_t size __attribute__((swift_name("size")));
@end
__attribute__((swift_name("KotlinThrowable")))
@interface NFCSDKKotlinThrowable : NFCSDKBase
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithCause:(NFCSDKKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(NFCSDKKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer));
/**
* @note annotations
* kotlin.experimental.ExperimentalNativeApi
*/
- (NFCSDKKotlinArray<NSString *> *)getStackTrace __attribute__((swift_name("getStackTrace()")));
- (void)printStackTrace __attribute__((swift_name("printStackTrace()")));
- (NSString *)description __attribute__((swift_name("description()")));
@property (readonly) NFCSDKKotlinThrowable * _Nullable cause __attribute__((swift_name("cause")));
@property (readonly) NSString * _Nullable message __attribute__((swift_name("message")));
- (NSError *)asError __attribute__((swift_name("asError()")));
@end
__attribute__((swift_name("KotlinException")))
@interface NFCSDKKotlinException : NFCSDKKotlinThrowable
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithCause:(NFCSDKKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(NFCSDKKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer));
@end
__attribute__((swift_name("KotlinRuntimeException")))
@interface NFCSDKKotlinRuntimeException : NFCSDKKotlinException
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithCause:(NFCSDKKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(NFCSDKKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer));
@end
__attribute__((swift_name("KotlinIllegalStateException")))
@interface NFCSDKKotlinIllegalStateException : NFCSDKKotlinRuntimeException
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithCause:(NFCSDKKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(NFCSDKKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer));
@end
/**
* @note annotations
* kotlin.SinceKotlin(version="1.4")
*/
__attribute__((swift_name("KotlinCancellationException")))
@interface NFCSDKKotlinCancellationException : NFCSDKKotlinIllegalStateException
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithCause:(NFCSDKKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(NFCSDKKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("KotlinByteArray")))
@interface NFCSDKKotlinByteArray : NFCSDKBase
+ (instancetype)arrayWithSize:(int32_t)size __attribute__((swift_name("init(size:)")));
+ (instancetype)arrayWithSize:(int32_t)size init:(NFCSDKByte *(^)(NFCSDKInt *))init __attribute__((swift_name("init(size:init:)")));
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
- (int8_t)getIndex:(int32_t)index __attribute__((swift_name("get(index:)")));
- (NFCSDKKotlinByteIterator *)iterator __attribute__((swift_name("iterator()")));
- (void)setIndex:(int32_t)index value:(int8_t)value __attribute__((swift_name("set(index:value:)")));
@property (readonly) int32_t size __attribute__((swift_name("size")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("KotlinPair")))
@interface NFCSDKKotlinPair<__covariant A, __covariant B> : NFCSDKBase
- (instancetype)initWithFirst:(A _Nullable)first second:(B _Nullable)second __attribute__((swift_name("init(first:second:)"))) __attribute__((objc_designated_initializer));
- (NFCSDKKotlinPair<A, B> *)doCopyFirst:(A _Nullable)first second:(B _Nullable)second __attribute__((swift_name("doCopy(first:second:)")));
- (BOOL)equalsOther:(id _Nullable)other __attribute__((swift_name("equals(other:)")));
- (int32_t)hashCode __attribute__((swift_name("hashCode()")));
- (NSString *)toString __attribute__((swift_name("toString()")));
@property (readonly) A _Nullable first __attribute__((swift_name("first")));
@property (readonly) B _Nullable second __attribute__((swift_name("second")));
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("KotlinUnit")))
@interface NFCSDKKotlinUnit : NFCSDKBase
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
+ (instancetype)unit __attribute__((swift_name("init()")));
@property (class, readonly, getter=shared) NFCSDKKotlinUnit *shared __attribute__((swift_name("shared")));
- (NSString *)description __attribute__((swift_name("description()")));
@end
__attribute__((swift_name("KotlinIterator")))
@protocol NFCSDKKotlinIterator
@required
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
- (id _Nullable)next __attribute__((swift_name("next()")));
@end
__attribute__((swift_name("KotlinByteIterator")))
@interface NFCSDKKotlinByteIterator : NFCSDKBase <NFCSDKKotlinIterator>
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
- (NFCSDKByte *)next __attribute__((swift_name("next()")));
- (int8_t)nextByte __attribute__((swift_name("nextByte()")));
@end
#pragma pop_macro("_Nullable_result")
#pragma clang diagnostic pop
NS_ASSUME_NONNULL_END

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>NFCSDK</string>
<key>CFBundleIdentifier</key>
<string>com.lvcheng.lock.shared.nfc.kmp.NFCSDK</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>NFCSDK</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>MinimumOSVersion</key>
<string>12.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
</dict>
</plist>

View File

@ -1,8 +0,0 @@
framework module "NFCSDK" {
umbrella header "NFCSDK.h"
export *
module * { export * }
use Foundation
}

View File

@ -41,7 +41,7 @@
<ItemGroup>
<NativeReference Include="NfcLockFramework.xcframework">
<Frameworks>CoreNFC Foundation</Frameworks>
<Frameworks>CoreNFC NFCSDK</Frameworks>
<Kind>Framework</Kind>
<SmartLink>True</SmartLink>
<ForceLoad>False</ForceLoad>
@ -60,7 +60,7 @@
<NativeReference Include="shared_nfc_kmp.xcframework">
<Kind>Framework</Kind>
<SmartLink>True</SmartLink>
<Frameworks>CoreNFC Foundation</Frameworks>
<Frameworks>CoreNFC NFCSDK</Frameworks>
<ForceLoad>False</ForceLoad>
</NativeReference>
</ItemGroup>