123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- //
- // MCDevice.h
- // MCKit
- //
- // Created by WengFei Wang on 21/05/2018
- // Copyright © 2018 WengFei Wang. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- NS_ASSUME_NONNULL_BEGIN
- /**
- Description For W311N only
- //you can use MPMusicPlayerController to make a simple music player or use AVFoundation or AVKit to make a better one
- - MCMediaStateMusicStart: start to play music
- - MCMediaStateMusicPause: pause play
- - MCMediaStateMusicContinue: continue play
- - MCMediaStateMusicStop: stop play music
- - MCMediaStateMusicSkipToNext: skip to next music
- - MCMediaStateMusicSkipToNextPrevious: skip to previous music
-
- //you can use you can use UIImagePickerController to make a camera or use AVFoundation to make a better one
- - MCMediaStateTakePicture: take picture
- - MCMediaStateStopTakePicture: stop take picture
-
- //Here you can remind user via play ringtone or vibration
- - MCMediaStateFindPhone : find phone
- */
- typedef NS_ENUM(NSUInteger, MCMediaState) {
- MCMediaStateMusicStart = 0,
- MCMediaStateMusicPause,
- MCMediaStateMusicContinue,
- MCMediaStateMusicStop,
- MCMediaStateMusicSkipToNext,
- MCMediaStateMusicSkipToNextPrevious,
-
- MCMediaStateTakePicture,
- MCMediaStateStopTakePicture,
-
- MCMediaStateFindPhone,
- };
- typedef NS_ENUM(NSInteger, MCDeviceType) {
- MCDeviceTypeW307N = 0x0100,
- MCDeviceTypeW311N = 0x0200,
- };
- /**
- MCDeviceDelegate Monitoring the state of Initialized Device
- */
- @protocol MCDeviceDelegate <NSObject>
- - (void)didInitializeDevice;
- @end
- @interface YAKDevice : NSObject
- /**
- peripheral.identifier.UUIDString
- */
- @property (nonatomic, readonly, copy) NSString *identifier;
- @property (nonatomic, copy) NSString *macString;
- /**
- peripheral name
- */
- @property (nonatomic, readonly, copy, nullable) NSString *name;
- /**
- peripheral localName
- */
- @property (nonatomic, copy, nullable) NSString *localName;
- /**
- discovered peripheral RSSI
- */
- @property (nonatomic, strong) NSNumber *discoveredRSSI;
- /**
- device battery Percentage
- */
- @property (nonatomic, readonly, assign) NSInteger batteryPercentage;
- /**
- device firmware Version
- */
- @property (nonatomic, readonly, copy) NSString *firmwareVersion;
- /**
- the state if peripheral
- */
- @property (nonatomic, readonly, assign, getter=isConnected) BOOL connected;
- /**
- the type of the device
- */
- @property (nonatomic, readonly, assign) MCDeviceType deviceType;
- /**
- is autoConnect?
- */
- @property (nonatomic, assign) BOOL autoConnect;
- @property (nonatomic, assign) BOOL hasVerificateConnect;
- @property (nonatomic, weak, nullable) id<MCDeviceDelegate>delegate;
- - (void)readRSSI:(void (^)(NSNumber *RSSINumber))response;
- @end
- NS_ASSUME_NONNULL_END
|