我试图将一个obj-c库从制造商Sensoro绑定到我的Mac上的Xamarin.ios但是我一直坚持在问题主题中宣传的一个奇怪的构建错误。我使用sharpie 3来扫描头文件。对我来说很奇怪的是,NSUuid是来自Xamarin自己的Foundation命名空间的类类型,所以应该支持它,所以我不知道为什么构建过程会抱怨它。这是ApiDefinition.cs
using System;
using CoreBluetooth;
using CoreLocation;
using Foundation;
using ObjCRuntime;
namespace SensoroBeaconKit
{
[Static]
//[Verify (ConstantsInterfaceAssociation)]
partial interface Constants
{
// extern NSString *const SBKBeaconInRangeStatusUpdatedNotification;
[Field ("SBKBeaconInRangeStatusUpdatedNotification", "__Internal")]
NSString SBKBeaconInRangeStatusUpdatedNotification { get; }
// extern NSUuid * SBKSensoroDefaultProximityUUID;
[Field ("SBKSensoroDefaultProximityUUID", "__Internal")]
NSUuid SBKSensoroDefaultProximityUUID { get; }
// extern NSString *const SBKErrorDomain;
[Field ("SBKErrorDomain", "__Internal")]
NSString SBKErrorDomain { get; }
// extern NSString *const SBKBeaconBaseSettingsTransmitPowerKey;
[Field ("SBKBeaconBaseSettingsTransmitPowerKey", "__Internal")]
NSString SBKBeaconBaseSettingsTransmitPowerKey { get; }
// extern NSString *const SBKBeaconBaseSettingsAdvertisingIntervalKey;
[Field ("SBKBeaconBaseSettingsAdvertisingIntervalKey", "__Internal")]
NSString SBKBeaconBaseSettingsAdvertisingIntervalKey { get; }
// extern NSString *const SBKBeaconBaseSettingsEnergySavingModeKey;
[Field ("SBKBeaconBaseSettingsEnergySavingModeKey", "__Internal")]
NSString SBKBeaconBaseSettingsEnergySavingModeKey { get; }
// extern NSString *const SBKBeaconBaseSettingsMeasuredPowerKey;
[Field ("SBKBeaconBaseSettingsMeasuredPowerKey", "__Internal")]
NSString SBKBeaconBaseSettingsMeasuredPowerKey { get; }
// extern NSString *const SBKBeaconSensorSettingsTemperatureSamplingIntervalKey;
[Field ("SBKBeaconSensorSettingsTemperatureSamplingIntervalKey", "__Internal")]
NSString SBKBeaconSensorSettingsTemperatureSamplingIntervalKey { get; }
// extern NSString *const SBKBeaconSensorSettingsLightSamplingIntervalKey;
[Field ("SBKBeaconSensorSettingsLightSamplingIntervalKey", "__Internal")]
NSString SBKBeaconSensorSettingsLightSamplingIntervalKey { get; }
// extern NSString *const SBKBeaconSensorSettingsAccelerometerSensitivityKey;
[Field ("SBKBeaconSensorSettingsAccelerometerSensitivityKey", "__Internal")]
NSString SBKBeaconSensorSettingsAccelerometerSensitivityKey { get; }
}
// @interface SBKBeaconID : NSObject <NSCopying>
[BaseType (typeof(NSObject))]
interface SBKBeaconID : INSCopying
{
// +(instancetype)beaconIDWithProximityUUID:(NSUuid *)proximityUUID;
[Static]
[Export ("beaconIDWithProximityUUID:")]
SBKBeaconID BeaconIDWithProximityUUID (NSUuid proximityUUID);
// +(instancetype)beaconIDWithProximityUUID:(NSUuid *)proximityUUID major:(CLBeaconMajorValue)major;
[Static]
[Export ("beaconIDWithProximityUUID:major:")]
SBKBeaconID BeaconIDWithProximityUUID (NSUuid proximityUUID, ushort major);
// +(instancetype)beaconIDWithProximityUUID:(NSUuid *)proximityUUID major:(CLBeaconMajorValue)major minor:(CLBeaconMinorValue)minor;
[Static]
[Export ("beaconIDWithProximityUUID:major:minor:")]
SBKBeaconID BeaconIDWithProximityUUID (NSUuid proximityUUID, ushort major, ushort minor);
// -(BOOL)isEqualToBeaconID:(SBKBeaconID *)aBeaconID;
[Export ("isEqualToBeaconID:")]
bool IsEqualToBeaconID (SBKBeaconID aBeaconID);
// @property (readonly, nonatomic) NSUuid * proximityUUID;
[Export ("proximityUUID")]
NSUuid ProximityUUID { get; }
// @property (readonly, nonatomic) NSNumber * major;
[Export ("major")]
NSNumber Major { get; }
// @property (readonly, nonatomic) NSNumber * minor;
[Export ("minor")]
NSNumber Minor { get; }
// -(CLBeaconRegion *)CLBeaconRegion;
[Export ("CLBeaconRegion")]
//[Verify (MethodToProperty)]
CLBeaconRegion CLBeaconRegion { get; }
// +(instancetype)beaconIDFromCLBeaconRegion:(CLBeaconRegion *)region;
[Static]
[Export ("beaconIDFromCLBeaconRegion:")]
SBKBeaconID BeaconIDFromCLBeaconRegion (CLBeaconRegion region);
// -(NSString *)stringRepresentation;
[Export ("stringRepresentation")]
//[Verify (MethodToProperty)]
string StringRepresentation { get; }
// +(instancetype)beaconIDWithString:(NSString *)string;
[Static]
[Export ("beaconIDWithString:")]
SBKBeaconID BeaconIDWithString (string @string);
}
// typedef void (^SBKBeaconCompletionBlock)(NSError *);
delegate void SBKBeaconCompletionBlock (NSError arg0);
// @interface SBKBeacon : NSObject
[BaseType (typeof(NSObject))]
interface SBKBeacon
{
[Wrap ("WeakDelegate")]
[NullAllowed]
SBKBeaconDelegate Delegate { get; set; }
// @property (readwrite, nonatomic, weak) id<SBKBeaconDelegate> _Nullable delegate;
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
NSObject WeakDelegate { get; set; }
// @property (readonly, copy, nonatomic) SBKBeaconID * beaconID;
[Export ("beaconID", ArgumentSemantic.Copy)]
SBKBeaconID BeaconID { get; }
// @property (readonly, copy, nonatomic) NSString * serialNumber;
[Export ("serialNumber")]
string SerialNumber { get; }
// @property (readonly, assign, nonatomic) BOOL inRange;
[Export ("inRange")]
bool InRange { get; }
// @property (assign, readwrite, nonatomic) NSInteger inRangeMinimumRssiWhileEntering;
[Export ("inRangeMinimumRssiWhileEntering")]
nint InRangeMinimumRssiWhileEntering { get; set; }
// @property (assign, readwrite, nonatomic) NSInteger inRangeMinimumRssiWhileLeaving;
[Export ("inRangeMinimumRssiWhileLeaving")]
nint InRangeMinimumRssiWhileLeaving { get; set; }
// @property (readonly, assign, nonatomic) NSInteger rssi;
[Export ("rssi")]
nint Rssi { get; }
// @property (readonly, assign, nonatomic) CLProximity proximity;
[Export ("proximity", ArgumentSemantic.Assign)]
CLProximity Proximity { get; }
// @property (readonly, nonatomic) CLLocationAccuracy accuracy;
[Export ("accuracy")]
double Accuracy { get; }
// @property (readonly, copy, nonatomic) NSNumber * batteryLevel;
[Export ("batteryLevel", ArgumentSemantic.Copy)]
NSNumber BatteryLevel { get; }
// @property (readonly, copy, nonatomic) NSString * hardwareModelName;
[Export ("hardwareModelName")]
string HardwareModelName { get; }
// @property (readonly, copy, nonatomic) NSString * firmwareVersion;
[Export ("firmwareVersion")]
string FirmwareVersion { get; }
// @property (readonly, nonatomic) SBKBeaconWorkMode workModel;
[Export ("workModel")]
SBKBeaconWorkMode WorkModel { get; }
// -(void)connectWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("connectWithCompletion:")]
void ConnectWithCompletion (SBKBeaconCompletionBlock completion);
// -(void)disconnect;
[Export ("disconnect")]
void Disconnect ();
// -(SBKBeaconConnectionStatus)connectionStatus;
[Export ("connectionStatus")]
//[Verify (MethodToProperty)]
SBKBeaconConnectionStatus ConnectionStatus { get; }
// @property (readonly, nonatomic) NSDictionary * baseSettings;
[Export ("baseSettings")]
NSDictionary BaseSettings { get; }
// @property (readonly, nonatomic) NSDictionary * sensorSettings;
[Export ("sensorSettings")]
NSDictionary SensorSettings { get; }
// @property (readonly, nonatomic) SBKBeaconSecureBroadcastInterval secureBroadcastInterval;
[Export ("secureBroadcastInterval")]
SBKBeaconSecureBroadcastInterval SecureBroadcastInterval { get; }
// -(BOOL)writeProximityUUID:(NSUuid *)proximityUUID completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeProximityUUID:completion:")]
bool WriteProximityUUID (NSUuid proximityUUID, SBKBeaconCompletionBlock completion);
// -(BOOL)writeMajor:(NSNumber *)major minor:(NSNumber *)minor completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeMajor:minor:completion:")]
bool WriteMajor (NSNumber major, NSNumber minor, SBKBeaconCompletionBlock completion);
// -(BOOL)writeBaseSettings:(NSDictionary *)settings completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeBaseSettings:completion:")]
bool WriteBaseSettings (NSDictionary settings, SBKBeaconCompletionBlock completion);
// -(BOOL)writeSensorSettings:(NSDictionary *)settings completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeSensorSettings:completion:")]
bool WriteSensorSettings (NSDictionary settings, SBKBeaconCompletionBlock completion);
// -(BOOL)resetToFactorySettingsWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("resetToFactorySettingsWithCompletion:")]
bool ResetToFactorySettingsWithCompletion (SBKBeaconCompletionBlock completion);
// -(BOOL)writeSecureBroadcastInterval:(SBKBeaconSecureBroadcastInterval)interval completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeSecureBroadcastInterval:completion:")]
bool WriteSecureBroadcastInterval (SBKBeaconSecureBroadcastInterval interval, SBKBeaconCompletionBlock completion);
// -(BOOL)writeBroadcastKey:(NSString *)key completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeBroadcastKey:completion:")]
bool WriteBroadcastKey (string key, SBKBeaconCompletionBlock completion);
// -(BOOL)clearBroadcastKeyWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("clearBroadcastKeyWithCompletion:")]
bool ClearBroadcastKeyWithCompletion (SBKBeaconCompletionBlock completion);
// -(BOOL)disableiBeaconWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("disableiBeaconWithCompletion:")]
bool DisableiBeaconWithCompletion (SBKBeaconCompletionBlock completion);
// -(BOOL)enableiBeaconWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("enableiBeaconWithCompletion:")]
bool EnableiBeaconWithCompletion (SBKBeaconCompletionBlock completion);
// -(BOOL)disableAliBeaconWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("disableAliBeaconWithCompletion:")]
bool DisableAliBeaconWithCompletion (SBKBeaconCompletionBlock completion);
// -(BOOL)enableAliBeaconWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("enableAliBeaconWithCompletion:")]
bool EnableAliBeaconWithCompletion (SBKBeaconCompletionBlock completion);
// -(BOOL)disableEnhanceBroadcastWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("disableEnhanceBroadcastWithCompletion:")]
bool DisableEnhanceBroadcastWithCompletion (SBKBeaconCompletionBlock completion);
// -(BOOL)enableEnhanceBroadcastWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("enableEnhanceBroadcastWithCompletion:")]
bool EnableEnhanceBroadcastWithCompletion (SBKBeaconCompletionBlock completion);
// -(BOOL)flashLightWithCommand:(UInt8)command repeat:(UInt8)repeatCount completion:(SBKBeaconCompletionBlock)completion;
[Export ("flashLightWithCommand:repeat:completion:")]
bool FlashLightWithCommand (byte command, byte repeatCount, SBKBeaconCompletionBlock completion);
// @property (readonly, nonatomic) SBKBeaconWritePermissionStatus writePermissionStatus;
[Export ("writePermissionStatus")]
SBKBeaconWritePermissionStatus WritePermissionStatus { get; }
// -(BOOL)requireWritePermissionWithPassword:(NSString *)password completion:(SBKBeaconCompletionBlock)completion;
[Export ("requireWritePermissionWithPassword:completion:")]
bool RequireWritePermissionWithPassword (string password, SBKBeaconCompletionBlock completion);
// -(BOOL)updateWritePassword:(NSString *)password completion:(SBKBeaconCompletionBlock)completion;
[Export ("updateWritePassword:completion:")]
bool UpdateWritePassword (string password, SBKBeaconCompletionBlock completion);
// -(BOOL)clearWritePasswordWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("clearWritePasswordWithCompletion:")]
bool ClearWritePasswordWithCompletion (SBKBeaconCompletionBlock completion);
// -(SBKBeaconEnergySavingMode)availableEnergySavingMode;
[Export ("availableEnergySavingMode")]
//[Verify (MethodToProperty)]
SBKBeaconEnergySavingMode AvailableEnergySavingMode { get; }
// -(BOOL)reloadSensorDataWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("reloadSensorDataWithCompletion:")]
bool ReloadSensorDataWithCompletion (SBKBeaconCompletionBlock completion);
// -(BOOL)isTemperatureSensorAvailable;
[Export ("isTemperatureSensorAvailable")]
//[Verify (MethodToProperty)]
bool IsTemperatureSensorAvailable { get; }
// -(BOOL)isLightSensorAvailable;
[Export ("isLightSensorAvailable")]
//[Verify (MethodToProperty)]
bool IsLightSensorAvailable { get; }
// -(BOOL)isAccelerometerAvailable;
[Export ("isAccelerometerAvailable")]
//[Verify (MethodToProperty)]
bool IsAccelerometerAvailable { get; }
// -(BOOL)isBeacon;
[Export ("isBeacon")]
//[Verify (MethodToProperty)]
bool IsBeacon { get; }
// -(BOOL)isSensor;
[Export ("isSensor")]
//[Verify (MethodToProperty)]
bool IsSensor { get; }
// @property (readonly, copy, nonatomic) NSNumber * temperature;
[Export ("temperature", ArgumentSemantic.Copy)]
NSNumber Temperature { get; }
// @property (readonly, copy, nonatomic) NSNumber * light;
[Export ("light", ArgumentSemantic.Copy)]
NSNumber Light { get; }
// @property (readonly, nonatomic) NSNumber * broadcastTransmitPower;
[Export ("broadcastTransmitPower")]
NSNumber BroadcastTransmitPower { get; }
// @property (readonly, nonatomic) NSNumber * broadcastInterval;
[Export ("broadcastInterval")]
NSNumber BroadcastInterval { get; }
// @property (readonly, nonatomic) NSNumber * inEnergySaving;
[Export ("inEnergySaving")]
NSNumber InEnergySaving { get; }
// @property (readonly, nonatomic) NSNumber * aliBeacon;
[Export ("aliBeacon")]
NSNumber AliBeacon { get; }
// @property (readonly, nonatomic) NSNumber * enhanceBroadcast;
[Export ("enhanceBroadcast")]
NSNumber EnhanceBroadcast { get; }
// @property (readonly, nonatomic) NSNumber * eddystoneEnabled;
[Export ("eddystoneEnabled")]
NSNumber EddystoneEnabled { get; }
// @property (readonly, copy, nonatomic) NSNumber * accelerometerCount;
[Export ("accelerometerCount", ArgumentSemantic.Copy)]
NSNumber AccelerometerCount { get; }
// @property (readonly, getter = isMoving, copy, nonatomic) NSNumber * moving;
[Export ("moving", ArgumentSemantic.Copy)]
NSNumber Moving { [Bind ("isMoving")] get; }
// @property (readonly, nonatomic) NSNumber * shakeToLightOn;
[Export ("shakeToLightOn")]
NSNumber ShakeToLightOn { get; }
// -(BOOL)resetAccelerometerCountWithCompletion:(SBKBeaconCompletionBlock)completion;
[Export ("resetAccelerometerCountWithCompletion:")]
bool ResetAccelerometerCountWithCompletion (SBKBeaconCompletionBlock completion);
// -(BOOL)writeShakeToLightOnState:(BOOL)state completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeShakeToLightOnState:completion:")]
bool WriteShakeToLightOnState (bool state, SBKBeaconCompletionBlock completion);
// @property (readonly, nonatomic, strong) CBPeripheral * assignedPeripheral;
[Export ("assignedPeripheral", ArgumentSemantic.Strong)]
CBPeripheral AssignedPeripheral { get; }
// @property (readonly, nonatomic) NSNumber * eddystoneUIDEnabled;
[Export ("eddystoneUIDEnabled")]
NSNumber EddystoneUIDEnabled { get; }
// @property (readonly, nonatomic) NSNumber * eddystoneURLEnabled;
[Export ("eddystoneURLEnabled")]
NSNumber EddystoneURLEnabled { get; }
// @property (readonly, nonatomic) NSNumber * eddystoneTLMEnabled;
[Export ("eddystoneTLMEnabled")]
NSNumber EddystoneTLMEnabled { get; }
// @property (readonly, nonatomic) NSData * eddystoneNID;
[Export ("eddystoneNID")]
NSData EddystoneNID { get; }
// @property (readonly, nonatomic) NSData * eddystoneBID;
[Export ("eddystoneBID")]
NSData EddystoneBID { get; }
// @property (readonly, nonatomic) NSNumber * eddystoneTLMInterval;
[Export ("eddystoneTLMInterval")]
NSNumber EddystoneTLMInterval { get; }
// @property (readonly, nonatomic) NSString * eddystoneUrl;
[Export ("eddystoneUrl")]
string EddystoneUrl { get; }
// @property (readonly, nonatomic) NSNumber * eddystoneBatteryVoltage;
[Export ("eddystoneBatteryVoltage")]
NSNumber EddystoneBatteryVoltage { get; }
// @property (readonly, nonatomic) NSNumber * eddystonePduCount;
[Export ("eddystonePduCount")]
NSNumber EddystonePduCount { get; }
// @property (readonly, nonatomic) NSNumber * eddystoneWorkedTime;
[Export ("eddystoneWorkedTime")]
NSNumber EddystoneWorkedTime { get; }
// -(BOOL)writeEddystoneUrl:(NSString *)url completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeEddystoneUrl:completion:")]
bool WriteEddystoneUrl (string url, SBKBeaconCompletionBlock completion);
// -(BOOL)eddystonePackage:(EddystonePackageType)package enable:(BOOL)enable completion:(SBKBeaconCompletionBlock)completion;
[Export ("eddystonePackage:enable:completion:")]
bool EddystonePackage (EddystonePackageType package, bool enable, SBKBeaconCompletionBlock completion);
// -(BOOL)writeEddystoneTLMInterval:(EddystoneTLMInterval)interval completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeEddystoneTLMInterval:completion:")]
bool WriteEddystoneTLMInterval (EddystoneTLMInterval interval, SBKBeaconCompletionBlock completion);
// -(BOOL)writeEddystoneNID:(NSString *)nidString completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeEddystoneNID:completion:")]
bool WriteEddystoneNID (string nidString, SBKBeaconCompletionBlock completion);
// -(BOOL)writeEddystoneBID:(NSString *)bidString completion:(SBKBeaconCompletionBlock)completion;
[Export ("writeEddystoneBID:completion:")]
bool WriteEddystoneBID (string bidString, SBKBeaconCompletionBlock completion);
}
// @protocol SBKBeaconDelegate <NSObject>
[Protocol, Model]
[BaseType (typeof(NSObject))]
interface SBKBeaconDelegate
{
// @optional -(void)sensoroBeaconDidConnect:(SBKBeacon *)beacon;
[Export ("sensoroBeaconDidConnect:")]
void SensoroBeaconDidConnect (SBKBeacon beacon);
// @optional -(void)sensoroBeaconRequirePassword:(SBKBeacon *)beacon;
[Export ("sensoroBeaconRequirePassword:")]
void SensoroBeaconRequirePassword (SBKBeacon beacon);
// @optional -(void)sensoroBeaconDidDisconnect:(SBKBeacon *)beacon error:(NSError *)error;
[Export ("sensoroBeaconDidDisconnect:error:")]
void SensoroBeaconDidDisconnect (SBKBeacon beacon, NSError error);
// @optional -(void)sensoroBeacon:(SBKBeacon *)beacon didUpdateSensorSetting:(NSDictionary *)settings;
[Export ("sensoroBeacon:didUpdateSensorSetting:")]
void SensoroBeaconDidUpdateSensorSetting (SBKBeacon beacon, NSDictionary settings);
// @optional -(void)sensoroBeacon:(SBKBeacon *)beacon didUpdateRSSI:(NSInteger)rssi;
[Export ("sensoroBeacon:didUpdateRSSI:")]
void SensoroBeaconDidUpdateRSSI (SBKBeacon beacon, nint rssi);
// @optional -(void)sensoroBeacon:(SBKBeacon *)beacon didUpdateTemperatureData:(NSNumber *)temperature;
[Export ("sensoroBeacon:didUpdateTemperatureData:")]
void SensoroBeaconDidUpdateTemperatureData (SBKBeacon beacon, NSNumber temperature);
// @optional -(void)sensoroBeacon:(SBKBeacon *)beacon didUpdateLightData:(NSNumber *)light;
[Export ("sensoroBeacon:didUpdateLightData:")]
void SensoroBeaconDidUpdateLightData (SBKBeacon beacon, NSNumber light);
// @optional -(void)sensoroBeacon:(SBKBeacon *)beacon didUpdateAccelerometerCount:(NSNumber *)accelerometerCount;
[Export ("sensoroBeacon:didUpdateAccelerometerCount:")]
void SensoroBeaconDidUpdateAccelerometerCount (SBKBeacon beacon, NSNumber accelerometerCount);
// @optional -(void)sensoroBeacon:(SBKBeacon *)beacon didUpdateMovingState:(NSNumber *)isMoving;
[Export ("sensoroBeacon:didUpdateMovingState:")]
void SensoroBeaconDidUpdateMovingState (SBKBeacon beacon, NSNumber isMoving);
}
// typedef void (^SBKBeaconWatcher)(SBKBeacon *, SBKBeacon_Action);
delegate void SBKBeaconWatcher (SBKBeacon arg0, SBKBeacon_Action arg1);
// @interface SBKBeaconManager : NSObject
[BaseType (typeof(NSObject))]
interface SBKBeaconManager
{
// +(SBKBeaconManager *)sharedInstance;
[Static]
[Export ("sharedInstance")]
//[Verify (MethodToProperty)]
SBKBeaconManager SharedInstance { get; }
[Wrap ("WeakDelegate")]
[NullAllowed]
SBKBeaconManagerDelegate Delegate { get; set; }
// @property (nonatomic, weak) id<SBKBeaconManagerDelegate> _Nullable delegate;
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
NSObject WeakDelegate { get; set; }
// -(void)requestAlwaysAuthorization;
[Export ("requestAlwaysAuthorization")]
void RequestAlwaysAuthorization ();
// -(void)requestWhenInUseAuthorization;
[Export ("requestWhenInUseAuthorization")]
void RequestWhenInUseAuthorization ();
// -(void)startRangingBeaconsWithID:(SBKBeaconID *)beaconID wakeUpApplication:(BOOL)wakeUpApplication;
[Export ("startRangingBeaconsWithID:wakeUpApplication:")]
void StartRangingBeaconsWithID (SBKBeaconID beaconID, bool wakeUpApplication);
// -(void)stopRangingBeaconsWithID:(SBKBeaconID *)beaconID;
[Export ("stopRangingBeaconsWithID:")]
void StopRangingBeaconsWithID (SBKBeaconID beaconID);
// -(void)stopRangingAllBeacons;
[Export ("stopRangingAllBeacons")]
void StopRangingAllBeacons ();
// -(BOOL)addBroadcastKey:(NSString *)secretInfo;
[Export ("addBroadcastKey:")]
bool AddBroadcastKey (string secretInfo);
// -(void)registerBeaconAppearWatcher:(NSString *)identifier type:(u_int8_t)type watcher:(SBKBeaconWatcher)watcher;
[Export ("registerBeaconAppearWatcher:type:watcher:")]
void RegisterBeaconAppearWatcher (string identifier, byte type, SBKBeaconWatcher watcher);
// -(NSSet *)rangedBeaconIDs;
[Export ("rangedBeaconIDs")]
//[Verify (MethodToProperty)]
NSSet RangedBeaconIDs { get; }
// -(SBKBeacon *)beaconWithID:(SBKBeaconID *)beaconID;
[Export ("beaconWithID:")]
SBKBeacon BeaconWithID (SBKBeaconID beaconID);
// -(SBKBeacon *)beaconWithCLBeacon:(CLBeacon *)beacon;
[Export ("beaconWithCLBeacon:")]
SBKBeacon BeaconWithCLBeacon (CLBeacon beacon);
// -(NSArray *)beaconsInRange;
[Export ("beaconsInRange")]
//[Verify (MethodToProperty), Verify (StronglyTypedNSArray)]
NSObject[] BeaconsInRange { get; }
// -(NSArray *)allBeacons;
[Export ("allBeacons")]
//[Verify (MethodToProperty), Verify (StronglyTypedNSArray)]
NSObject[] AllBeacons { get; }
// -(void)disableBLEPowerAlert;
[Export ("disableBLEPowerAlert")]
void DisableBLEPowerAlert ();
// @property (readwrite, nonatomic) NSTimeInterval outOfRangeDelay;
[Export ("outOfRangeDelay")]
double OutOfRangeDelay { get; set; }
// @property (readonly, nonatomic) NSString * version;
[Export ("version")]
string Version { get; }
// @property (readwrite, nonatomic) BOOL duplicateKeyBLE;
[Export ("duplicateKeyBLE")]
bool DuplicateKeyBLE { get; set; }
// -(void)setDebugModeActive:(BOOL)active;
[Export ("setDebugModeActive:")]
void SetDebugModeActive (bool active);
}
// @protocol SBKBeaconManagerDelegate <NSObject>
[Protocol, Model]
[BaseType (typeof(NSObject))]
interface SBKBeaconManagerDelegate
{
// @optional -(void)beaconManager:(SBKBeaconManager *)beaconManager didRangeNewBeacon:(SBKBeacon *)beacon;
[Export ("beaconManager:didRangeNewBeacon:")]
void DidRangeNewBeacon (SBKBeaconManager beaconManager, SBKBeacon beacon);
// @optional -(void)beaconManager:(SBKBeaconManager *)beaconManager beaconDidGone:(SBKBeacon *)beacon;
[Export ("beaconManager:beaconDidGone:")]
void BeaconDidGone (SBKBeaconManager beaconManager, SBKBeacon beacon);
// @optional -(void)beaconManager:(SBKBeaconManager *)beaconManager scanDidFinishWithBeacons:(NSArray *)beacons;
[Export ("beaconManager:scanDidFinishWithBeacons:")]
//[Verify (StronglyTypedNSArray)]
void ScanDidFinishWithBeacons (SBKBeaconManager beaconManager, NSObject[] beacons);
// @optional -(void)beaconManager:(SBKBeaconManager *)beaconManager didRangeBeacons:(NSArray *)beacons inRegion:(SBKBeaconID *)region;
[Export ("beaconManager:didRangeBeacons:inRegion:")]
//[Verify (StronglyTypedNSArray)]
void DidRangeBeacons (SBKBeaconManager beaconManager, NSObject[] beacons, SBKBeaconID region);
// @optional -(void)beaconManager:(SBKBeaconManager *)beaconManager didChangeAuthorizationStatus:(CLAuthorizationStatus)status;
[Export ("beaconManager:didChangeAuthorizationStatus:")]
void DidChangeAuthorizationStatus (SBKBeaconManager beaconManager, CLAuthorizationStatus status);
// @optional -(void)beaconManager:(SBKBeaconManager *)beaconManager didDetermineState:(SBKRegionState)state forRegion:(SBKBeaconID *)region;
[Export ("beaconManager:didDetermineState:forRegion:")]
void DidDetermineState (SBKBeaconManager beaconManager, SBKRegionState state, SBKBeaconID region);
}
// @interface Cloud (SBKBeaconManager)
[Category]
[BaseType (typeof(SBKBeaconManager))]
interface SBKBeaconManager_Cloud
{
// -(void)setCloudServiceEnable:(BOOL)set;
[Export ("setCloudServiceEnable:")]
void SetCloudServiceEnable (bool set);
}
// @interface SBKUnitConvertHelper : NSObject
[BaseType (typeof(NSObject))]
interface SBKUnitConvertHelper
{
// +(float)rangeRadiusOfBeacon:(SBKBeacon *)beacon;
[Static]
[Export ("rangeRadiusOfBeacon:")]
float RangeRadiusOfBeacon (SBKBeacon beacon);
// +(short)transmitPowerToRawValue:(SBKBeacon *)beacon;
[Static]
[Export ("transmitPowerToRawValue:")]
short TransmitPowerToRawValue (SBKBeacon beacon);
// +(float)frequencyToRawValue:(SBKBeacon *)beacon;
[Static]
[Export ("frequencyToRawValue:")]
float FrequencyToRawValue (SBKBeacon beacon);
// +(NSString *)transmitPowerToString:(SBKBeacon *)beacon;
[Static]
[Export ("transmitPowerToString:")]
string TransmitPowerToString (SBKBeacon beacon);
// +(NSString *)frequencyToString:(SBKBeacon *)beacon;
[Static]
[Export ("frequencyToString:")]
string FrequencyToString (SBKBeacon beacon);
// +(BOOL)isMicroTX:(SBKBeacon *)beacon;
[Static]
[Export ("isMicroTX:")]
bool IsMicroTX (SBKBeacon beacon);
// +(NSData *)urlToEddystoneEncodeURL:(NSString *)url;
[Static]
[Export ("urlToEddystoneEncodeURL:")]
NSData UrlToEddystoneEncodeURL (string url);
}
}
答案 0 :(得分:1)
尝试发表评论以使错误消失:
// extern NSUuid * SBKSensoroDefaultProximityUUID;
[Field ("SBKSensoroDefaultProximityUUID", "__Internal")]
NSUuid SBKSensoroDefaultProximityUUID { get; }
然后file a bug解决了问题。
答案 1 :(得分:1)
我绑定了该库,您可以将NSUuid
转换为IntPtr
,因为NSUuid
属性不支持extern NSUUID * SBKSensoroDefaultProximityUUID;
。
1st)查看标题def:
NSUuid
由于它是指向NSUuid的指针,因此您可以使用IntPtr,并将其作为字段属性支持。
第二次:将IntPtr
更改为ApiDefinition.cs
中的//// extern NSUuid * SBKSensoroDefaultProximityUUID;
[Field("SBKSensoroDefaultProximityUUID", "__Internal")]
IntPtr SBKSensoroDefaultProximityUUID { get; }
:
.cs
3nd)创建一个IntPtr
文件(即Field)来保存一个帮助器属性,将NSUuid
转换为using Foundation;
using ObjCRuntime;
namespace Sushi.Sensoro.BeaconKit
{
public class ConstantsEx
{
static NSUuid _SBKSensoroDefaultProximityUUID;
static public NSUuid SBKSensoroDefaultProximityUUID
{
get
{
if (_SBKSensoroDefaultProximityUUID == null)
{
var libUUID = Runtime.GetNSObject(Constants.SBKSensoroDefaultProximityUUID) as NSUuid;
_SBKSensoroDefaultProximityUUID = new NSUuid(libUUID.GetBytes());
}
return _SBKSensoroDefaultProximityUUID;
}
}
}
}
:< / p>
var _SBKSensoroDefaultProximityUUID = Sushi.Sensoro.BeaconKit.ConstantsEx.SBKSensoroDefaultProximityUUID;
Console.WriteLine(_SBKSensoroDefaultProximityUUID);
<强>用法:强>
<asp:DropDownList ID="DDLName" runat="server"
DataSourceID="DDLSource"
DataTextField="name"
DataValueField="name"
SelectedValue='<%# Bind("name") %>'>
</asp:DropDownList>
注意:此常数应为&#34; 23A01AF0-232A-4518-9C0E-323FB773F5EF&#34; (至少使用Sensoro SDK的4.1.3版本)