├── MYNT-SDK-IOS.podspec ├── MYNT-SDK-IOS ├── STConstants.h ├── STMynt.h ├── STMyntBluetooth.h ├── ios │ └── libSTMyntBluetooth.a └── osx │ └── libSTMyntBluetooth.a ├── README.MD ├── README_CN.MD ├── demo └── mynt-demo │ ├── Podfile │ ├── Podfile.lock │ ├── Pods │ ├── Headers │ │ ├── Private │ │ │ └── MYNT-SDK-IOS │ │ │ │ ├── STConstants.h │ │ │ │ ├── STMynt.h │ │ │ │ └── STMyntBluetooth.h │ │ └── Public │ │ │ └── MYNT-SDK-IOS │ │ │ ├── STConstants.h │ │ │ ├── STMynt.h │ │ │ └── STMyntBluetooth.h │ ├── Local Podspecs │ │ └── MYNT-SDK-IOS.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── gejw.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── Pods-mynt-ios-demo.xcscheme │ │ │ └── xcschememanagement.plist │ └── Target Support Files │ │ └── Pods-mynt-ios-demo │ │ ├── Pods-mynt-ios-demo-acknowledgements.markdown │ │ ├── Pods-mynt-ios-demo-acknowledgements.plist │ │ ├── Pods-mynt-ios-demo-dummy.m │ │ ├── Pods-mynt-ios-demo-frameworks.sh │ │ ├── Pods-mynt-ios-demo-resources.sh │ │ ├── Pods-mynt-ios-demo.debug.xcconfig │ │ └── Pods-mynt-ios-demo.release.xcconfig │ ├── mynt-ios-demo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── gejw.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── gejw.xcuserdatad │ │ └── xcschemes │ │ ├── mynt-ios-demo.xcscheme │ │ └── xcschememanagement.plist │ ├── mynt-ios-demo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── gejw.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ ├── mynt-ios-demo │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-60@2x.png │ │ │ ├── Icon-60@3x.png │ │ │ ├── Icon-Small@2x.png │ │ │ ├── Icon-Small@3x.png │ │ │ ├── Icon-Spotlight-40@2x.png │ │ │ └── Icon-Spotlight-40@3x.png │ │ ├── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ ├── 1.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ └── Contents.json │ │ ├── battery.imageset │ │ │ ├── Contents.json │ │ │ ├── battery.png │ │ │ ├── battery@2x.png │ │ │ └── battery@3x.png │ │ ├── debug_logo.imageset │ │ │ ├── Contents.json │ │ │ ├── udebug_logo.png │ │ │ ├── udebug_logo@2x.png │ │ │ └── udebug_logo@3x.png │ │ ├── mynt_gps_icon.imageset │ │ │ ├── Contents.json │ │ │ ├── homepage_gps@2x.png │ │ │ └── homepage_gps@3x.png │ │ ├── mynt_icon.imageset │ │ │ ├── Contents.json │ │ │ ├── homepage_mynt.png │ │ │ ├── homepage_mynt@2x.png │ │ │ └── homepage_mynt@3x.png │ │ └── 信号.imageset │ │ │ ├── Contents.json │ │ │ ├── 信号.png │ │ │ └── 信号@2x.png │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── MyntMainViewController.xib │ ├── Info.plist │ ├── MyntListViewController.swift │ ├── MyntListViewController.xib │ ├── MyntMainViewController.swift │ ├── MyntTableViewCell.swift │ ├── MyntTableViewCell.xib │ ├── SDKExtension.swift │ ├── String.swift │ ├── Toast.swift │ ├── en.lproj │ │ └── MyntMainViewController.strings │ ├── mynt-ios-demo-Bridging-Header.h │ └── zh-Hans.lproj │ │ ├── LaunchScreen.strings │ │ └── MyntMainViewController.strings │ └── mynt-osx-demo │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ └── MainMenu.xib │ ├── Info.plist │ ├── mynt-osx-demo-Bridging-Header.h │ └── zh-Hans.lproj │ └── MainMenu.strings └── doc ├── readme_cn.md ├── readme_cn_1.md ├── readme_cn_2.md ├── readme_cn_3.md ├── readme_cn_install.md ├── readme_en.md ├── readme_en_1.md ├── readme_en_2.md ├── readme_en_3.md └── readme_en_install.md /MYNT-SDK-IOS.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "MYNT-SDK-IOS" 4 | s.version = "3.0.0" 5 | s.summary = "Slightech's Mynt BLE SDK for iOS & OSX" 6 | s.homepage = 'https://github.com/slightech/MYNT-SDK-IOS' 7 | s.author = { 'robinge' => 'robinge@slightech.com' } 8 | s.license = { :type => 'Copyright', :text => 'LICENSE Copyright 2014 - 2017 Slightech.com, Inc. All rights reserved.' } 9 | s.source = { :git => 'https://github.com/slightech/MYNT-SDK-IOS.git', :tag => "#{s.version}"} 10 | 11 | s.ios.deployment_target = '7.0' 12 | s.ios.preserve_path = 'MYNT-SDK-IOS/ios/libSTMyntBluetooth.a' 13 | s.ios.vendored_libraries = 'MYNT-SDK-IOS/ios/libSTMyntBluetooth.a' 14 | s.ios.frameworks = 'CoreBluetooth' 15 | 16 | s.osx.deployment_target = '10.9' 17 | s.osx.preserve_path = 'MYNT-SDK-IOS/osx/libSTMyntBluetooth.a' 18 | s.osx.vendored_libraries = 'MYNT-SDK-IOS/osx/libSTMyntBluetooth.a' 19 | s.osx.frameworks = 'CoreBluetooth' 20 | 21 | s.source_files = 'MYNT-SDK-IOS/*.h' 22 | 23 | s.requires_arc = true 24 | s.library = 'sqlite3' 25 | s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => '"$(PODS_ROOT)/MYNT-SDK-IOS/MYNT-SDK-IOS/**"' } 26 | 27 | end 28 | -------------------------------------------------------------------------------- /MYNT-SDK-IOS/STConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // STConstants.h 3 | // STMyntBluetooth 4 | // 5 | // Created by gejw on 16/6/1. 6 | // Copyright © 2016年 Slightech. All rights reserved. 7 | // 8 | 9 | #ifndef STConstants_h 10 | #define STConstants_h 11 | 12 | #if TARGET_OS_IOS 13 | #import 14 | #import 15 | #else 16 | #import 17 | #import 18 | #endif 19 | 20 | #define mynt_deprecated __attribute__((deprecated("deprecated and will be removed in the feture"))) 21 | 22 | typedef NS_ENUM(NSInteger, MYNTClickValue) { 23 | // if you set the values below, [mynt:didReceiveClickEvent:] will not invoked when you click mynt 24 | MYNTClickValueNone = 0x00, 25 | MYNTClickValueMusicPlay = 0x01, 26 | MYNTClickValueMusicNext = 0x02, 27 | MYNTClickValueMusicPrevious = 0x03, 28 | MYNTClickValueMusicVolumeUp = 0x04, 29 | MYNTClickValueMusicVolumeDown = 0x05, 30 | MYNTClickValueCameraShutter = 0x09, 31 | MYNTClickValueCameraBurst = 0x0A, 32 | MYNTClickValuePPTNextPage = 0x06, 33 | MYNTClickValuePPTPreviousPage = 0x07, 34 | MYNTClickValuePPTExit = 0x08, 35 | 36 | // if you set the values below, [mynt:didReceiveClickEvent:] will be invoked when you click mynt 37 | MYNTClickValuePhoneFlash = 0xA0, 38 | MYNTClickValuePhoneAlarm = 0xA1, 39 | MYNTClickValueAskHelp = 0xA3, 40 | MYNTClickValueCustomClick = 0xB0 41 | }; 42 | 43 | typedef NS_ENUM(NSInteger, MYNTClickEvent) { 44 | MYNTClickEventClick = 0x01, 45 | MYNTClickEventDoubleClick = 0x02, 46 | MYNTClickEventTripleClick = 0x03, 47 | MYNTClickEventHold = 0x09, 48 | MYNTClickEventClickHold = 0x10, 49 | MYNTClickEventPhoneFlash = 0xA0, 50 | MYNTClickEventPhoneAlarm = 0xA1, 51 | MYNTClickEventPhoneAlarmOff = 0xA2 52 | }; 53 | 54 | typedef NS_ENUM(NSInteger, MYNTInfoType) { 55 | MYNTInfoTypeManufaturer = 0x00, 56 | MYNTInfoTypeModel, 57 | MYNTInfoTypeSn, 58 | MYNTInfoTypeFirmware, 59 | MYNTInfoTypeHardware, 60 | MYNTInfoTypeSoftware, 61 | }; 62 | 63 | typedef NS_ENUM(NSInteger, MYNTHardwareType) { 64 | MYNTHardwareTypeNone = 0xFF, 65 | MYNTHardwareTypeMYNTV1 = 0x00, 66 | MYNTHardwareTypeMYNTV2 = 0x01, 67 | MYNTHardwareTypeMYNTGPS = 0x02 68 | }; 69 | 70 | typedef NS_ENUM(NSInteger, MYNTState) { 71 | MYNTStateDisconnected = 0x00, 72 | MYNTStateStartConnecting, 73 | MYNTStateConnecting, 74 | MYNTStateConnected, 75 | }; 76 | 77 | #endif /* STConstants_h */ 78 | 79 | // MARK: =======================STMyntBluetoothDelegate======================= 80 | @class STMyntBluetooth, STMynt, STPeripheral; 81 | 82 | @protocol STMyntBluetoothDelegate 83 | 84 | @optional 85 | 86 | /** 87 | * Invoked when the central manager's state has been updated. 88 | * 89 | * @param myntBluetooth 90 | * @param state the current state of the bluetooth 91 | */ 92 | - (void)myntBluetooth:(STMyntBluetooth * _Nonnull)myntBluetooth didUpdateState:(CBCentralManagerState)state; 93 | 94 | /** 95 | * Invoked when the mynt has been discoverd. 96 | * 97 | * @param myntBluetooth 98 | * @param mynt 99 | */ 100 | - (void)myntBluetooth:(STMyntBluetooth * _Nonnull)myntBluetooth didDiscoverMynt:(STMynt * _Nonnull)mynt; 101 | 102 | /** 103 | * Invoked when the mynt has been discoverd timeout. 104 | * 105 | * @param myntBluetooth 106 | * @param mynt 107 | */ 108 | - (void)myntBluetooth:(STMyntBluetooth * _Nonnull)myntBluetooth didDiscoverTimeoutMynt:(STMynt * _Nonnull)mynt; 109 | 110 | /** 111 | * Invoked if sdk print log. 112 | * 113 | * @param myntBluetooth 114 | * @param sn the sn of the mynt when the mynt is discoverd. 115 | * 116 | * @return if this mynt need filter(don't ues it), so you can need true. 117 | */ 118 | - (void)myntBluetooth:(STMyntBluetooth * _Nonnull)myntBluetooth didPrintLog:(NSString * _Nonnull)log; 119 | 120 | @end 121 | 122 | // MARK: =======================STMyntDelegate======================= 123 | 124 | @protocol STMyntDelegate 125 | 126 | @optional 127 | 128 | /** 129 | * Invoked when the mynt has started to connect 130 | * 131 | * @param mynt 132 | */ 133 | - (void)myntDidStartConnect:(STMynt * _Nonnull)mynt; 134 | 135 | /** 136 | * Invoked when a connection initiated has succeeded 137 | * 138 | * @param mynt 139 | */ 140 | - (void)myntDidConnected:(STMynt * _Nonnull)mynt; 141 | 142 | /** 143 | * Invoked when a connection has been disconnected 144 | * 145 | * @param mynt 146 | * @param error 147 | */ 148 | - (void)mynt:(STMynt * _Nonnull)mynt didDisconnected:(NSError * _Nullable)error; 149 | 150 | /** 151 | * Invoked when the rssi of the mynt has been updated. 152 | * 153 | * @param mynt 154 | * @param RSSI the rssi of the mynt 155 | */ 156 | - (void)mynt:(STMynt * _Nonnull)mynt didUpdateRSSI:(NSInteger)RSSI; 157 | 158 | /** 159 | * Invoked when the battery of the mynt has been updated. 160 | * 161 | * @param mynt 162 | * @param battery the battery of the mynt 163 | */ 164 | - (void)mynt:(STMynt * _Nonnull)mynt didUpdateBattery:(NSArray * _Nonnull)batteries; 165 | 166 | /** 167 | * Invoked when the alarm state of the mynt has been updated. 168 | * 169 | * @param mynt 170 | * @param alarmState the alarm state of the mynt 171 | */ 172 | - (void)mynt:(STMynt * _Nonnull)mynt didUpdateAlarmState:(BOOL)isAlarm; 173 | 174 | /** 175 | * Invoked when the mynt is clicked 176 | * 177 | * @param mynt 178 | * @param clickEvent the click type of the event (e.g. Click or Double Click) 179 | */ 180 | - (void)mynt:(STMynt * _Nonnull)mynt didReceiveClickEvent:(MYNTClickEvent)clickEvent; 181 | 182 | /** 183 | * Request the state if the mynt need autoconnect or not 184 | * 185 | * @param mynt 186 | * 187 | * @return is need autoconnect ? 188 | */ 189 | - (BOOL)didRequestAutoconnect:(STMynt * _Nonnull)mynt; 190 | 191 | /** 192 | * Invoked when the connection exception 193 | * 194 | * @param mynt 195 | */ 196 | - (void)didNeedRestartBluetooth:(STMynt * _Nonnull)mynt; 197 | 198 | @end 199 | 200 | -------------------------------------------------------------------------------- /MYNT-SDK-IOS/STMynt.h: -------------------------------------------------------------------------------- 1 | // 2 | // STMynt.h 3 | // STMyntCoreBluetooth 4 | // 5 | // Created by gejw on 15/10/27. 6 | // Copyright © 2015年 Slightech, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "STConstants.h" 11 | 12 | @interface STMynt : NSObject 13 | 14 | @property (nonatomic, weak, nullable) id delegate; 15 | 16 | // The name of the mynt 17 | @property (nonatomic, strong, readonly, nonnull) NSString *name; 18 | // The current RSSI of peripheral, in dBm. A value of 127is reserved and indicates the RSSI 19 | @property (nonatomic, assign, readonly) NSInteger RSSI; 20 | // Battery of the mynt 21 | @property (nonatomic, assign, readonly) NSInteger battery; 22 | // Flag to determine the mynt is discovering or not 23 | @property (nonatomic, assign, readonly) BOOL isDiscovering; 24 | // HardwareType (MYNTV1 | MYNTV2 | MYNTGPS ) 25 | @property (nonatomic, assign, readonly) MYNTHardwareType hardwareType; 26 | // The current connection state of the mynt 27 | @property (nonatomic, assign, readonly) MYNTState state; 28 | // The current connection state of the mynt 29 | @property (nonatomic, assign, readonly) BOOL isAlarm; 30 | 31 | // The running mode of the mynt 32 | @property (nonatomic, assign, readonly) BOOL isHIDMode; 33 | // Event of the click type 34 | @property (nonatomic, assign, readonly) MYNTClickValue click; 35 | // Event of the double click type 36 | @property (nonatomic, assign, readonly) MYNTClickValue doubleClick; 37 | // Event of the triple click type 38 | @property (nonatomic, assign, readonly) MYNTClickValue tripleClick; 39 | // Event of the long press type 40 | @property (nonatomic, assign, readonly) MYNTClickValue hold; 41 | // Event of the click + long press type 42 | @property (nonatomic, assign, readonly) MYNTClickValue clickHold; 43 | 44 | # pragma mynt info 45 | // manufaturer of the mynt 46 | @property (nonatomic, strong, readonly, nullable) NSString *manufaturer; 47 | // Model of the mynt 48 | @property (nonatomic, strong, readonly, nullable) NSString *model; 49 | // SN of the mynt 50 | @property (nonatomic, strong, readonly, nonnull) NSString *sn; 51 | // Firmware of the mynt 52 | @property (nonatomic, strong, readonly, nullable) NSString *firmware; 53 | // Hardware of the mynt 54 | @property (nonatomic, strong, readonly, nullable) NSString *hardware; 55 | // Software of the mynt 56 | @property (nonatomic, strong, readonly, nullable) NSString *software; 57 | // MAC address of the mynt 58 | @property (nonatomic, strong, readonly, nullable) NSString *mac; 59 | 60 | /** 61 | * Connect mynt 62 | */ 63 | - (void)connect; 64 | 65 | /** 66 | * Disconnect mynt 67 | */ 68 | - (void)disconnect; 69 | 70 | /** 71 | * Alarm mynt or not (alarm will alarm 40s) 72 | * 73 | * @param alarm alarm or stop 74 | */ 75 | - (void)toggleAlarm:(BOOL)alarm 76 | handler:(void(^ _Nullable)(NSError * _Nullable error))handler; 77 | 78 | /** 79 | * Set how many times MYNT will alarm after the bluetooth connection broken 80 | * 81 | * @param count alarm times 82 | */ 83 | - (void)writeAlarmCount:(NSInteger)count 84 | handler:(void(^ _Nullable)(NSError * _Nullable error))handler; 85 | 86 | /** 87 | * Set how long the alarm will be delayed after the bluetooth connection broken 88 | * 89 | * @param seconds delay time(units: second) 90 | */ 91 | - (void)writeAlarmDelay:(NSInteger)seconds 92 | handler:(void(^ _Nullable)(NSError * _Nullable error))handler; 93 | 94 | /** 95 | * Set the custom click types of the mynt 96 | * 97 | * @param click click 98 | * @param doubleClick double click 99 | * @param tripleClick triple click 100 | * @param hold long press 101 | * @param clickHold click + long press 102 | */ 103 | - (void)writeClickValue:(BOOL)isHIDMode 104 | click:(MYNTClickValue)click 105 | doubleClick:(MYNTClickValue)doubleClick 106 | tripleClick:(MYNTClickValue)tripleClick 107 | hold:(MYNTClickValue)hold 108 | clickHold:(MYNTClickValue)clickHold 109 | handler:(void(^ _Nullable)(NSError * _Nullable error))handler; 110 | 111 | /** 112 | * Read the battery state of the mynt 113 | * 114 | * @param success 115 | * @param failure 116 | */ 117 | - (void)readBattery:(void (^ _Nullable)(NSArray * _Nonnull batteries))success 118 | failure:(void(^ _Nullable)(NSError * _Nullable error))failure; 119 | 120 | /** 121 | * Read the rssi of the mynt 122 | */ 123 | - (void)readRSSI:(void(^ _Nullable)(NSError * _Nullable error))handler; 124 | 125 | /** 126 | * Read the custom click types of the mynt 127 | * 128 | * @param success 129 | * @param failure 130 | */ 131 | - (void)readClickValue:(void(^ _Nullable)(MYNTClickValue click, 132 | MYNTClickValue doubleClick, 133 | MYNTClickValue tripleClick, 134 | MYNTClickValue hold, 135 | MYNTClickValue clickHold))success 136 | failure:(void(^ _Nullable)(NSError * _Nullable error))failure; 137 | 138 | /** 139 | * Update the firmware of the mynt 140 | * 141 | * @param 142 | */ 143 | - (void)updateFirmware:(NSData * _Nullable (^ _Nullable)())start 144 | progress:(void (^ _Nullable)(CGFloat))progress 145 | success:(void (^ _Nullable)())success 146 | failure:(void (^ _Nullable)(NSError * _Nullable error))failure; 147 | 148 | /** 149 | * Set the ringtone data of the mynt 150 | * 151 | * @param data 152 | * @param version 153 | * @param handler 154 | * 155 | **/ 156 | - (void)writeRingtone:(NSData * _Nonnull)data 157 | version:(int)version 158 | handler:(void(^ _Nullable)(NSError * _Nullable error))handler; 159 | 160 | /** 161 | * Read the version of the ringtone in mynt 162 | * 163 | * @param handler 164 | * 165 | **/ 166 | - (void)readRingtoneVersion:(void (^ _Nullable)(NSInteger version, NSError * _Nullable error))handler; 167 | 168 | @end 169 | 170 | // MARK: - GPS 171 | @interface STMynt (MYNT_GPS) 172 | 173 | /** 174 | * Synchronised time (for GPS) 175 | * 176 | * @param complete 177 | */ 178 | - (void)syncTime:(void (^ _Nullable)(NSError * _Nullable))handler; 179 | 180 | /** 181 | * Turn off the mynt (for GPS) 182 | * 183 | * @param complete 184 | */ 185 | - (void)shutdown:(void (^ _Nullable)(NSError * _Nullable error))handler; 186 | 187 | /** 188 | * Set the apn of the mynt (for GPS) 189 | * 190 | * @param apn 191 | * @param handler 192 | */ 193 | - (void)writeAPN:(NSString * _Nonnull)apn 194 | handler:(void (^ _Nullable)(NSError * _Nullable error))handler; 195 | 196 | /** 197 | * Set the locate interval of the mynt (for GPS) 198 | * 199 | * @param minute 200 | * @param handler 201 | */ 202 | - (void)writeLocateInterval:(NSInteger)minute 203 | handler:(void (^ _Nullable)(NSError * _Nullable error))handler; 204 | 205 | /** 206 | * Read the locate interval of the mynt (for GPS) 207 | * 208 | * @param handler 209 | */ 210 | - (void)readLocateInterval:(void (^ _Nullable)(NSInteger interval, NSError * _Nullable error))handler; 211 | 212 | /** 213 | * Read the iccid of the sim card 214 | * 215 | * @param handler (for GPS) 216 | */ 217 | - (void)readICCID:(void (^ _Nullable)(NSString * _Nullable iccic, NSError * _Nullable error))handler; 218 | 219 | /** 220 | * Check the state of the sim card 221 | * 222 | * @param handler (for GPS) 223 | */ 224 | - (void)checkNetwork:(void (^ _Nullable)(NSError * _Nullable))handler; 225 | 226 | @end 227 | -------------------------------------------------------------------------------- /MYNT-SDK-IOS/STMyntBluetooth.h: -------------------------------------------------------------------------------- 1 | // 2 | // STMyntBluetooth.h 3 | // STMyntCoreBluetooth 4 | // 5 | // Created by gejw on 16/3/25. 6 | // Copyright © 2016年 Slightech, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "STMynt.h" 11 | 12 | @interface STMyntBluetooth : NSObject 13 | // Flag to determine if the manager is scanning 14 | @property (nonatomic, assign, readonly) BOOL isScanning; 15 | // The current state of the bluetooth 16 | @property (nonatomic, assign, readonly) CBCentralManagerState centralState; 17 | // Help others find the mynt 18 | @property (nonatomic, assign) BOOL isReportUnknownMynt; 19 | // Delegate 20 | @property (nonatomic, weak, nullable) id delegate; 21 | 22 | + (instancetype _Nonnull)sharedInstance; 23 | 24 | /** 25 | * Set the AppKey 26 | * 27 | * @param appKey 28 | */ 29 | - (void)setMyntAppKey:(NSString * _Nonnull)appKey; 30 | 31 | /** 32 | * The params will upload when uploading the found devices 33 | * 34 | * @param params Customize parameters 35 | */ 36 | - (void)setCustomParams:(NSString * _Nullable)params; 37 | 38 | /** 39 | * Start scanning for mynts. 40 | * 41 | * @param block 42 | */ 43 | - (void)startScan; 44 | 45 | /** 46 | * Stop scanning for mynts. 47 | */ 48 | - (void)stopScan; 49 | 50 | /** 51 | * get the mynt with sn 52 | * 53 | * @param sn the sn of the mynt 54 | * 55 | * @return 56 | */ 57 | - (STMynt * _Nullable)findMyntWithSn:(NSString *_Nonnull)sn; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /MYNT-SDK-IOS/ios/libSTMyntBluetooth.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/MYNT-SDK-IOS/ios/libSTMyntBluetooth.a -------------------------------------------------------------------------------- /MYNT-SDK-IOS/osx/libSTMyntBluetooth.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/MYNT-SDK-IOS/osx/libSTMyntBluetooth.a -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | 2 | 3 | ![](https://raw.githubusercontent.com/slightech/MYNT-SDK-Android/master/static/slide_mynt.png) 4 | 5 | 6 | [MYNT]: https://mynt.slightech.com/ 7 | 8 | # MYNT SDK 9 | 10 | The SDK to help developers to search and control MYNTs conveniently. 11 | 12 | * Listen the MYNTs connect state, do scan, connect, disconnect etc. 13 | * Set the MYNTs click events with HID or custom actions to control music, camera, PPT etc. 14 | 15 | ## What is [MYNT][] 16 | 17 | MYNT is a thinnest smart tracker, only 1/8 inch. Easy to fit in a wallet, attach to a keychain, or affix to a laptop or a TV remote. 18 | 19 | MYNT is a most exquisite smart tracker, processed with PVD technology on stainless steel with frosting or polishing. Four colors are optional: Silver, Black, Gold, and Blue. 20 | 21 | ![](https://raw.githubusercontent.com/slightech/MYNT-SDK-Android/master/static/colorful.png) 22 | 23 | MYNT is not just a smart tracker, can also become your everyday smart companion. In addition to anti-loss and finder capability, MYNT can also act the following really cool utilities: 24 | 25 | * Remote shutter: Free your hand, release your passion. 26 | * Music remoter: Control freely, enjoy your music. 27 | * Slide remoter: Control freely, facilitate efficiency. 28 | 29 | ![](https://raw.githubusercontent.com/slightech/MYNT-SDK-Android/master/static/slide-ctr-photo.png) 30 | 31 | MYNT - No lost, all found, control everything. 32 | 33 | - Website: https://mynt.slightech.com 34 | - Purchase: https://www.amazon.com/dp/B017QML97W 35 | 36 | --- 37 | ###[中文介绍](README_CN.MD) 38 | --- 39 | 40 | [![CocoaPods](http://img.shields.io/cocoapods/v/MYNT-SDK-IOS.svg?style=flat)](http://cocoapods.org/?q=MYNT-SDK-IOS)  41 | [![CocoaPods](http://img.shields.io/cocoapods/p/MYNT-SDK-IOS.svg?style=flat)](http://cocoapods.org/?q=MYNT-SDK-IOS)  42 | [![Support](https://img.shields.io/badge/support-iOS%207%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)  43 | [![Support](https://img.shields.io/badge/support-osx%2010.9%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)  44 | 45 | ### [------> How To Use??](doc/readme_en_install.md) 46 | ### [------> 何如使用??](doc/readme_cn_install.md) 47 | -------------------------------------------------------------------------------- /README_CN.MD: -------------------------------------------------------------------------------- 1 | 2 | ![](https://raw.githubusercontent.com/slightech/MYNT-SDK-Android/master/static/slide_mynt.png) 3 | 4 | [MYNT]: https://mynt.slightech.com/ 5 | 6 | # MYNT SDK 7 | 8 | MYNT SDK 用于帮助开发者更快得实现小觅的搜索和控制。 9 | 10 | * 监听小觅连接状态,操作扫描、连接、断开等。 11 | * 设定小觅单双击等行为,HID或自定义,控制音乐、相机、PPT等。 12 | 13 | ## [小觅][MYNT] 是什么? 14 | 15 | 小觅是一款超薄的智能防丢器,厚度仅0.35cm,轻松挂在钥匙,夹在钱包,放进行李,贴在物品表面。 16 | 17 | 小觅是一款超酷的智能防丢器,采用不锈钢PVD工艺,镜面或磨砂,银黑金蓝四色可选,独有外观专利。 18 | 19 | ![](https://raw.githubusercontent.com/slightech/MYNT-SDK-Android/master/static/colorful.png) 20 | 21 | 小觅防丢,人狗不丢:双向寻物、社区找回、携手公益。 22 | 23 | 小觅不只是防丢器,更是生活好伴侣:放手自拍、随心切歌、遥控PPT。 24 | 25 | ![](https://raw.githubusercontent.com/slightech/MYNT-SDK-Android/master/static/slide-ctr-photo.png) 26 | 27 | - 官网:http://mynt.slightech.com/cn 28 | - 购买:https://xiaomishuma.tmall.com/ 29 | -------------------------------------------------------------------------------- /demo/mynt-demo/Podfile: -------------------------------------------------------------------------------- 1 | #target 'mynt-osx-demo' do 2 | # platform :osx, '10.9' 3 | # pod 'MYNT-SDK-IOS' 4 | #end 5 | target 'mynt-ios-demo' do 6 | platform :ios, '7.0' 7 | 8 | pod 'MYNT-SDK-IOS', :path=>"../../" 9 | 10 | pod 'CRToast' 11 | 12 | end 13 | -------------------------------------------------------------------------------- /demo/mynt-demo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CRToast (0.0.9) 3 | - MYNT-SDK-IOS (3.0.0) 4 | 5 | DEPENDENCIES: 6 | - CRToast 7 | - MYNT-SDK-IOS (from `../../`) 8 | 9 | EXTERNAL SOURCES: 10 | MYNT-SDK-IOS: 11 | :path: "../../" 12 | 13 | SPEC CHECKSUMS: 14 | CRToast: 5a78c22b921c5ed3487488af605bc403a9c92fed 15 | MYNT-SDK-IOS: 4904bc8b7cd96e988ffb8b07c4f41b985904256c 16 | 17 | PODFILE CHECKSUM: 4269be60eba3e0e5d613092cc3c39544f238ec15 18 | 19 | COCOAPODS: 1.2.0 20 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Headers/Private/MYNT-SDK-IOS/STConstants.h: -------------------------------------------------------------------------------- 1 | ../../../../../../MYNT-SDK-IOS/STConstants.h -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Headers/Private/MYNT-SDK-IOS/STMynt.h: -------------------------------------------------------------------------------- 1 | ../../../../../../MYNT-SDK-IOS/STMynt.h -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Headers/Private/MYNT-SDK-IOS/STMyntBluetooth.h: -------------------------------------------------------------------------------- 1 | ../../../../../../MYNT-SDK-IOS/STMyntBluetooth.h -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Headers/Public/MYNT-SDK-IOS/STConstants.h: -------------------------------------------------------------------------------- 1 | ../../../../../../MYNT-SDK-IOS/STConstants.h -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Headers/Public/MYNT-SDK-IOS/STMynt.h: -------------------------------------------------------------------------------- 1 | ../../../../../../MYNT-SDK-IOS/STMynt.h -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Headers/Public/MYNT-SDK-IOS/STMyntBluetooth.h: -------------------------------------------------------------------------------- 1 | ../../../../../../MYNT-SDK-IOS/STMyntBluetooth.h -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Local Podspecs/MYNT-SDK-IOS.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MYNT-SDK-IOS", 3 | "version": "3.0.0", 4 | "summary": "Slightech's Mynt BLE SDK for iOS & OSX", 5 | "homepage": "https://github.com/slightech/MYNT-SDK-IOS", 6 | "authors": { 7 | "robinge": "robinge@slightech.com" 8 | }, 9 | "license": { 10 | "type": "Copyright", 11 | "text": "LICENSE Copyright 2014 - 2017 Slightech.com, Inc. All rights reserved." 12 | }, 13 | "source": { 14 | "git": "https://github.com/slightech/MYNT-SDK-IOS.git", 15 | "tag": "3.0.0" 16 | }, 17 | "platforms": { 18 | "ios": "7.0", 19 | "osx": "10.9" 20 | }, 21 | "ios": { 22 | "preserve_paths": "MYNT-SDK-IOS/ios/libSTMyntBluetooth.a", 23 | "vendored_libraries": "MYNT-SDK-IOS/ios/libSTMyntBluetooth.a", 24 | "frameworks": "CoreBluetooth" 25 | }, 26 | "osx": { 27 | "preserve_paths": "MYNT-SDK-IOS/osx/libSTMyntBluetooth.a", 28 | "vendored_libraries": "MYNT-SDK-IOS/osx/libSTMyntBluetooth.a", 29 | "frameworks": "CoreBluetooth" 30 | }, 31 | "source_files": "MYNT-SDK-IOS/*.h", 32 | "requires_arc": true, 33 | "libraries": "sqlite3", 34 | "xcconfig": { 35 | "LIBRARY_SEARCH_PATHS": "\"$(PODS_ROOT)/MYNT-SDK-IOS/MYNT-SDK-IOS/**\"" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CRToast (0.0.9) 3 | - MYNT-SDK-IOS (3.0.0) 4 | 5 | DEPENDENCIES: 6 | - CRToast 7 | - MYNT-SDK-IOS (from `../../`) 8 | 9 | EXTERNAL SOURCES: 10 | MYNT-SDK-IOS: 11 | :path: "../../" 12 | 13 | SPEC CHECKSUMS: 14 | CRToast: 5a78c22b921c5ed3487488af605bc403a9c92fed 15 | MYNT-SDK-IOS: 4904bc8b7cd96e988ffb8b07c4f41b985904256c 16 | 17 | PODFILE CHECKSUM: 4269be60eba3e0e5d613092cc3c39544f238ec15 18 | 19 | COCOAPODS: 1.2.0 20 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Pods.xcodeproj/xcuserdata/gejw.xcuserdatad/xcschemes/Pods-mynt-ios-demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Pods.xcodeproj/xcuserdata/gejw.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CRToast.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-mynt-ios-demo.xcscheme 13 | 14 | isShown 15 | 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 47CF347476C0B0C692B3C622221B3E04 21 | 22 | primary 23 | 24 | 25 | AF44C83DC805A0B8A875203B49D73706 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## CRToast 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2013 Cezary Wojcik 9 | Copyright (c) 2014 Collin Ruffenach 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in 19 | all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | THE SOFTWARE. 28 | 29 | 30 | ## MYNT-SDK-IOS 31 | 32 | LICENSE Copyright 2014 - 2017 Slightech.com, Inc. All rights reserved. 33 | Generated by CocoaPods - https://cocoapods.org 34 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2013 Cezary Wojcik <http://www.cezarywojcik.com> 20 | Copyright (c) 2014 Collin Ruffenach 21 | 22 | Permission is hereby granted, free of charge, to any person obtaining a copy 23 | of this software and associated documentation files (the "Software"), to deal 24 | in the Software without restriction, including without limitation the rights 25 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 26 | copies of the Software, and to permit persons to whom the Software is 27 | furnished to do so, subject to the following conditions: 28 | 29 | The above copyright notice and this permission notice shall be included in 30 | all copies or substantial portions of the Software. 31 | 32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 38 | THE SOFTWARE. 39 | 40 | License 41 | MIT 42 | Title 43 | CRToast 44 | Type 45 | PSGroupSpecifier 46 | 47 | 48 | FooterText 49 | LICENSE Copyright 2014 - 2017 Slightech.com, Inc. All rights reserved. 50 | License 51 | Copyright 52 | Title 53 | MYNT-SDK-IOS 54 | Type 55 | PSGroupSpecifier 56 | 57 | 58 | FooterText 59 | Generated by CocoaPods - https://cocoapods.org 60 | Title 61 | 62 | Type 63 | PSGroupSpecifier 64 | 65 | 66 | StringsTable 67 | Acknowledgements 68 | Title 69 | Acknowledgements 70 | 71 | 72 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_mynt_ios_demo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_mynt_ios_demo 5 | @end 6 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 63 | 64 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 65 | code_sign_cmd="$code_sign_cmd &" 66 | fi 67 | echo "$code_sign_cmd" 68 | eval "$code_sign_cmd" 69 | fi 70 | } 71 | 72 | # Strip invalid architectures 73 | strip_invalid_archs() { 74 | binary="$1" 75 | # Get architectures for current file 76 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 77 | stripped="" 78 | for arch in $archs; do 79 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 80 | # Strip non-valid architectures in-place 81 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 82 | stripped="$stripped $arch" 83 | fi 84 | done 85 | if [[ "$stripped" ]]; then 86 | echo "Stripped $binary of architectures:$stripped" 87 | fi 88 | } 89 | 90 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 91 | wait 92 | fi 93 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | 3) 22 | TARGET_DEVICE_ARGS="--target-device tv" 23 | ;; 24 | *) 25 | TARGET_DEVICE_ARGS="--target-device mac" 26 | ;; 27 | esac 28 | 29 | install_resource() 30 | { 31 | if [[ "$1" = /* ]] ; then 32 | RESOURCE_PATH="$1" 33 | else 34 | RESOURCE_PATH="${PODS_ROOT}/$1" 35 | fi 36 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 37 | cat << EOM 38 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 39 | EOM 40 | exit 1 41 | fi 42 | case $RESOURCE_PATH in 43 | *.storyboard) 44 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 45 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 46 | ;; 47 | *.xib) 48 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 49 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 50 | ;; 51 | *.framework) 52 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 53 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 54 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 55 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | ;; 57 | *.xcdatamodel) 58 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 59 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 60 | ;; 61 | *.xcdatamodeld) 62 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 63 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 64 | ;; 65 | *.xcmappingmodel) 66 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 67 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 68 | ;; 69 | *.xcassets) 70 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 71 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 72 | ;; 73 | *) 74 | echo "$RESOURCE_PATH" 75 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 76 | ;; 77 | esac 78 | } 79 | 80 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 82 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 83 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | fi 86 | rm -f "$RESOURCES_TO_COPY" 87 | 88 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 89 | then 90 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 91 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 92 | while read line; do 93 | if [[ $line != "${PODS_ROOT}*" ]]; then 94 | XCASSET_FILES+=("$line") 95 | fi 96 | done <<<"$OTHER_XCASSETS" 97 | 98 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | fi 100 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CRToast" "${PODS_ROOT}/Headers/Public/MYNT-SDK-IOS" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$(PODS_ROOT)/MYNT-SDK-IOS/MYNT-SDK-IOS/**" "$PODS_CONFIGURATION_BUILD_DIR/CRToast" $(inherited) "${PODS_ROOT}/../../../MYNT-SDK-IOS/ios" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CRToast" -isystem "${PODS_ROOT}/Headers/Public/MYNT-SDK-IOS" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"CRToast" -l"STMyntBluetooth" -l"sqlite3" -framework "CoreBluetooth" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /demo/mynt-demo/Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CRToast" "${PODS_ROOT}/Headers/Public/MYNT-SDK-IOS" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$(PODS_ROOT)/MYNT-SDK-IOS/MYNT-SDK-IOS/**" "$PODS_CONFIGURATION_BUILD_DIR/CRToast" $(inherited) "${PODS_ROOT}/../../../MYNT-SDK-IOS/ios" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CRToast" -isystem "${PODS_ROOT}/Headers/Public/MYNT-SDK-IOS" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"CRToast" -l"STMyntBluetooth" -l"sqlite3" -framework "CoreBluetooth" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 688BCA88D8C79776D4A53866 /* libPods-mynt-ios-demo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70BF5B52873C2BD9B59FFDA0 /* libPods-mynt-ios-demo.a */; }; 11 | A98E914C1CCC594200670FBA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98E914B1CCC594200670FBA /* AppDelegate.swift */; }; 12 | A98E91531CCC594200670FBA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A98E91521CCC594200670FBA /* Assets.xcassets */; }; 13 | A98E91561CCC594200670FBA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A98E91541CCC594200670FBA /* LaunchScreen.storyboard */; }; 14 | A9BDE5CD1F32D626008E76FB /* SDKExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BDE5CB1F32D626008E76FB /* SDKExtension.swift */; }; 15 | A9BDE5CE1F32D626008E76FB /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BDE5CC1F32D626008E76FB /* String.swift */; }; 16 | A9BDE5D11F32D658008E76FB /* MyntTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BDE5CF1F32D658008E76FB /* MyntTableViewCell.swift */; }; 17 | A9BDE5D21F32D658008E76FB /* MyntTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9BDE5D01F32D658008E76FB /* MyntTableViewCell.xib */; }; 18 | A9BDE5D71F32D65E008E76FB /* MyntListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BDE5D31F32D65E008E76FB /* MyntListViewController.swift */; }; 19 | A9BDE5D81F32D65E008E76FB /* MyntListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9BDE5D41F32D65E008E76FB /* MyntListViewController.xib */; }; 20 | A9BDE5D91F32D65E008E76FB /* MyntMainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BDE5D51F32D65E008E76FB /* MyntMainViewController.swift */; }; 21 | A9BDE5DD1F32D66E008E76FB /* Toast.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BDE5DC1F32D66E008E76FB /* Toast.swift */; }; 22 | A9BDE5DE1F32D8FD008E76FB /* MyntMainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9BDE5E01F32D8FD008E76FB /* MyntMainViewController.xib */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 4B0171699DEC4F5880EFA32E /* Pods-mynt-osx-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-mynt-osx-demo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-mynt-osx-demo/Pods-mynt-osx-demo.debug.xcconfig"; sourceTree = ""; }; 27 | 70BF5B52873C2BD9B59FFDA0 /* libPods-mynt-ios-demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-mynt-ios-demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 8255466F9A918E45AE0A42AF /* Pods-mynt-ios-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-mynt-ios-demo.release.xcconfig"; path = "Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo.release.xcconfig"; sourceTree = ""; }; 29 | A98E91481CCC594200670FBA /* mynt-ios-demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "mynt-ios-demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | A98E914B1CCC594200670FBA /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 31 | A98E91521CCC594200670FBA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 32 | A98E91551CCC594200670FBA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 33 | A98E91571CCC594200670FBA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | A98E91631CCC595500670FBA /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 35 | A98E91651CCC595500670FBA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 36 | A98E91681CCC595500670FBA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 37 | A98E916A1CCC595500670FBA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | A98E91871CCDE06000670FBA /* mynt-osx-demo-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "mynt-osx-demo-Bridging-Header.h"; sourceTree = ""; }; 39 | A98E918B1CCDE06D00670FBA /* mynt-ios-demo-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "mynt-ios-demo-Bridging-Header.h"; sourceTree = ""; }; 40 | A9BDE5CB1F32D626008E76FB /* SDKExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDKExtension.swift; sourceTree = ""; }; 41 | A9BDE5CC1F32D626008E76FB /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; 42 | A9BDE5CF1F32D658008E76FB /* MyntTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyntTableViewCell.swift; sourceTree = ""; }; 43 | A9BDE5D01F32D658008E76FB /* MyntTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyntTableViewCell.xib; sourceTree = ""; }; 44 | A9BDE5D31F32D65E008E76FB /* MyntListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyntListViewController.swift; sourceTree = ""; }; 45 | A9BDE5D41F32D65E008E76FB /* MyntListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyntListViewController.xib; sourceTree = ""; }; 46 | A9BDE5D51F32D65E008E76FB /* MyntMainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyntMainViewController.swift; sourceTree = ""; }; 47 | A9BDE5DC1F32D66E008E76FB /* Toast.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Toast.swift; sourceTree = ""; }; 48 | A9BDE5DF1F32D8FD008E76FB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MyntMainViewController.xib; sourceTree = ""; }; 49 | CF78C06C37E233781ECBA118 /* Pods-mynt-ios-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-mynt-ios-demo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo.debug.xcconfig"; sourceTree = ""; }; 50 | F853637C6EAC9B5EA1380984 /* Pods-mynt-osx-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-mynt-osx-demo.release.xcconfig"; path = "Pods/Target Support Files/Pods-mynt-osx-demo/Pods-mynt-osx-demo.release.xcconfig"; sourceTree = ""; }; 51 | FE784E6D0EE4D8D736596208 /* libPods-mynt-osx-demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-mynt-osx-demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | A98E91451CCC594200670FBA /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | 688BCA88D8C79776D4A53866 /* libPods-mynt-ios-demo.a in Frameworks */, 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | 20EA70DAA6B178D8E300EDA2 /* Pods */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 4B0171699DEC4F5880EFA32E /* Pods-mynt-osx-demo.debug.xcconfig */, 70 | F853637C6EAC9B5EA1380984 /* Pods-mynt-osx-demo.release.xcconfig */, 71 | CF78C06C37E233781ECBA118 /* Pods-mynt-ios-demo.debug.xcconfig */, 72 | 8255466F9A918E45AE0A42AF /* Pods-mynt-ios-demo.release.xcconfig */, 73 | ); 74 | name = Pods; 75 | sourceTree = ""; 76 | }; 77 | 684A390CFB8C76728C9527E3 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 70BF5B52873C2BD9B59FFDA0 /* libPods-mynt-ios-demo.a */, 81 | FE784E6D0EE4D8D736596208 /* libPods-mynt-osx-demo.a */, 82 | ); 83 | name = Frameworks; 84 | sourceTree = ""; 85 | }; 86 | A98E913F1CCC594200670FBA = { 87 | isa = PBXGroup; 88 | children = ( 89 | A98E914A1CCC594200670FBA /* mynt-ios-demo */, 90 | A98E91621CCC595500670FBA /* mynt-osx-demo */, 91 | A98E91491CCC594200670FBA /* Products */, 92 | 20EA70DAA6B178D8E300EDA2 /* Pods */, 93 | 684A390CFB8C76728C9527E3 /* Frameworks */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | A98E91491CCC594200670FBA /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | A98E91481CCC594200670FBA /* mynt-ios-demo.app */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | A98E914A1CCC594200670FBA /* mynt-ios-demo */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | A9BDE5DB1F32D664008E76FB /* widget */, 109 | A9BDE5CA1F32D61C008E76FB /* extension */, 110 | A9BDE5C91F32D615008E76FB /* viewcontroller */, 111 | A9BDE5C81F32D611008E76FB /* view */, 112 | A98E914B1CCC594200670FBA /* AppDelegate.swift */, 113 | A98E91521CCC594200670FBA /* Assets.xcassets */, 114 | A98E91541CCC594200670FBA /* LaunchScreen.storyboard */, 115 | A98E91571CCC594200670FBA /* Info.plist */, 116 | A98E918B1CCDE06D00670FBA /* mynt-ios-demo-Bridging-Header.h */, 117 | ); 118 | path = "mynt-ios-demo"; 119 | sourceTree = ""; 120 | }; 121 | A98E91621CCC595500670FBA /* mynt-osx-demo */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | A98E91631CCC595500670FBA /* AppDelegate.swift */, 125 | A98E91651CCC595500670FBA /* Assets.xcassets */, 126 | A98E91671CCC595500670FBA /* MainMenu.xib */, 127 | A98E916A1CCC595500670FBA /* Info.plist */, 128 | A98E91871CCDE06000670FBA /* mynt-osx-demo-Bridging-Header.h */, 129 | ); 130 | path = "mynt-osx-demo"; 131 | sourceTree = ""; 132 | }; 133 | A9BDE5C81F32D611008E76FB /* view */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | A9BDE5CF1F32D658008E76FB /* MyntTableViewCell.swift */, 137 | A9BDE5D01F32D658008E76FB /* MyntTableViewCell.xib */, 138 | ); 139 | name = view; 140 | sourceTree = ""; 141 | }; 142 | A9BDE5C91F32D615008E76FB /* viewcontroller */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | A9BDE5D31F32D65E008E76FB /* MyntListViewController.swift */, 146 | A9BDE5D41F32D65E008E76FB /* MyntListViewController.xib */, 147 | A9BDE5D51F32D65E008E76FB /* MyntMainViewController.swift */, 148 | A9BDE5E01F32D8FD008E76FB /* MyntMainViewController.xib */, 149 | ); 150 | name = viewcontroller; 151 | sourceTree = ""; 152 | }; 153 | A9BDE5CA1F32D61C008E76FB /* extension */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | A9BDE5CB1F32D626008E76FB /* SDKExtension.swift */, 157 | A9BDE5CC1F32D626008E76FB /* String.swift */, 158 | ); 159 | name = extension; 160 | sourceTree = ""; 161 | }; 162 | A9BDE5DB1F32D664008E76FB /* widget */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | A9BDE5DC1F32D66E008E76FB /* Toast.swift */, 166 | ); 167 | name = widget; 168 | sourceTree = ""; 169 | }; 170 | /* End PBXGroup section */ 171 | 172 | /* Begin PBXNativeTarget section */ 173 | A98E91471CCC594200670FBA /* mynt-ios-demo */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = A98E915A1CCC594200670FBA /* Build configuration list for PBXNativeTarget "mynt-ios-demo" */; 176 | buildPhases = ( 177 | AC26E39892A9CB5AF3F73325 /* [CP] Check Pods Manifest.lock */, 178 | A98E91441CCC594200670FBA /* Sources */, 179 | A98E91451CCC594200670FBA /* Frameworks */, 180 | A98E91461CCC594200670FBA /* Resources */, 181 | 31EA66761AC6391AA6A02570 /* [CP] Embed Pods Frameworks */, 182 | 5A44136113BD821922EBB959 /* [CP] Copy Pods Resources */, 183 | ); 184 | buildRules = ( 185 | ); 186 | dependencies = ( 187 | ); 188 | name = "mynt-ios-demo"; 189 | productName = "mynt-ios-demo"; 190 | productReference = A98E91481CCC594200670FBA /* mynt-ios-demo.app */; 191 | productType = "com.apple.product-type.application"; 192 | }; 193 | /* End PBXNativeTarget section */ 194 | 195 | /* Begin PBXProject section */ 196 | A98E91401CCC594200670FBA /* Project object */ = { 197 | isa = PBXProject; 198 | attributes = { 199 | LastSwiftUpdateCheck = 0730; 200 | LastUpgradeCheck = 0730; 201 | ORGANIZATIONNAME = slighech; 202 | TargetAttributes = { 203 | A98E91471CCC594200670FBA = { 204 | CreatedOnToolsVersion = 7.3; 205 | DevelopmentTeam = 74UTGGD74F; 206 | LastSwiftMigration = 0800; 207 | SystemCapabilities = { 208 | com.apple.BackgroundModes = { 209 | enabled = 1; 210 | }; 211 | }; 212 | }; 213 | }; 214 | }; 215 | buildConfigurationList = A98E91431CCC594200670FBA /* Build configuration list for PBXProject "mynt-ios-demo" */; 216 | compatibilityVersion = "Xcode 3.2"; 217 | developmentRegion = English; 218 | hasScannedForEncodings = 0; 219 | knownRegions = ( 220 | Base, 221 | ); 222 | mainGroup = A98E913F1CCC594200670FBA; 223 | productRefGroup = A98E91491CCC594200670FBA /* Products */; 224 | projectDirPath = ""; 225 | projectRoot = ""; 226 | targets = ( 227 | A98E91471CCC594200670FBA /* mynt-ios-demo */, 228 | ); 229 | }; 230 | /* End PBXProject section */ 231 | 232 | /* Begin PBXResourcesBuildPhase section */ 233 | A98E91461CCC594200670FBA /* Resources */ = { 234 | isa = PBXResourcesBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | A98E91561CCC594200670FBA /* LaunchScreen.storyboard in Resources */, 238 | A9BDE5DE1F32D8FD008E76FB /* MyntMainViewController.xib in Resources */, 239 | A98E91531CCC594200670FBA /* Assets.xcassets in Resources */, 240 | A9BDE5D81F32D65E008E76FB /* MyntListViewController.xib in Resources */, 241 | A9BDE5D21F32D658008E76FB /* MyntTableViewCell.xib in Resources */, 242 | ); 243 | runOnlyForDeploymentPostprocessing = 0; 244 | }; 245 | /* End PBXResourcesBuildPhase section */ 246 | 247 | /* Begin PBXShellScriptBuildPhase section */ 248 | 31EA66761AC6391AA6A02570 /* [CP] Embed Pods Frameworks */ = { 249 | isa = PBXShellScriptBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | ); 253 | inputPaths = ( 254 | ); 255 | name = "[CP] Embed Pods Frameworks"; 256 | outputPaths = ( 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | shellPath = /bin/sh; 260 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo-frameworks.sh\"\n"; 261 | showEnvVarsInLog = 0; 262 | }; 263 | 5A44136113BD821922EBB959 /* [CP] Copy Pods Resources */ = { 264 | isa = PBXShellScriptBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | inputPaths = ( 269 | ); 270 | name = "[CP] Copy Pods Resources"; 271 | outputPaths = ( 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | shellPath = /bin/sh; 275 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-mynt-ios-demo/Pods-mynt-ios-demo-resources.sh\"\n"; 276 | showEnvVarsInLog = 0; 277 | }; 278 | AC26E39892A9CB5AF3F73325 /* [CP] Check Pods Manifest.lock */ = { 279 | isa = PBXShellScriptBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | inputPaths = ( 284 | ); 285 | name = "[CP] Check Pods Manifest.lock"; 286 | outputPaths = ( 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | shellPath = /bin/sh; 290 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 291 | showEnvVarsInLog = 0; 292 | }; 293 | /* End PBXShellScriptBuildPhase section */ 294 | 295 | /* Begin PBXSourcesBuildPhase section */ 296 | A98E91441CCC594200670FBA /* Sources */ = { 297 | isa = PBXSourcesBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | A9BDE5CE1F32D626008E76FB /* String.swift in Sources */, 301 | A9BDE5D91F32D65E008E76FB /* MyntMainViewController.swift in Sources */, 302 | A9BDE5D71F32D65E008E76FB /* MyntListViewController.swift in Sources */, 303 | A9BDE5D11F32D658008E76FB /* MyntTableViewCell.swift in Sources */, 304 | A9BDE5CD1F32D626008E76FB /* SDKExtension.swift in Sources */, 305 | A98E914C1CCC594200670FBA /* AppDelegate.swift in Sources */, 306 | A9BDE5DD1F32D66E008E76FB /* Toast.swift in Sources */, 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | /* End PBXSourcesBuildPhase section */ 311 | 312 | /* Begin PBXVariantGroup section */ 313 | A98E91541CCC594200670FBA /* LaunchScreen.storyboard */ = { 314 | isa = PBXVariantGroup; 315 | children = ( 316 | A98E91551CCC594200670FBA /* Base */, 317 | ); 318 | name = LaunchScreen.storyboard; 319 | sourceTree = ""; 320 | }; 321 | A98E91671CCC595500670FBA /* MainMenu.xib */ = { 322 | isa = PBXVariantGroup; 323 | children = ( 324 | A98E91681CCC595500670FBA /* Base */, 325 | ); 326 | name = MainMenu.xib; 327 | sourceTree = ""; 328 | }; 329 | A9BDE5E01F32D8FD008E76FB /* MyntMainViewController.xib */ = { 330 | isa = PBXVariantGroup; 331 | children = ( 332 | A9BDE5DF1F32D8FD008E76FB /* Base */, 333 | ); 334 | name = MyntMainViewController.xib; 335 | sourceTree = ""; 336 | }; 337 | /* End PBXVariantGroup section */ 338 | 339 | /* Begin XCBuildConfiguration section */ 340 | A98E91581CCC594200670FBA /* Debug */ = { 341 | isa = XCBuildConfiguration; 342 | buildSettings = { 343 | ALWAYS_SEARCH_USER_PATHS = NO; 344 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 345 | CLANG_ANALYZER_NONNULL = YES; 346 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 347 | CLANG_CXX_LIBRARY = "libc++"; 348 | CLANG_ENABLE_MODULES = YES; 349 | CLANG_ENABLE_OBJC_ARC = YES; 350 | CLANG_WARN_BOOL_CONVERSION = YES; 351 | CLANG_WARN_CONSTANT_CONVERSION = YES; 352 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 353 | CLANG_WARN_EMPTY_BODY = YES; 354 | CLANG_WARN_ENUM_CONVERSION = YES; 355 | CLANG_WARN_INT_CONVERSION = YES; 356 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = dwarf; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | ENABLE_TESTABILITY = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_DYNAMIC_NO_PIC = NO; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 379 | MACOSX_DEPLOYMENT_TARGET = 10.9; 380 | MTL_ENABLE_DEBUG_INFO = YES; 381 | ONLY_ACTIVE_ARCH = YES; 382 | SDKROOT = iphoneos; 383 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 384 | }; 385 | name = Debug; 386 | }; 387 | A98E91591CCC594200670FBA /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 392 | CLANG_ANALYZER_NONNULL = YES; 393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 394 | CLANG_CXX_LIBRARY = "libc++"; 395 | CLANG_ENABLE_MODULES = YES; 396 | CLANG_ENABLE_OBJC_ARC = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_CONSTANT_CONVERSION = YES; 399 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 400 | CLANG_WARN_EMPTY_BODY = YES; 401 | CLANG_WARN_ENUM_CONVERSION = YES; 402 | CLANG_WARN_INT_CONVERSION = YES; 403 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 404 | CLANG_WARN_UNREACHABLE_CODE = YES; 405 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 406 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 407 | COPY_PHASE_STRIP = NO; 408 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 409 | ENABLE_NS_ASSERTIONS = NO; 410 | ENABLE_STRICT_OBJC_MSGSEND = YES; 411 | GCC_C_LANGUAGE_STANDARD = gnu99; 412 | GCC_NO_COMMON_BLOCKS = YES; 413 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 414 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 415 | GCC_WARN_UNDECLARED_SELECTOR = YES; 416 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 417 | GCC_WARN_UNUSED_FUNCTION = YES; 418 | GCC_WARN_UNUSED_VARIABLE = YES; 419 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 420 | MACOSX_DEPLOYMENT_TARGET = 10.9; 421 | MTL_ENABLE_DEBUG_INFO = NO; 422 | SDKROOT = iphoneos; 423 | VALIDATE_PRODUCT = YES; 424 | }; 425 | name = Release; 426 | }; 427 | A98E915B1CCC594200670FBA /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = CF78C06C37E233781ECBA118 /* Pods-mynt-ios-demo.debug.xcconfig */; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CLANG_ENABLE_MODULES = YES; 433 | CODE_SIGN_IDENTITY = "iPhone Developer"; 434 | ENABLE_BITCODE = NO; 435 | INFOPLIST_FILE = "mynt-ios-demo/Info.plist"; 436 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 437 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 438 | ONLY_ACTIVE_ARCH = YES; 439 | PRODUCT_BUNDLE_IDENTIFIER = "com.slighech.mynt-ios-demo"; 440 | PRODUCT_NAME = "$(TARGET_NAME)"; 441 | SWIFT_OBJC_BRIDGING_HEADER = "mynt-ios-demo/mynt-ios-demo-Bridging-Header.h"; 442 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 443 | SWIFT_VERSION = 3.0; 444 | VALID_ARCHS = "arm64 armv7s armv7"; 445 | }; 446 | name = Debug; 447 | }; 448 | A98E915C1CCC594200670FBA /* Release */ = { 449 | isa = XCBuildConfiguration; 450 | baseConfigurationReference = 8255466F9A918E45AE0A42AF /* Pods-mynt-ios-demo.release.xcconfig */; 451 | buildSettings = { 452 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 453 | CLANG_ENABLE_MODULES = YES; 454 | CODE_SIGN_IDENTITY = "iPhone Developer"; 455 | ENABLE_BITCODE = NO; 456 | INFOPLIST_FILE = "mynt-ios-demo/Info.plist"; 457 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 458 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 459 | PRODUCT_BUNDLE_IDENTIFIER = "com.slighech.mynt-ios-demo"; 460 | PRODUCT_NAME = "$(TARGET_NAME)"; 461 | SWIFT_OBJC_BRIDGING_HEADER = "mynt-ios-demo/mynt-ios-demo-Bridging-Header.h"; 462 | SWIFT_VERSION = 3.0; 463 | VALID_ARCHS = "arm64 armv7s armv7"; 464 | }; 465 | name = Release; 466 | }; 467 | /* End XCBuildConfiguration section */ 468 | 469 | /* Begin XCConfigurationList section */ 470 | A98E91431CCC594200670FBA /* Build configuration list for PBXProject "mynt-ios-demo" */ = { 471 | isa = XCConfigurationList; 472 | buildConfigurations = ( 473 | A98E91581CCC594200670FBA /* Debug */, 474 | A98E91591CCC594200670FBA /* Release */, 475 | ); 476 | defaultConfigurationIsVisible = 0; 477 | defaultConfigurationName = Release; 478 | }; 479 | A98E915A1CCC594200670FBA /* Build configuration list for PBXNativeTarget "mynt-ios-demo" */ = { 480 | isa = XCConfigurationList; 481 | buildConfigurations = ( 482 | A98E915B1CCC594200670FBA /* Debug */, 483 | A98E915C1CCC594200670FBA /* Release */, 484 | ); 485 | defaultConfigurationIsVisible = 0; 486 | defaultConfigurationName = Release; 487 | }; 488 | /* End XCConfigurationList section */ 489 | }; 490 | rootObject = A98E91401CCC594200670FBA /* Project object */; 491 | } 492 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo.xcodeproj/project.xcworkspace/xcuserdata/gejw.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo.xcodeproj/project.xcworkspace/xcuserdata/gejw.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo.xcodeproj/xcuserdata/gejw.xcuserdatad/xcschemes/mynt-ios-demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo.xcodeproj/xcuserdata/gejw.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | mynt-ios-demo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | A98E91471CCC594200670FBA 16 | 17 | primary 18 | 19 | 20 | A98E91601CCC595500670FBA 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo.xcworkspace/xcuserdata/gejw.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo.xcworkspace/xcuserdata/gejw.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo.xcworkspace/xcuserdata/gejw.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 12 | 13 | 14 | 16 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // mynt-ios-demo 4 | // 5 | // Created by gejw on 16/4/24. 6 | // Copyright © 2016年 slighech. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 17 | 18 | window = UIWindow(frame: UIScreen.main.bounds) 19 | window!.rootViewController = UINavigationController(rootViewController: MyntListViewController()) 20 | window!.makeKeyAndVisible() 21 | 22 | return true 23 | } 24 | 25 | func applicationWillResignActive(_ application: UIApplication) { 26 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 27 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 28 | } 29 | 30 | func applicationDidEnterBackground(_ application: UIApplication) { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | func applicationWillEnterForeground(_ application: UIApplication) { 36 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 37 | } 38 | 39 | func applicationDidBecomeActive(_ application: UIApplication) { 40 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 41 | } 42 | 43 | func applicationWillTerminate(_ application: UIApplication) { 44 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 45 | } 46 | 47 | 48 | } 49 | 50 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "size" : "29x29", 15 | "idiom" : "iphone", 16 | "filename" : "Icon-Small@2x.png", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "size" : "29x29", 21 | "idiom" : "iphone", 22 | "filename" : "Icon-Small@3x.png", 23 | "scale" : "3x" 24 | }, 25 | { 26 | "size" : "40x40", 27 | "idiom" : "iphone", 28 | "filename" : "Icon-Spotlight-40@2x.png", 29 | "scale" : "2x" 30 | }, 31 | { 32 | "size" : "40x40", 33 | "idiom" : "iphone", 34 | "filename" : "Icon-Spotlight-40@3x.png", 35 | "scale" : "3x" 36 | }, 37 | { 38 | "size" : "60x60", 39 | "idiom" : "iphone", 40 | "filename" : "Icon-60@2x.png", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "size" : "60x60", 45 | "idiom" : "iphone", 46 | "filename" : "Icon-60@3x.png", 47 | "scale" : "3x" 48 | }, 49 | { 50 | "idiom" : "ios-marketing", 51 | "size" : "1024x1024", 52 | "scale" : "1x" 53 | } 54 | ], 55 | "info" : { 56 | "version" : 1, 57 | "author" : "xcode" 58 | } 59 | } -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/LaunchImage.launchimage/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/LaunchImage.launchimage/1.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/LaunchImage.launchimage/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/LaunchImage.launchimage/2.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/LaunchImage.launchimage/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/LaunchImage.launchimage/3.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/LaunchImage.launchimage/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/LaunchImage.launchimage/4.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "4.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "667h", 16 | "filename" : "3.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "portrait", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "orientation" : "portrait", 23 | "idiom" : "iphone", 24 | "filename" : "1.png", 25 | "extent" : "full-screen", 26 | "minimum-system-version" : "7.0", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "extent" : "full-screen", 31 | "idiom" : "iphone", 32 | "subtype" : "retina4", 33 | "filename" : "2.png", 34 | "minimum-system-version" : "7.0", 35 | "orientation" : "portrait", 36 | "scale" : "2x" 37 | } 38 | ], 39 | "info" : { 40 | "version" : 1, 41 | "author" : "xcode" 42 | } 43 | } -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/battery.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "battery.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "battery@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "battery@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/battery.imageset/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/battery.imageset/battery.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/battery.imageset/battery@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/battery.imageset/battery@2x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/battery.imageset/battery@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/battery.imageset/battery@3x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/debug_logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "udebug_logo.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "udebug_logo@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "udebug_logo@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/debug_logo.imageset/udebug_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/debug_logo.imageset/udebug_logo.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/debug_logo.imageset/udebug_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/debug_logo.imageset/udebug_logo@2x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/debug_logo.imageset/udebug_logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/debug_logo.imageset/udebug_logo@3x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_gps_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "homepage_gps@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "homepage_gps@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_gps_icon.imageset/homepage_gps@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_gps_icon.imageset/homepage_gps@2x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_gps_icon.imageset/homepage_gps@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_gps_icon.imageset/homepage_gps@3x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "homepage_mynt.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "homepage_mynt@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "homepage_mynt@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_icon.imageset/homepage_mynt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_icon.imageset/homepage_mynt.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_icon.imageset/homepage_mynt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_icon.imageset/homepage_mynt@2x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_icon.imageset/homepage_mynt@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/mynt_icon.imageset/homepage_mynt@3x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/信号.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "信号.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "信号@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/信号.imageset/信号.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/信号.imageset/信号.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Assets.xcassets/信号.imageset/信号@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slightech/MYNT-SDK-IOS/02029448dc6be831885f52851ab4ea8c302a1dd7/demo/mynt-demo/mynt-ios-demo/Assets.xcassets/信号.imageset/信号@2x.png -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Base.lproj/MyntMainViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 58 | 59 | 60 | 61 | 62 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSBluetoothPeripheralUsageDescription 26 | 27 | UIBackgroundModes 28 | 29 | bluetooth-central 30 | bluetooth-peripheral 31 | 32 | UILaunchStoryboardName 33 | LaunchScreen 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/MyntListViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MyntListViewController.swift 3 | // STMyntBluetooth 4 | // 5 | // Created by gejw on 2017/7/21. 6 | // Copyright © 2017年 robinge. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class MyntListViewController: UIViewController { 12 | 13 | var mynts = [STMynt]() 14 | 15 | var myntBluetooth: STMyntBluetooth? 16 | 17 | weak var viewController: MyntMainViewController? 18 | 19 | @IBOutlet weak var tableView: UITableView! 20 | 21 | override func viewDidLoad() { 22 | super.viewDidLoad() 23 | 24 | self.title = "MYNT SDK TEST" 25 | self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Sort", style: .done, target: self, action: #selector(didClickSortButton)) 26 | self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Scan", style: .done, target: self, action: #selector(didClickSearchButton)) 27 | 28 | tableView.separatorStyle = .none 29 | tableView.register(UINib(nibName: "MyntTableViewCell", bundle: nil), 30 | forCellReuseIdentifier: "MyntTableViewCell") 31 | tableView.delegate = self 32 | tableView.dataSource = self 33 | 34 | myntBluetooth = STMyntBluetooth.sharedInstance() 35 | myntBluetooth?.delegate = self 36 | } 37 | 38 | override func didReceiveMemoryWarning() { 39 | super.didReceiveMemoryWarning() 40 | // Dispose of any resources that can be recreated. 41 | } 42 | 43 | func didClickSortButton() { 44 | mynts = mynts.sorted(by: {$0.rssi > $1.rssi}) 45 | tableView.reloadData() 46 | } 47 | 48 | func didClickSearchButton() { 49 | if myntBluetooth?.centralState == .poweredOff { 50 | Toast.show(message: "Bluetooth closed!") 51 | return 52 | } 53 | if myntBluetooth?.centralState == .unknown { 54 | Toast.show(message: "Bluetooth state unknown!") 55 | return 56 | } 57 | if myntBluetooth?.isScanning == true { 58 | myntBluetooth?.stopScan() 59 | self.navigationItem.rightBarButtonItem?.title = "Scan" 60 | } else { 61 | myntBluetooth?.startScan() 62 | self.navigationItem.rightBarButtonItem?.title = "Stop Scan" 63 | } 64 | tableView.reloadData() 65 | } 66 | 67 | } 68 | 69 | extension MyntListViewController: UITableViewDataSource, UITableViewDelegate { 70 | 71 | @objc open func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 72 | return mynts.count 73 | } 74 | 75 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 76 | return 120 77 | } 78 | 79 | @objc func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 80 | let cell = tableView.dequeueReusableCell(withIdentifier: "MyntTableViewCell", for: indexPath) as! MyntTableViewCell 81 | cell.mynt = mynts[indexPath.row] 82 | return cell 83 | } 84 | 85 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 86 | let mynt = mynts[indexPath.row] 87 | if mynt.isDiscovering { 88 | // 进入下一页 89 | let viewController = MyntMainViewController() 90 | viewController.mynt = mynt 91 | self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .done, target: self, action: nil) 92 | self.navigationController?.pushViewController(viewController, animated: true) 93 | self.viewController = viewController 94 | } else { 95 | 96 | } 97 | } 98 | 99 | } 100 | 101 | extension MyntListViewController: STMyntBluetoothDelegate { 102 | 103 | func myntBluetooth(_ myntBluetooth: STMyntBluetooth, didUpdate state: CBCentralManagerState) { 104 | if state != .poweredOn { 105 | mynts = [] 106 | tableView.reloadData() 107 | } 108 | } 109 | 110 | func myntBluetooth(_ myntBluetooth: STMyntBluetooth, didDiscover mynt: STMynt) { 111 | if !mynts.contains(mynt) { 112 | mynts.append(mynt) 113 | } 114 | tableView.reloadData() 115 | } 116 | 117 | func myntBluetooth(_ myntBluetooth: STMyntBluetooth, didDiscoverTimeoutMynt mynt: STMynt) { 118 | tableView.reloadData() 119 | } 120 | 121 | func myntBluetooth(_ myntBluetooth: STMyntBluetooth, didPrintLog log: String) { 122 | viewController?.addLogInfo(mynt: viewController?.mynt, msg: log) 123 | } 124 | } 125 | 126 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/MyntListViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/MyntMainViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MyntMainViewController.swift 3 | // STMyntBluetooth 4 | // 5 | // Created by gejw on 2017/7/21. 6 | // Copyright © 2017年 robinge. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension Date { 12 | 13 | static var time: String { 14 | let date = Date() 15 | let formatter = DateFormatter() 16 | formatter.dateFormat = "HH:mm:ss:sss" 17 | return formatter.string(from: date) 18 | } 19 | 20 | } 21 | 22 | func showAlert(message: String) { 23 | let alert = UIAlertView(title: "Message", message: message, delegate: nil, cancelButtonTitle: nil, otherButtonTitles: "OK") 24 | alert.show() 25 | } 26 | 27 | enum Event: String { 28 | 29 | case oad = "Update firmware" 30 | case readBattery = "Read value of battery quantity" 31 | case writeRingtone = "Write values of ringtone" 32 | case readRingtone = "Read the ringtone values" 33 | case writeEvent = "Write control event (Click, etc.)" 34 | case readEvent = "Read control event (Click, etc.)" 35 | case writeAlarmCount = "Write values of alarm times" 36 | case writeAlarmDelay = "Write values of alarm delay" 37 | case switchBLE = "Switch to BLE mode" 38 | 39 | case sync = "Sync Date" 40 | case shutdown = "Shutdown" 41 | case writeLocationInterval = "Write the interval value of prositioning" 42 | case readLocationInterval = "Read the interval values of prositioning" 43 | case readICCID = "Read ICCID values" 44 | case checkNetwork = "Check Network" 45 | 46 | } 47 | 48 | class MyntMainViewController: UIViewController { 49 | 50 | weak var mynt: STMynt? 51 | var password: String? 52 | 53 | @IBOutlet weak var stateLabel: UILabel! 54 | @IBOutlet weak var logTextView: UITextView! 55 | @IBOutlet weak var alarmButton: UIButton! 56 | @IBOutlet weak var tableView: UITableView! 57 | 58 | var items: [Event] = [.oad, .readBattery, .writeRingtone, .readRingtone, .writeEvent, .readEvent, .writeAlarmCount, .writeAlarmDelay, .switchBLE] 59 | 60 | override func viewDidLoad() { 61 | super.viewDidLoad() 62 | 63 | // Initializing components 64 | 65 | self.title = mynt?.sn 66 | self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Disconnect", style: .done, target: self, action: #selector(didClickConnectButton)) 67 | 68 | self.tableView.delegate = self 69 | self.tableView.dataSource = self 70 | 71 | mynt?.delegate = self 72 | if mynt?.state != MYNTState.connected { 73 | mynt?.isAutoConnecting = true 74 | mynt?.connect() 75 | } 76 | updateState() 77 | 78 | if mynt?.hardwareType == .MYNTGPS { 79 | let gpsItems: [Event] = [.sync, .shutdown, .writeLocationInterval, .readLocationInterval, .readICCID, .checkNetwork] 80 | items += gpsItems 81 | } 82 | tableView.reloadData() 83 | } 84 | 85 | override func didReceiveMemoryWarning() { 86 | super.didReceiveMemoryWarning() 87 | // Dispose of any resources that can be recreated. 88 | } 89 | 90 | func didClickConnectButton() { 91 | if mynt?.state == .disconnected { 92 | self.navigationItem.rightBarButtonItem?.title = "Disconnect" 93 | mynt?.isAutoConnecting = true 94 | mynt?.connect() 95 | } else { 96 | self.navigationItem.rightBarButtonItem?.title = "Connect" 97 | mynt?.isAutoConnecting = false 98 | mynt?.disconnect() 99 | } 100 | } 101 | 102 | // MARK: ---- Click event ---- 103 | 104 | @IBAction func didClickCleanLogButton(_ button: UIButton) { 105 | logTextView.text = "" 106 | } 107 | 108 | @IBAction func didClickAlarmButton(_ button: UIButton) { 109 | mynt?.toggleAlarm(mynt?.isAlarm != true, handler: { error in 110 | 111 | }) 112 | } 113 | 114 | // MARK: ---- TableView Click event ---- 115 | 116 | func didClickFirmwareButton() { 117 | mynt?.updateFirmware({ () -> Data? in 118 | return nil 119 | }, progress: { progress in 120 | 121 | }, success: { 122 | 123 | }, failure: { error in 124 | 125 | }) 126 | } 127 | 128 | func didClickReadBatteryButton() { 129 | mynt?.readBattery({ batteries in 130 | showAlert(message: "Read battery quantity value \(batteries)") 131 | }, failure: { error in 132 | showAlert(message: "Failed to read battery quantity \(String(describing: error))") 133 | }) 134 | } 135 | 136 | func didClickSetRingButton() { 137 | // let musicHigh = [1: 1047, 138 | // 2: 1175, 139 | // 3: 1319, 140 | // 4: 1397, 141 | // 5: 1568, 142 | // 6: 1760, 143 | // 7: 1967] 144 | // Internal 145 | let music1 = [[1047, 100], 146 | [0, 50], 147 | [1175, 100], 148 | [0, 50], 149 | [1319, 100], 150 | [0, 50], 151 | [1047, 100], 152 | [0, 50], 153 | [1175, 100], 154 | [0, 50], 155 | [1319, 100], 156 | [0, 50], 157 | 158 | [2731, 200], 159 | [0, 50], 160 | [2731, 200], 161 | [0, 50], 162 | [ 2731, 200], 163 | [0, 50], 164 | 165 | [1397, 100], 166 | [0, 50], 167 | [1568, 100], 168 | [0, 50], 169 | [1760, 100], 170 | [0, 50], 171 | [1397, 100], 172 | [0, 50], 173 | [1568, 100], 174 | [0, 50], 175 | [1760, 100], 176 | [0, 50], 177 | 178 | [2731, 200], 179 | [0, 50], 180 | [2731, 200], 181 | [0, 50], 182 | [2731, 200], 183 | [0, 50]] 184 | 185 | // Two tigers 186 | let music2 = [[1046, 410], 187 | [1175, 398], 188 | [1318, 387], 189 | [1046, 410], 190 | 191 | [1046, 410], 192 | [1175, 398], 193 | [1318, 387], 194 | [1046, 410], 195 | 196 | [1318, 387], 197 | [1397, 382], 198 | [1568, 600], 199 | 200 | [1318, 387], 201 | [1397, 382], 202 | [1568, 600]] 203 | 204 | 205 | let data = NSMutableData() 206 | ((Int(arc4random() % 9) % 2 == 0) ? music1 : music2).forEach { (result) in 207 | result.forEach({ (int) in 208 | var value: Int = int 209 | data.append(NSData(bytes: &value, length: 2) as Data) 210 | }) 211 | } 212 | NSLog("\ndata\t%@\nlength\t%i", data, data.length) 213 | mynt?.writeRingtone(data as Data, version: 0xff) { error in 214 | 215 | } 216 | } 217 | 218 | func didClickReadRingButton() { 219 | mynt?.readRingtoneVersion { varsion, error in 220 | showAlert(message: "Read ringtone version \(varsion)") 221 | } 222 | } 223 | 224 | func didClickSetControlButton() { 225 | let click = MYNTClickValue(rawValue: Int(arc4random() % 9))! 226 | let doubleClick = MYNTClickValue(rawValue: Int(arc4random() % 9))! 227 | let tripleClick = MYNTClickValue(rawValue: Int(arc4random() % 9))! 228 | let hold = MYNTClickValue(rawValue: Int(arc4random() % 9))! 229 | let clickHold = MYNTClickValue(rawValue: Int(arc4random() % 9))! 230 | mynt?.writeClickValue(true, 231 | click: click, 232 | doubleClick: doubleClick, 233 | tripleClick: tripleClick, 234 | hold: hold, 235 | clickHold: clickHold, 236 | handler: { error in 237 | showAlert(message: "Write control mode \(error == nil ? "Succeeded\n\(click.name)\n\(doubleClick.name)\n\(tripleClick.name)\n\(hold.name)\n\(clickHold.name)" : "Failed")") 238 | }) 239 | } 240 | 241 | func didClickReadControlButton() { 242 | mynt?.readClickValue({ (click, doubleClick, tripleClick, hold, clickHold) in 243 | showAlert(message: "Succeeded to read control event\n\(click.name)\n\(doubleClick.name)\n\(tripleClick.name)\n\(hold.name)\n\(clickHold.name)") 244 | }, failure: { error in 245 | showAlert(message: "Fialed to read control event \(String(describing: error))") 246 | }) 247 | } 248 | 249 | func didClickSetAlarmCountButton() { 250 | let count = Int(arc4random() % 9) 251 | mynt?.writeAlarmCount(count, handler: { error in 252 | showAlert(message: "Write the value of alarm times \(error == nil ? "Succeeded \(count)" : "Failed")") 253 | }) 254 | } 255 | 256 | func didClickSetAlarmDelayButton() { 257 | let delay = Int(arc4random() % 9) 258 | mynt?.writeAlarmDelay(delay, handler: { error in 259 | showAlert(message: "Read / write how long the alarm will be delayed \(error == nil ? "Succeeded \(delay)" : "Failed")") 260 | }) 261 | } 262 | 263 | func didClickBLEButton() { 264 | mynt?.writeClickValue(false, 265 | click: .none, 266 | doubleClick: .none, 267 | tripleClick: .none, 268 | hold: .none, 269 | clickHold: .none, 270 | handler: { error in 271 | showAlert(message: "Succeeded to write") 272 | }) 273 | } 274 | 275 | 276 | // MARK: ---- Dedicated to MYNT GPS product ---- 277 | 278 | func didClickSyncDateButton() { 279 | mynt?.syncTime { error in 280 | 281 | } 282 | } 283 | 284 | func didClickShutdownButton() { 285 | mynt?.shutdown { error in 286 | 287 | } 288 | } 289 | 290 | func didClickSetLocatioIntervalnButton() { 291 | mynt?.writeLocateInterval(Int(arc4random() % 20) + 1) { error in 292 | 293 | } 294 | } 295 | 296 | func didClickReadLocationIntervalButton() { 297 | mynt?.readLocateInterval { interval, error in 298 | showAlert(message: "Read \(interval)") 299 | } 300 | } 301 | 302 | func didClickReadICCIDButton() { 303 | mynt?.readICCID { iccid, error in 304 | let message = error != nil ? error?.localizedDescription : iccid 305 | showAlert(message: "Read ICCID \(String(describing: message))") 306 | } 307 | } 308 | 309 | @IBAction func didClickCheckNetButton() { 310 | mynt?.checkNetwork { error in 311 | 312 | } 313 | } 314 | 315 | @IBAction func didClickWriteAPNButton() { 316 | let alert = UIAlertView(title: "Please input apn", message: "", delegate: self, cancelButtonTitle: "Cancel", otherButtonTitles: "OK") 317 | alert.alertViewStyle = .plainTextInput 318 | alert.tag = 10000 319 | alert.show() 320 | } 321 | 322 | } 323 | 324 | extension MyntMainViewController: UIAlertViewDelegate { 325 | 326 | func alertView(_ alertView: UIAlertView, clickedButtonAt buttonIndex: Int) { 327 | switch alertView.tag { 328 | case 10000: 329 | if buttonIndex == 1 { 330 | guard let apn = alertView.textField(at: 0)?.text else { 331 | return 332 | } 333 | mynt?.writeAPN(apn) { error in 334 | 335 | } 336 | } 337 | default: 338 | break 339 | } 340 | } 341 | 342 | } 343 | 344 | // MARK: ---- STMyntDelegate ---- 345 | extension MyntMainViewController: STMyntDelegate { 346 | 347 | func updateState() { 348 | guard let mynt = mynt else { return } 349 | stateLabel.text = "State: \(mynt.state.name)" 350 | } 351 | 352 | func addLogInfo(mynt: STMynt?, msg: String) { 353 | if self.mynt != mynt { return } 354 | logTextView.text = logTextView.text + "\(Date.time) \t\(msg)\n" 355 | UIView.setAnimationsEnabled(false) 356 | logTextView.scrollRangeToVisible(NSRange(location: logTextView.text.characters.count - 1, length: 1)) 357 | UIView.setAnimationsEnabled(true) 358 | } 359 | 360 | func connectSuccessHandler() { 361 | if let mynt = mynt { 362 | addLogInfo(mynt: mynt, msg: "manufaturer -> \(String(describing: mynt.manufaturer))") 363 | addLogInfo(mynt: mynt, msg: "model -> \(String(describing: mynt.model))") 364 | addLogInfo(mynt: mynt, msg: "sn -> \(mynt.sn)") 365 | addLogInfo(mynt: mynt, msg: "firmware -> \(String(describing: mynt.firmware))") 366 | addLogInfo(mynt: mynt, msg: "software -> \(String(describing: mynt.software))") 367 | addLogInfo(mynt: mynt, msg: "hardware -> \(String(describing: mynt.hardware))") 368 | addLogInfo(mynt: mynt, msg: "macAddress -> \(String(describing: mynt.mac))") 369 | } 370 | } 371 | 372 | func myntDidStartConnect(_ mynt: STMynt) { 373 | self.navigationItem.rightBarButtonItem?.title = "disconnect" 374 | updateState() 375 | } 376 | 377 | func myntDidConnected(_ mynt: STMynt) { 378 | connectSuccessHandler() 379 | updateState() 380 | } 381 | 382 | func mynt(_ mynt: STMynt, didDisconnected error: Error?) { 383 | updateState() 384 | self.navigationItem.rightBarButtonItem?.title = "connect" 385 | } 386 | 387 | func mynt(_ mynt: STMynt, didUpdateRSSI RSSI: Int) { 388 | if let sn = self.mynt?.sn , self.mynt == mynt { 389 | self.title = "\(sn)[\(RSSI)]" 390 | } 391 | } 392 | 393 | func mynt(_ mynt: STMynt, didUpdateBattery batteries: [NSNumber]) { 394 | addLogInfo(mynt: mynt, msg: "delegate - didUpdateBattery \(batteries)") 395 | } 396 | 397 | func mynt(_ mynt: STMynt, didUpdateAlarmState alarmState: Bool) { 398 | addLogInfo(mynt: mynt, msg: "alarmState \(alarmState)") 399 | alarmButton.setTitle(alarmState ? "Stop alarm" : "Alarm", for: .normal) 400 | } 401 | 402 | func mynt(_ mynt: STMynt, didReceive clickEvent: MYNTClickEvent) { 403 | addLogInfo(mynt: mynt, msg: "didReceiveClickEvent \(clickEvent.name)") 404 | } 405 | 406 | func didRequestAutoconnect(_ mynt: STMynt) -> Bool { 407 | // Whether need to reconnect automatically 408 | return mynt.isAutoConnecting 409 | } 410 | 411 | func didNeedRestartBluetooth(_ mynt: STMynt) { 412 | stateLabel.text = "please restart the bluetooth" 413 | } 414 | 415 | func didRequestPassword(_ mynt: STMynt) -> String? { 416 | return password 417 | } 418 | 419 | func mynt(_ mynt: STMynt, didUpdatePassword password: String?) { 420 | self.password = password 421 | } 422 | 423 | } 424 | 425 | extension MyntMainViewController: UITableViewDelegate, UITableViewDataSource { 426 | 427 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 428 | return items.count 429 | } 430 | 431 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 432 | var cell = tableView.dequeueReusableCell(withIdentifier: "cell") 433 | if cell == nil { 434 | cell = UITableViewCell(style: .default, reuseIdentifier: "cell") 435 | } 436 | cell?.textLabel?.text = items[indexPath.row].rawValue 437 | return cell! 438 | } 439 | 440 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 441 | tableView.deselectRow(at: indexPath, animated: false) 442 | switch items[indexPath.row] { 443 | case .oad: 444 | didClickFirmwareButton() 445 | case .readBattery: 446 | didClickReadBatteryButton() 447 | case .writeRingtone: 448 | didClickSetRingButton() 449 | case .readRingtone: 450 | didClickReadRingButton() 451 | case .writeEvent: 452 | didClickSetControlButton() 453 | case .readEvent: 454 | didClickReadControlButton() 455 | case .writeAlarmCount: 456 | didClickSetAlarmCountButton() 457 | case .writeAlarmDelay: 458 | didClickSetAlarmDelayButton() 459 | case .switchBLE: 460 | didClickBLEButton() 461 | 462 | case .sync: 463 | didClickSyncDateButton() 464 | case .shutdown: 465 | didClickShutdownButton() 466 | case .writeLocationInterval: 467 | didClickSetLocatioIntervalnButton() 468 | case .readLocationInterval: 469 | didClickReadLocationIntervalButton() 470 | case .readICCID: 471 | didClickReadICCIDButton() 472 | case .checkNetwork: 473 | didClickCheckNetButton() 474 | } 475 | } 476 | 477 | } 478 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/MyntTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MyntTableViewCell.swift 3 | // STMyntBluetooth 4 | // 5 | // Created by gejw on 2017/6/8. 6 | // Copyright © 2017年 robinge. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | fileprivate extension MYNTHardwareType { 12 | 13 | var name: String { 14 | switch self { 15 | case .MYNTV1: 16 | return "MYNT-BLE" 17 | case .MYNTV2: 18 | return "MYNT" 19 | case .MYNTGPS: 20 | return "MYNT-GPS" 21 | case .none: 22 | return "" 23 | } 24 | } 25 | } 26 | 27 | fileprivate extension STMynt { 28 | 29 | var icon: UIImage? { 30 | switch self.hardwareType { 31 | case .MYNTGPS: 32 | return UIImage(named: "mynt_gps_icon")?.withRenderingMode(.alwaysTemplate) 33 | default: 34 | return UIImage(named: "mynt_icon")?.withRenderingMode(.alwaysTemplate) 35 | } 36 | } 37 | 38 | } 39 | 40 | class MyntTableViewCell: UITableViewCell { 41 | 42 | @IBOutlet weak var iconImageView: UIImageView! 43 | @IBOutlet weak var nameLabel: UILabel! 44 | @IBOutlet weak var snLabel: UILabel! 45 | @IBOutlet weak var infoLabel: UILabel! 46 | @IBOutlet weak var signalLabel: UILabel! 47 | @IBOutlet weak var cornerRadiusView: UIView! 48 | @IBOutlet weak var stateLabel: UILabel! 49 | 50 | @IBOutlet weak var shadeView: UIView! 51 | 52 | var mynt: STMynt? { 53 | didSet { 54 | guard let mynt = mynt else { return } 55 | iconImageView.image = mynt.icon 56 | nameLabel.text = "\(mynt.name)" 57 | snLabel.text = "\(mynt.sn)" 58 | signalLabel.text = "\(mynt.rssi) dBm" 59 | infoLabel.text = "MYNT Type: \(mynt.hardwareType.name)" 60 | stateLabel.text = "\(mynt.state.name)" 61 | 62 | shadeView.isHidden = mynt.isDiscovering 63 | } 64 | } 65 | 66 | override func awakeFromNib() { 67 | super.awakeFromNib() 68 | shadeView.layer.cornerRadius = 4 69 | cornerRadiusView.layer.cornerRadius = 4 70 | cornerRadiusView.layer.shadowColor = UIColor.black.cgColor 71 | cornerRadiusView.layer.shadowOffset = .zero 72 | cornerRadiusView.layer.shadowOpacity = 0.15 73 | cornerRadiusView.layer.shadowRadius = 4 74 | } 75 | 76 | override func setSelected(_ selected: Bool, animated: Bool) { 77 | super.setSelected(selected, animated: animated) 78 | 79 | // Configure the view for the selected state 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/MyntTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 39 | 45 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 64 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/SDKExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SDKExtension.swift 3 | // STMyntBluetooth 4 | // 5 | // Created by gejw on 2017/6/8. 6 | // Copyright © 2017年 robinge. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | fileprivate var isAutoConnectingKey = 1 12 | extension STMynt { 13 | 14 | var isAutoConnecting: Bool { 15 | set { 16 | objc_setAssociatedObject(self, &isAutoConnectingKey, newValue, .OBJC_ASSOCIATION_COPY_NONATOMIC) 17 | } 18 | get { 19 | let result = objc_getAssociatedObject(self, &isAutoConnectingKey) as? Bool 20 | return result == nil ? false : result! 21 | } 22 | } 23 | } 24 | 25 | extension MYNTState { 26 | 27 | var name: String { 28 | switch self { 29 | case .connected: 30 | return "Connected" 31 | case .disconnected: 32 | return "Disconnected" 33 | case .connecting: 34 | return "Connecting..." 35 | case .startConnecting: 36 | return "Start connecting..." 37 | } 38 | } 39 | 40 | var buttonText: String { 41 | switch self { 42 | case .disconnected: 43 | return "Connect" 44 | default: 45 | return "Disconnect" 46 | } 47 | } 48 | } 49 | 50 | 51 | extension MYNTClickEvent { 52 | 53 | var name: String { 54 | switch self { 55 | case .click: 56 | return "Click" 57 | case .doubleClick: 58 | return "DoubleClick" 59 | case .tripleClick: 60 | return "TripleClick" 61 | case .hold: 62 | return "Hold" 63 | case .clickHold: 64 | return "ClickHold" 65 | case .phoneAlarm: 66 | return "phoneAlarm" 67 | case .phoneAlarmOff: 68 | return "phoneAlarmOff" 69 | case .phoneFlash: 70 | return "phoneFlash" 71 | } 72 | } 73 | } 74 | 75 | extension MYNTClickValue { 76 | 77 | var name: String { 78 | switch self { 79 | case .musicPlay: 80 | return "MusicPlay" 81 | case .musicNext: 82 | return "MusicNext" 83 | case .musicPrevious: 84 | return "MusicPrevious" 85 | case .musicVolumeUp: 86 | return "MusicVolumeUp" 87 | case .musicVolumeDown: 88 | return "MusicVolumeDown" 89 | case .cameraShutter: 90 | return "CameraShutter" 91 | case .cameraBurst: 92 | return "CameraBurst" 93 | case .pptExit: 94 | return "PPTExit" 95 | case .pptNextPage: 96 | return "PPTNextPage" 97 | case .pptPreviousPage: 98 | return "PPTPreviousPage" 99 | case .customClick: 100 | return "CustomClick" 101 | case .none: 102 | return "None" 103 | case .askHelp: 104 | return "askHelp" 105 | case .phoneAlarm: 106 | return "phoneAlarm" 107 | case .phoneFlash: 108 | return "phoneFlash" 109 | } 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/String.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String.swift 3 | // STMyntBluetooth 4 | // 5 | // Created by gejw on 2017/6/9. 6 | // Copyright © 2017年 robinge. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | public extension String { 13 | 14 | /// 长度 15 | public var length: Int { 16 | return characters.count 17 | } 18 | 19 | /** 20 | 排除两侧空格 21 | 22 | :returns: <#return value description#> 23 | */ 24 | public func trim() -> String { 25 | return trimmingCharacters(in: .whitespaces) 26 | } 27 | 28 | /** 29 | 截取字符串 30 | 31 | - parameter range: 字符串范围 32 | 33 | - returns: 34 | */ 35 | public func substringWithRange(start: Int, length: Int) -> String! { 36 | return (self as NSString).substring(with: NSRange(location:start, length: length)) 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/Toast.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Toast.swift 3 | // STMyntBluetooth 4 | // 5 | // Created by gejw on 2017/6/8. 6 | // Copyright © 2017年 robinge. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Toast { 12 | 13 | class func show(message: String) { 14 | CRToastManager.showNotification(options: [kCRToastTextKey: message, 15 | kCRToastBackgroundColorKey: UIColor.red], completionBlock: nil) 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/en.lproj/MyntMainViewController.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UIButton"; normalTitle = "写入APN"; ObjectID = "1hp-nS-002"; */ 3 | "1hp-nS-002.normalTitle" = "Write APN values"; 4 | 5 | /* Class = "UIButton"; normalTitle = "写入报警次数"; ObjectID = "EuH-gr-j0h"; */ 6 | "EuH-gr-j0h.normalTitle" = "Write values of alsrm times"; 7 | 8 | /* Class = "UIButton"; normalTitle = "切换为BLE"; ObjectID = "I00-BR-8ba"; */ 9 | "I00-BR-8ba.normalTitle" = "Switch to BLE mode"; 10 | 11 | /* Class = "UIButton"; normalTitle = "写入铃声"; ObjectID = "KSA-j5-dvY"; */ 12 | "KSA-j5-dvY.normalTitle" = "Write values of ringtone"; 13 | 14 | /* Class = "UIButton"; normalTitle = "读取电量"; ObjectID = "Kzx-ex-Puz"; */ 15 | "Kzx-ex-Puz.normalTitle" = "Read value of battery quantity"; 16 | 17 | /* Class = "UIButton"; normalTitle = "写入报警延迟"; ObjectID = "L7S-DJ-aBW"; */ 18 | "L7S-DJ-aBW.normalTitle" = "Write values of how long will the alarm will be delayed when BT disconnected"; 19 | 20 | /* Class = "UIButton"; normalTitle = "报警"; ObjectID = "L9O-RW-VaB"; */ 21 | "L9O-RW-VaB.normalTitle" = "Alarm"; 22 | 23 | /* Class = "UIButton"; normalTitle = "读取定位间隔"; ObjectID = "VpN-gs-1kk"; */ 24 | "VpN-gs-1kk.normalTitle" = "Read the interval values of prositioning"; 25 | 26 | /* Class = "UIButton"; normalTitle = "检测网络"; ObjectID = "Xvk-yx-mon"; */ 27 | "Xvk-yx-mon.normalTitle" = "Detect network"; 28 | 29 | /* Class = "UIButton"; normalTitle = "读取控制"; ObjectID = "aNe-Sy-tcy"; */ 30 | "aNe-Sy-tcy.normalTitle" = "Read control event(Click, Double Click etc.)"; 31 | 32 | /* Class = "UIButton"; normalTitle = "写入绑定密钥"; ObjectID = "bRA-Hk-DcL"; */\ 33 | "bRA-Hk-DcL.normalTitle" = "Write bund key which used to verify whether the current connection is initiated by owner"; 34 | 35 | /* Class = "UILabel"; text = "GPS"; ObjectID = "cgP-v9-amg"; */ 36 | "cgP-v9-amg.text" = "GPS"; 37 | 38 | /* Class = "UIButton"; normalTitle = "同步时间"; ObjectID = "eV4-H1-aA3"; */ 39 | "eV4-H1-aA3.normalTitle" = "Sync Date"; 40 | 41 | /* Class = "UIButton"; normalTitle = "读取铃声"; ObjectID = "gjG-zT-dW2"; */ 42 | "gjG-zT-dW2.normalTitle" = "Read the ringtone values"; 43 | 44 | /* Class = "UIButton"; normalTitle = "清空日志"; ObjectID = "iV4-ZQ-ilm"; */ 45 | "iV4-ZQ-ilm.normalTitle" = "Clear the log"; 46 | 47 | /* Class = "UIButton"; normalTitle = "写入控制"; ObjectID = "j13-8E-RQQ"; */ 48 | "j13-8E-RQQ.normalTitle" = "Write control event (Click, Double Click etc.)"; 49 | 50 | /* Class = "UIButton"; normalTitle = "读取ICCID"; ObjectID = "jCJ-lf-Pao"; */ 51 | "jCJ-lf-Pao.normalTitle" = "Read ICCID values"; 52 | 53 | /* Class = "UIButton"; normalTitle = "写入定位间隔"; ObjectID = "mrm-V9-sXn"; */ 54 | "mrm-V9-sXn.normalTitle" = "Write the interval value of prositioning"; 55 | 56 | /* Class = "UIButton"; normalTitle = "关机"; ObjectID = "pIi-Z4-mxg"; */ 57 | "pIi-Z4-mxg.normalTitle" = "Power off"; 58 | 59 | /* Class = "UIButton"; normalTitle = "检测绑定密钥"; ObjectID = "q2y-Jn-PSK"; */ 60 | "q2y-Jn-PSK.normalTitle" = "Detect the bund key"; 61 | 62 | /* Class = "UILabel"; text = "Label"; ObjectID = "rwT-nl-JCj"; */ 63 | "rwT-nl-JCj.text" = "Label"; 64 | 65 | /* Class = "UIButton"; normalTitle = "更新固件"; ObjectID = "vw8-48-6jT"; */ 66 | "vw8-48-6jT.normalTitle" = "Update firmware"; 67 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/mynt-ios-demo-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import 6 | #import 7 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/zh-Hans.lproj/LaunchScreen.strings: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-ios-demo/zh-Hans.lproj/MyntMainViewController.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UIButton"; normalTitle = "写入APN"; ObjectID = "1hp-nS-002"; */ 3 | "1hp-nS-002.normalTitle" = "Write APN values"; 4 | 5 | /* Class = "UIButton"; normalTitle = "写入报警次数"; ObjectID = "EuH-gr-j0h"; */ 6 | "EuH-gr-j0h.normalTitle" = "Write values of alsrm times"; 7 | 8 | /* Class = "UIButton"; normalTitle = "切换为BLE"; ObjectID = "I00-BR-8ba"; */ 9 | "I00-BR-8ba.normalTitle" = "Switch to BLE mode"; 10 | 11 | /* Class = "UIButton"; normalTitle = "写入铃声"; ObjectID = "KSA-j5-dvY"; */ 12 | "KSA-j5-dvY.normalTitle" = "Write values of ringtone"; 13 | 14 | /* Class = "UIButton"; normalTitle = "读取电量"; ObjectID = "Kzx-ex-Puz"; */ 15 | "Kzx-ex-Puz.normalTitle" = "Read value of battery quantity"; 16 | 17 | /* Class = "UIButton"; normalTitle = "写入报警延迟"; ObjectID = "L7S-DJ-aBW"; */ 18 | "L7S-DJ-aBW.normalTitle" = "Write values of how long will the alarm will be delayed when BT disconnected"; 19 | 20 | /* Class = "UIButton"; normalTitle = "报警"; ObjectID = "L9O-RW-VaB"; */ 21 | "L9O-RW-VaB.normalTitle" = "Alarm"; 22 | 23 | /* Class = "UIButton"; normalTitle = "读取定位间隔"; ObjectID = "VpN-gs-1kk"; */ 24 | "VpN-gs-1kk.normalTitle" = "Read the interval values of prositioning"; 25 | 26 | /* Class = "UIButton"; normalTitle = "检测网络"; ObjectID = "Xvk-yx-mon"; */ 27 | "Xvk-yx-mon.normalTitle" = "Detect network"; 28 | 29 | /* Class = "UIButton"; normalTitle = "读取控制"; ObjectID = "aNe-Sy-tcy"; */ 30 | "aNe-Sy-tcy.normalTitle" = "Read control event(Click, Double Click etc.)"; 31 | 32 | /* Class = "UIButton"; normalTitle = "写入绑定密钥"; ObjectID = "bRA-Hk-DcL"; */\ 33 | "bRA-Hk-DcL.normalTitle" = "Write bund key which used to verify whether the current connection is initiated by owner"; 34 | 35 | /* Class = "UILabel"; text = "GPS"; ObjectID = "cgP-v9-amg"; */ 36 | "cgP-v9-amg.text" = "GPS"; 37 | 38 | /* Class = "UIButton"; normalTitle = "同步时间"; ObjectID = "eV4-H1-aA3"; */ 39 | "eV4-H1-aA3.normalTitle" = "Sync Date"; 40 | 41 | /* Class = "UIButton"; normalTitle = "读取铃声"; ObjectID = "gjG-zT-dW2"; */ 42 | "gjG-zT-dW2.normalTitle" = "Read the ringtone values"; 43 | 44 | /* Class = "UIButton"; normalTitle = "清空日志"; ObjectID = "iV4-ZQ-ilm"; */ 45 | "iV4-ZQ-ilm.normalTitle" = "Clear the log"; 46 | 47 | /* Class = "UIButton"; normalTitle = "写入控制"; ObjectID = "j13-8E-RQQ"; */ 48 | "j13-8E-RQQ.normalTitle" = "Write control event (Click, Double Click etc.)"; 49 | 50 | /* Class = "UIButton"; normalTitle = "读取ICCID"; ObjectID = "jCJ-lf-Pao"; */ 51 | "jCJ-lf-Pao.normalTitle" = "Read ICCID values"; 52 | 53 | /* Class = "UIButton"; normalTitle = "写入定位间隔"; ObjectID = "mrm-V9-sXn"; */ 54 | "mrm-V9-sXn.normalTitle" = "Write the interval value of prositioning"; 55 | 56 | /* Class = "UIButton"; normalTitle = "关机"; ObjectID = "pIi-Z4-mxg"; */ 57 | "pIi-Z4-mxg.normalTitle" = "Power off"; 58 | 59 | /* Class = "UIButton"; normalTitle = "检测绑定密钥"; ObjectID = "q2y-Jn-PSK"; */ 60 | "q2y-Jn-PSK.normalTitle" = "Detect the bund key"; 61 | 62 | /* Class = "UILabel"; text = "Label"; ObjectID = "rwT-nl-JCj"; */ 63 | "rwT-nl-JCj.text" = "Label"; 64 | 65 | /* Class = "UIButton"; normalTitle = "更新固件"; ObjectID = "vw8-48-6jT"; */ 66 | "vw8-48-6jT.normalTitle" = "Update firmware"; 67 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-osx-demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // mynt-osx-demo 4 | // 5 | // Created by gejw on 16/4/24. 6 | // Copyright © 2016年 slighech. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | @IBOutlet weak var window: NSWindow! 15 | @IBOutlet weak var tableView: NSTableView! 16 | var mynts = [STMynt]() 17 | 18 | func applicationDidFinishLaunching(aNotification: NSNotification) { 19 | // Insert code here to initialize your application 20 | 21 | let bluetooth = STMyntBluetooth.sharedInstance() 22 | bluetooth.delegate = self 23 | bluetooth.startScan() 24 | } 25 | 26 | func applicationWillTerminate(aNotification: NSNotification) { 27 | // Insert code here to tear down your application 28 | } 29 | 30 | } 31 | 32 | extension AppDelegate: NSTableViewDelegate, NSTableViewDataSource { 33 | 34 | } 35 | 36 | extension AppDelegate: STMyntBluetoothDelegate { 37 | 38 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didUpdateState state: CBCentralManagerState) { 39 | 40 | } 41 | 42 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didDiscoverTimeoutMynt mynt: STMynt) { 43 | 44 | } 45 | 46 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didDiscoverMynt mynt: STMynt) { 47 | if !mynts.contains(mynt) { 48 | mynts.append(mynt) 49 | } 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-osx-demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-osx-demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2016年 slighech. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-osx-demo/mynt-osx-demo-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import -------------------------------------------------------------------------------- /demo/mynt-demo/mynt-osx-demo/zh-Hans.lproj/MainMenu.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "NSMenuItem"; title = "Customize Toolbar…"; ObjectID = "1UK-8n-QPP"; */ 3 | "1UK-8n-QPP.title" = "Customize Toolbar…"; 4 | 5 | /* Class = "NSMenuItem"; title = "mynt-osx-demo"; ObjectID = "1Xt-HY-uBw"; */ 6 | "1Xt-HY-uBw.title" = "mynt-osx-demo"; 7 | 8 | /* Class = "NSMenu"; title = "Find"; ObjectID = "1b7-l0-nxx"; */ 9 | "1b7-l0-nxx.title" = "Find"; 10 | 11 | /* Class = "NSMenuItem"; title = "Lower"; ObjectID = "1tx-W0-xDw"; */ 12 | "1tx-W0-xDw.title" = "Lower"; 13 | 14 | /* Class = "NSMenuItem"; title = "Raise"; ObjectID = "2h7-ER-AoG"; */ 15 | "2h7-ER-AoG.title" = "Raise"; 16 | 17 | /* Class = "NSMenuItem"; title = "Transformations"; ObjectID = "2oI-Rn-ZJC"; */ 18 | "2oI-Rn-ZJC.title" = "Transformations"; 19 | 20 | /* Class = "NSMenu"; title = "Spelling"; ObjectID = "3IN-sU-3Bg"; */ 21 | "3IN-sU-3Bg.title" = "Spelling"; 22 | 23 | /* Class = "NSMenuItem"; title = "Use Default"; ObjectID = "3Om-Ey-2VK"; */ 24 | "3Om-Ey-2VK.title" = "Use Default"; 25 | 26 | /* Class = "NSMenu"; title = "Speech"; ObjectID = "3rS-ZA-NoH"; */ 27 | "3rS-ZA-NoH.title" = "Speech"; 28 | 29 | /* Class = "NSMenuItem"; title = "Tighten"; ObjectID = "46P-cB-AYj"; */ 30 | "46P-cB-AYj.title" = "Tighten"; 31 | 32 | /* Class = "NSMenuItem"; title = "Find"; ObjectID = "4EN-yA-p0u"; */ 33 | "4EN-yA-p0u.title" = "Find"; 34 | 35 | /* Class = "NSMenuItem"; title = "Quit mynt-osx-demo"; ObjectID = "4sb-4s-VLi"; */ 36 | "4sb-4s-VLi.title" = "Quit mynt-osx-demo"; 37 | 38 | /* Class = "NSMenuItem"; title = "Edit"; ObjectID = "5QF-Oa-p0T"; */ 39 | "5QF-Oa-p0T.title" = "Edit"; 40 | 41 | /* Class = "NSMenuItem"; title = "Copy Style"; ObjectID = "5Vv-lz-BsD"; */ 42 | "5Vv-lz-BsD.title" = "Copy Style"; 43 | 44 | /* Class = "NSMenuItem"; title = "About mynt-osx-demo"; ObjectID = "5kV-Vb-QxS"; */ 45 | "5kV-Vb-QxS.title" = "About mynt-osx-demo"; 46 | 47 | /* Class = "NSMenuItem"; title = "Redo"; ObjectID = "6dh-zS-Vam"; */ 48 | "6dh-zS-Vam.title" = "Redo"; 49 | 50 | /* Class = "NSMenuItem"; title = "Correct Spelling Automatically"; ObjectID = "78Y-hA-62v"; */ 51 | "78Y-hA-62v.title" = "Correct Spelling Automatically"; 52 | 53 | /* Class = "NSMenu"; title = "Writing Direction"; ObjectID = "8mr-sm-Yjd"; */ 54 | "8mr-sm-Yjd.title" = "Writing Direction"; 55 | 56 | /* Class = "NSMenuItem"; title = "Substitutions"; ObjectID = "9ic-FL-obx"; */ 57 | "9ic-FL-obx.title" = "Substitutions"; 58 | 59 | /* Class = "NSMenuItem"; title = "Smart Copy/Paste"; ObjectID = "9yt-4B-nSM"; */ 60 | "9yt-4B-nSM.title" = "Smart Copy/Paste"; 61 | 62 | /* Class = "NSMenu"; title = "Main Menu"; ObjectID = "AYu-sK-qS6"; */ 63 | "AYu-sK-qS6.title" = "Main Menu"; 64 | 65 | /* Class = "NSMenuItem"; title = "Preferences…"; ObjectID = "BOF-NM-1cW"; */ 66 | "BOF-NM-1cW.title" = "Preferences…"; 67 | 68 | /* Class = "NSMenuItem"; title = "\tLeft to Right"; ObjectID = "BgM-ve-c93"; */ 69 | "BgM-ve-c93.title" = "\tLeft to Right"; 70 | 71 | /* Class = "NSMenuItem"; title = "Save As…"; ObjectID = "Bw7-FT-i3A"; */ 72 | "Bw7-FT-i3A.title" = "Save As…"; 73 | 74 | /* Class = "NSMenuItem"; title = "Close"; ObjectID = "DVo-aG-piG"; */ 75 | "DVo-aG-piG.title" = "Close"; 76 | 77 | /* Class = "NSMenuItem"; title = "Spelling and Grammar"; ObjectID = "Dv1-io-Yv7"; */ 78 | "Dv1-io-Yv7.title" = "Spelling and Grammar"; 79 | 80 | /* Class = "NSMenu"; title = "Help"; ObjectID = "F2S-fz-NVQ"; */ 81 | "F2S-fz-NVQ.title" = "Help"; 82 | 83 | /* Class = "NSMenuItem"; title = "mynt-osx-demo Help"; ObjectID = "FKE-Sm-Kum"; */ 84 | "FKE-Sm-Kum.title" = "mynt-osx-demo Help"; 85 | 86 | /* Class = "NSMenuItem"; title = "Text"; ObjectID = "Fal-I4-PZk"; */ 87 | "Fal-I4-PZk.title" = "Text"; 88 | 89 | /* Class = "NSMenu"; title = "Substitutions"; ObjectID = "FeM-D8-WVr"; */ 90 | "FeM-D8-WVr.title" = "Substitutions"; 91 | 92 | /* Class = "NSMenuItem"; title = "Bold"; ObjectID = "GB9-OM-e27"; */ 93 | "GB9-OM-e27.title" = "Bold"; 94 | 95 | /* Class = "NSMenu"; title = "Format"; ObjectID = "GEO-Iw-cKr"; */ 96 | "GEO-Iw-cKr.title" = "Format"; 97 | 98 | /* Class = "NSMenuItem"; title = "Use Default"; ObjectID = "GUa-eO-cwY"; */ 99 | "GUa-eO-cwY.title" = "Use Default"; 100 | 101 | /* Class = "NSMenuItem"; title = "Font"; ObjectID = "Gi5-1S-RQB"; */ 102 | "Gi5-1S-RQB.title" = "Font"; 103 | 104 | /* Class = "NSMenuItem"; title = "Writing Direction"; ObjectID = "H1b-Si-o9J"; */ 105 | "H1b-Si-o9J.title" = "Writing Direction"; 106 | 107 | /* Class = "NSMenuItem"; title = "View"; ObjectID = "H8h-7b-M4v"; */ 108 | "H8h-7b-M4v.title" = "View"; 109 | 110 | /* Class = "NSMenuItem"; title = "Text Replacement"; ObjectID = "HFQ-gK-NFA"; */ 111 | "HFQ-gK-NFA.title" = "Text Replacement"; 112 | 113 | /* Class = "NSMenuItem"; title = "Show Spelling and Grammar"; ObjectID = "HFo-cy-zxI"; */ 114 | "HFo-cy-zxI.title" = "Show Spelling and Grammar"; 115 | 116 | /* Class = "NSMenu"; title = "View"; ObjectID = "HyV-fh-RgO"; */ 117 | "HyV-fh-RgO.title" = "View"; 118 | 119 | /* Class = "NSMenuItem"; title = "Subscript"; ObjectID = "I0S-gh-46l"; */ 120 | "I0S-gh-46l.title" = "Subscript"; 121 | 122 | /* Class = "NSMenuItem"; title = "Open…"; ObjectID = "IAo-SY-fd9"; */ 123 | "IAo-SY-fd9.title" = "Open…"; 124 | 125 | /* Class = "NSMenuItem"; title = "Justify"; ObjectID = "J5U-5w-g23"; */ 126 | "J5U-5w-g23.title" = "Justify"; 127 | 128 | /* Class = "NSMenuItem"; title = "Use None"; ObjectID = "J7y-lM-qPV"; */ 129 | "J7y-lM-qPV.title" = "Use None"; 130 | 131 | /* Class = "NSMenuItem"; title = "Revert to Saved"; ObjectID = "KaW-ft-85H"; */ 132 | "KaW-ft-85H.title" = "Revert to Saved"; 133 | 134 | /* Class = "NSMenuItem"; title = "Show All"; ObjectID = "Kd2-mp-pUS"; */ 135 | "Kd2-mp-pUS.title" = "Show All"; 136 | 137 | /* Class = "NSMenuItem"; title = "Bring All to Front"; ObjectID = "LE2-aR-0XJ"; */ 138 | "LE2-aR-0XJ.title" = "Bring All to Front"; 139 | 140 | /* Class = "NSMenuItem"; title = "Paste Ruler"; ObjectID = "LVM-kO-fVI"; */ 141 | "LVM-kO-fVI.title" = "Paste Ruler"; 142 | 143 | /* Class = "NSMenuItem"; title = "\tLeft to Right"; ObjectID = "Lbh-J2-qVU"; */ 144 | "Lbh-J2-qVU.title" = "\tLeft to Right"; 145 | 146 | /* Class = "NSTextFieldCell"; title = "Table View Cell"; ObjectID = "LqY-bX-dkR"; */ 147 | "LqY-bX-dkR.title" = "Table View Cell"; 148 | 149 | /* Class = "NSMenuItem"; title = "Copy Ruler"; ObjectID = "MkV-Pr-PK5"; */ 150 | "MkV-Pr-PK5.title" = "Copy Ruler"; 151 | 152 | /* Class = "NSMenuItem"; title = "Services"; ObjectID = "NMo-om-nkz"; */ 153 | "NMo-om-nkz.title" = "Services"; 154 | 155 | /* Class = "NSMenuItem"; title = "\tDefault"; ObjectID = "Nop-cj-93Q"; */ 156 | "Nop-cj-93Q.title" = "\tDefault"; 157 | 158 | /* Class = "NSMenuItem"; title = "Minimize"; ObjectID = "OY7-WF-poV"; */ 159 | "OY7-WF-poV.title" = "Minimize"; 160 | 161 | /* Class = "NSMenuItem"; title = "Baseline"; ObjectID = "OaQ-X3-Vso"; */ 162 | "OaQ-X3-Vso.title" = "Baseline"; 163 | 164 | /* Class = "NSMenuItem"; title = "Hide mynt-osx-demo"; ObjectID = "Olw-nP-bQN"; */ 165 | "Olw-nP-bQN.title" = "Hide mynt-osx-demo"; 166 | 167 | /* Class = "NSMenuItem"; title = "Find Previous"; ObjectID = "OwM-mh-QMV"; */ 168 | "OwM-mh-QMV.title" = "Find Previous"; 169 | 170 | /* Class = "NSMenuItem"; title = "Stop Speaking"; ObjectID = "Oyz-dy-DGm"; */ 171 | "Oyz-dy-DGm.title" = "Stop Speaking"; 172 | 173 | /* Class = "NSMenuItem"; title = "Bigger"; ObjectID = "Ptp-SP-VEL"; */ 174 | "Ptp-SP-VEL.title" = "Bigger"; 175 | 176 | /* Class = "NSMenuItem"; title = "Show Fonts"; ObjectID = "Q5e-8K-NDq"; */ 177 | "Q5e-8K-NDq.title" = "Show Fonts"; 178 | 179 | /* Class = "NSWindow"; title = "mynt-osx-demo"; ObjectID = "QvC-M9-y7g"; */ 180 | "QvC-M9-y7g.title" = "mynt-osx-demo"; 181 | 182 | /* Class = "NSMenuItem"; title = "Zoom"; ObjectID = "R4o-n2-Eq4"; */ 183 | "R4o-n2-Eq4.title" = "Zoom"; 184 | 185 | /* Class = "NSMenuItem"; title = "\tRight to Left"; ObjectID = "RB4-Sm-HuC"; */ 186 | "RB4-Sm-HuC.title" = "\tRight to Left"; 187 | 188 | /* Class = "NSMenuItem"; title = "Superscript"; ObjectID = "Rqc-34-cIF"; */ 189 | "Rqc-34-cIF.title" = "Superscript"; 190 | 191 | /* Class = "NSMenuItem"; title = "Select All"; ObjectID = "Ruw-6m-B2m"; */ 192 | "Ruw-6m-B2m.title" = "Select All"; 193 | 194 | /* Class = "NSMenuItem"; title = "Jump to Selection"; ObjectID = "S0p-oC-mLd"; */ 195 | "S0p-oC-mLd.title" = "Jump to Selection"; 196 | 197 | /* Class = "NSMenu"; title = "Window"; ObjectID = "Td7-aD-5lo"; */ 198 | "Td7-aD-5lo.title" = "Window"; 199 | 200 | /* Class = "NSMenuItem"; title = "Capitalize"; ObjectID = "UEZ-Bs-lqG"; */ 201 | "UEZ-Bs-lqG.title" = "Capitalize"; 202 | 203 | /* Class = "NSMenuItem"; title = "Center"; ObjectID = "VIY-Ag-zcb"; */ 204 | "VIY-Ag-zcb.title" = "Center"; 205 | 206 | /* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "Vdr-fp-XzO"; */ 207 | "Vdr-fp-XzO.title" = "Hide Others"; 208 | 209 | /* Class = "NSMenuItem"; title = "Italic"; ObjectID = "Vjx-xi-njq"; */ 210 | "Vjx-xi-njq.title" = "Italic"; 211 | 212 | /* Class = "NSMenu"; title = "Edit"; ObjectID = "W48-6f-4Dl"; */ 213 | "W48-6f-4Dl.title" = "Edit"; 214 | 215 | /* Class = "NSMenuItem"; title = "Underline"; ObjectID = "WRG-CD-K1S"; */ 216 | "WRG-CD-K1S.title" = "Underline"; 217 | 218 | /* Class = "NSMenuItem"; title = "New"; ObjectID = "Was-JA-tGl"; */ 219 | "Was-JA-tGl.title" = "New"; 220 | 221 | /* Class = "NSMenuItem"; title = "Paste and Match Style"; ObjectID = "WeT-3V-zwk"; */ 222 | "WeT-3V-zwk.title" = "Paste and Match Style"; 223 | 224 | /* Class = "NSMenuItem"; title = "Find…"; ObjectID = "Xz5-n4-O0W"; */ 225 | "Xz5-n4-O0W.title" = "Find…"; 226 | 227 | /* Class = "NSMenuItem"; title = "Find and Replace…"; ObjectID = "YEy-JH-Tfz"; */ 228 | "YEy-JH-Tfz.title" = "Find and Replace…"; 229 | 230 | /* Class = "NSMenuItem"; title = "\tDefault"; ObjectID = "YGs-j5-SAR"; */ 231 | "YGs-j5-SAR.title" = "\tDefault"; 232 | 233 | /* Class = "NSMenuItem"; title = "Start Speaking"; ObjectID = "Ynk-f8-cLZ"; */ 234 | "Ynk-f8-cLZ.title" = "Start Speaking"; 235 | 236 | /* Class = "NSMenuItem"; title = "Align Left"; ObjectID = "ZM1-6Q-yy1"; */ 237 | "ZM1-6Q-yy1.title" = "Align Left"; 238 | 239 | /* Class = "NSMenuItem"; title = "Paragraph"; ObjectID = "ZvO-Gk-QUH"; */ 240 | "ZvO-Gk-QUH.title" = "Paragraph"; 241 | 242 | /* Class = "NSMenuItem"; title = "Print…"; ObjectID = "aTl-1u-JFS"; */ 243 | "aTl-1u-JFS.title" = "Print…"; 244 | 245 | /* Class = "NSMenuItem"; title = "Window"; ObjectID = "aUF-d1-5bR"; */ 246 | "aUF-d1-5bR.title" = "Window"; 247 | 248 | /* Class = "NSMenu"; title = "Font"; ObjectID = "aXa-aM-Jaq"; */ 249 | "aXa-aM-Jaq.title" = "Font"; 250 | 251 | /* Class = "NSMenuItem"; title = "Use Default"; ObjectID = "agt-UL-0e3"; */ 252 | "agt-UL-0e3.title" = "Use Default"; 253 | 254 | /* Class = "NSMenuItem"; title = "Show Colors"; ObjectID = "bgn-CT-cEk"; */ 255 | "bgn-CT-cEk.title" = "Show Colors"; 256 | 257 | /* Class = "NSMenu"; title = "File"; ObjectID = "bib-Uj-vzu"; */ 258 | "bib-Uj-vzu.title" = "File"; 259 | 260 | /* Class = "NSMenuItem"; title = "Use Selection for Find"; ObjectID = "buJ-ug-pKt"; */ 261 | "buJ-ug-pKt.title" = "Use Selection for Find"; 262 | 263 | /* Class = "NSMenu"; title = "Transformations"; ObjectID = "c8a-y6-VQd"; */ 264 | "c8a-y6-VQd.title" = "Transformations"; 265 | 266 | /* Class = "NSMenuItem"; title = "Use None"; ObjectID = "cDB-IK-hbR"; */ 267 | "cDB-IK-hbR.title" = "Use None"; 268 | 269 | /* Class = "NSMenuItem"; title = "Selection"; ObjectID = "cqv-fj-IhA"; */ 270 | "cqv-fj-IhA.title" = "Selection"; 271 | 272 | /* Class = "NSMenuItem"; title = "Smart Links"; ObjectID = "cwL-P1-jid"; */ 273 | "cwL-P1-jid.title" = "Smart Links"; 274 | 275 | /* Class = "NSMenuItem"; title = "Make Lower Case"; ObjectID = "d9M-CD-aMd"; */ 276 | "d9M-CD-aMd.title" = "Make Lower Case"; 277 | 278 | /* Class = "NSMenu"; title = "Text"; ObjectID = "d9c-me-L2H"; */ 279 | "d9c-me-L2H.title" = "Text"; 280 | 281 | /* Class = "NSMenuItem"; title = "File"; ObjectID = "dMs-cI-mzQ"; */ 282 | "dMs-cI-mzQ.title" = "File"; 283 | 284 | /* Class = "NSMenuItem"; title = "Undo"; ObjectID = "dRJ-4n-Yzg"; */ 285 | "dRJ-4n-Yzg.title" = "Undo"; 286 | 287 | /* Class = "NSMenuItem"; title = "Paste"; ObjectID = "gVA-U4-sdL"; */ 288 | "gVA-U4-sdL.title" = "Paste"; 289 | 290 | /* Class = "NSMenuItem"; title = "Smart Quotes"; ObjectID = "hQb-2v-fYv"; */ 291 | "hQb-2v-fYv.title" = "Smart Quotes"; 292 | 293 | /* Class = "NSMenuItem"; title = "Check Document Now"; ObjectID = "hz2-CU-CR7"; */ 294 | "hz2-CU-CR7.title" = "Check Document Now"; 295 | 296 | /* Class = "NSMenu"; title = "Services"; ObjectID = "hz9-B4-Xy5"; */ 297 | "hz9-B4-Xy5.title" = "Services"; 298 | 299 | /* Class = "NSMenuItem"; title = "Smaller"; ObjectID = "i1d-Er-qST"; */ 300 | "i1d-Er-qST.title" = "Smaller"; 301 | 302 | /* Class = "NSMenu"; title = "Baseline"; ObjectID = "ijk-EB-dga"; */ 303 | "ijk-EB-dga.title" = "Baseline"; 304 | 305 | /* Class = "NSMenuItem"; title = "Kern"; ObjectID = "jBQ-r6-VK2"; */ 306 | "jBQ-r6-VK2.title" = "Kern"; 307 | 308 | /* Class = "NSMenuItem"; title = "\tRight to Left"; ObjectID = "jFq-tB-4Kx"; */ 309 | "jFq-tB-4Kx.title" = "\tRight to Left"; 310 | 311 | /* Class = "NSMenuItem"; title = "Format"; ObjectID = "jxT-CU-nIS"; */ 312 | "jxT-CU-nIS.title" = "Format"; 313 | 314 | /* Class = "NSMenuItem"; title = "Check Grammar With Spelling"; ObjectID = "mK6-2p-4JG"; */ 315 | "mK6-2p-4JG.title" = "Check Grammar With Spelling"; 316 | 317 | /* Class = "NSMenuItem"; title = "Ligatures"; ObjectID = "o6e-r0-MWq"; */ 318 | "o6e-r0-MWq.title" = "Ligatures"; 319 | 320 | /* Class = "NSMenu"; title = "Open Recent"; ObjectID = "oas-Oc-fiZ"; */ 321 | "oas-Oc-fiZ.title" = "Open Recent"; 322 | 323 | /* Class = "NSMenuItem"; title = "Loosen"; ObjectID = "ogc-rX-tC1"; */ 324 | "ogc-rX-tC1.title" = "Loosen"; 325 | 326 | /* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "pLL-AC-sO6"; */ 327 | "pLL-AC-sO6.title" = "Text Cell"; 328 | 329 | /* Class = "NSMenuItem"; title = "Delete"; ObjectID = "pa3-QI-u2k"; */ 330 | "pa3-QI-u2k.title" = "Delete"; 331 | 332 | /* Class = "NSMenuItem"; title = "Save…"; ObjectID = "pxx-59-PXV"; */ 333 | "pxx-59-PXV.title" = "Save…"; 334 | 335 | /* Class = "NSMenuItem"; title = "Find Next"; ObjectID = "q09-fT-Sye"; */ 336 | "q09-fT-Sye.title" = "Find Next"; 337 | 338 | /* Class = "NSMenuItem"; title = "Page Setup…"; ObjectID = "qIS-W8-SiK"; */ 339 | "qIS-W8-SiK.title" = "Page Setup…"; 340 | 341 | /* Class = "NSMenuItem"; title = "Check Spelling While Typing"; ObjectID = "rbD-Rh-wIN"; */ 342 | "rbD-Rh-wIN.title" = "Check Spelling While Typing"; 343 | 344 | /* Class = "NSMenuItem"; title = "Smart Dashes"; ObjectID = "rgM-f4-ycn"; */ 345 | "rgM-f4-ycn.title" = "Smart Dashes"; 346 | 347 | /* Class = "NSMenuItem"; title = "Show Toolbar"; ObjectID = "snW-S8-Cw5"; */ 348 | "snW-S8-Cw5.title" = "Show Toolbar"; 349 | 350 | /* Class = "NSMenuItem"; title = "Data Detectors"; ObjectID = "tRr-pd-1PS"; */ 351 | "tRr-pd-1PS.title" = "Data Detectors"; 352 | 353 | /* Class = "NSMenuItem"; title = "Open Recent"; ObjectID = "tXI-mr-wws"; */ 354 | "tXI-mr-wws.title" = "Open Recent"; 355 | 356 | /* Class = "NSMenu"; title = "Kern"; ObjectID = "tlD-Oa-oAM"; */ 357 | "tlD-Oa-oAM.title" = "Kern"; 358 | 359 | /* Class = "NSMenu"; title = "mynt-osx-demo"; ObjectID = "uQy-DD-JDr"; */ 360 | "uQy-DD-JDr.title" = "mynt-osx-demo"; 361 | 362 | /* Class = "NSMenuItem"; title = "Cut"; ObjectID = "uRl-iY-unG"; */ 363 | "uRl-iY-unG.title" = "Cut"; 364 | 365 | /* Class = "NSMenuItem"; title = "Paste Style"; ObjectID = "vKC-jM-MkH"; */ 366 | "vKC-jM-MkH.title" = "Paste Style"; 367 | 368 | /* Class = "NSMenuItem"; title = "Show Ruler"; ObjectID = "vLm-3I-IUL"; */ 369 | "vLm-3I-IUL.title" = "Show Ruler"; 370 | 371 | /* Class = "NSMenuItem"; title = "Clear Menu"; ObjectID = "vNY-rz-j42"; */ 372 | "vNY-rz-j42.title" = "Clear Menu"; 373 | 374 | /* Class = "NSMenuItem"; title = "Make Upper Case"; ObjectID = "vmV-6d-7jI"; */ 375 | "vmV-6d-7jI.title" = "Make Upper Case"; 376 | 377 | /* Class = "NSMenu"; title = "Ligatures"; ObjectID = "w0m-vy-SC9"; */ 378 | "w0m-vy-SC9.title" = "Ligatures"; 379 | 380 | /* Class = "NSMenuItem"; title = "Align Right"; ObjectID = "wb2-vD-lq4"; */ 381 | "wb2-vD-lq4.title" = "Align Right"; 382 | 383 | /* Class = "NSMenuItem"; title = "Help"; ObjectID = "wpr-3q-Mcd"; */ 384 | "wpr-3q-Mcd.title" = "Help"; 385 | 386 | /* Class = "NSMenuItem"; title = "Copy"; ObjectID = "x3v-GG-iWU"; */ 387 | "x3v-GG-iWU.title" = "Copy"; 388 | 389 | /* Class = "NSMenuItem"; title = "Use All"; ObjectID = "xQD-1f-W4t"; */ 390 | "xQD-1f-W4t.title" = "Use All"; 391 | 392 | /* Class = "NSMenuItem"; title = "Speech"; ObjectID = "xrE-MZ-jX0"; */ 393 | "xrE-MZ-jX0.title" = "Speech"; 394 | 395 | /* Class = "NSMenuItem"; title = "Show Substitutions"; ObjectID = "z6F-FW-3nz"; */ 396 | "z6F-FW-3nz.title" = "Show Substitutions"; 397 | -------------------------------------------------------------------------------- /doc/readme_cn.md: -------------------------------------------------------------------------------- 1 | # 如何使用SDK 2 | 3 | ## Enum 4 | > [查看定义](readme_cn_3.md) 5 | 6 | ## STMyntBluetooth 7 | > STMyntBluetooth 使用了单例模式 8 | 9 | ``` 10 | STMyntBluetooth.sharedInstance() 11 | ``` 12 | ### - (void)startScan; 13 | > 使用``startScan ``进行设备搜索,不单单是搜索周边设备,如果您的小觅已经被系统层连接,也会被搜索到 14 | 15 | ``` 16 | STMyntBluetooth.sharedInstance().startScan() 17 | ``` 18 | 19 | ### - (void)stopScan; 20 | > 如果需要停止扫描 则调用``stopScan `` 21 | 22 | ``` 23 | STMyntBluetooth.sharedInstance().stopScan() 24 | ``` 25 | 26 | ### @property (nonatomic, assign) BOOL isScanning; 27 | > 你可以通过 ``isScanning `` 来判断 是否正在扫描 28 | > 29 | > ⚠️: 如果蓝牙被关闭了,但是你没有停止搜索,这个状态还是会为true 30 | 31 | ``` 32 | STMyntBluetooth.sharedInstance().isScanning 33 | ``` 34 | 35 | ### @property (nonatomic, assign) CBCentralManagerState centralState; 36 | > 如果你想知道现在的蓝牙状态 可以通过 ``centralState `` 来获取 37 | 38 | ``` 39 | STMyntBluetooth.sharedInstance().centralState 40 | ``` 41 | 42 | ### @property (nonatomic, assign) BOOL reportLost; 43 | > 如果你需要将SDK设置为公益寻找,即帮助他人一起寻找丢失的小觅,你可以将``reportLost ``设置为true 44 | 45 | ``` 46 | STMyntBluetooth.sharedInstance(). reportLost = true 47 | ``` 48 | 49 | ### - (NSArray * _Nullable)retrieveConnectedMynts; 50 | > 获取已连接的小觅,不单单是被app绑定的小觅,包含系统中已连接的小觅也会一起返回 51 | 52 | ``` 53 | let mynts = STMyntBluetooth.sharedInstance().retrieveConnectedMynts() 54 | ``` 55 | 56 | ### - (STMynt * _Nullable)findMyntWithSn:(NSString *_Nonnull)sn; 57 | > 你可以通过sn来查询STMynt 58 | 59 | ``` 60 | let mynt = STMyntBluetooth.sharedInstance().findMyntWithSn("K043E9H9A0") 61 | ``` 62 | ### @property (nonatomic, weak, nullable) id\ delegate; 63 | > [STMyntBluetoothDelegate](readme_cn_1.md) 64 | 65 | --- 66 | ## STMynt 67 | 68 | ### @property (nonatomic, strong, readonly, nonnull) NSString *name; 69 | > 小觅的名字 70 | 71 | ``` 72 | mynt.name 73 | ``` 74 | 75 | ### @property (nonatomic, assign) NSInteger RSSI; 76 | > 小觅的信号强度 77 | 78 | ``` 79 | mynt.RSSI 80 | ``` 81 | 82 | ### @property (nonatomic, assign, readonly) MYNTFirmwareType firmwareType; 83 | > 小觅的固件版本 84 | 85 | ``` 86 | mynt.firmwareType 87 | ``` 88 | 89 | ### @property (nonatomic, assign, readonly) MYNTHardwareType hardwareType; 90 | > 小觅的硬件版本 [通过芯片区分 CC25芯片, CC26芯片] 91 | > 92 | > ⚠️: 市面上只有CC26xx的芯片在流通 93 | 94 | ``` 95 | mynt.hardwareType 96 | ``` 97 | 98 | ### @property (nonatomic, assign, readonly) MYNTState state; 99 | > 小觅的链接状态 100 | 101 | ``` 102 | mynt.state 103 | ``` 104 | 105 | ### @property (nonatomic, assign, readonly) NSInteger battery; 106 | > 小觅的电量 107 | 108 | ``` 109 | mynt.battery 110 | ``` 111 | 112 | ### @property (nonatomic, assign, readonly) MYNTControlMode controlMode; 113 | > 小觅的控制模式 114 | 115 | ``` 116 | mynt.controlMode 117 | ``` 118 | 119 | ### @property (nonatomic, assign, readonly) MYNTClickValue click; 120 | > 小觅的单击事件 121 | 122 | ``` 123 | mynt.click 124 | ``` 125 | 126 | ### @property (nonatomic, assign, readonly) MYNTClickValue doubleClick; 127 | > 小觅的双击事件 128 | 129 | ``` 130 | mynt.doubleClick 131 | ``` 132 | 133 | ### @property (nonatomic, assign, readonly) MYNTClickValue tripleClick; 134 | > 小觅的三击事件 135 | 136 | ``` 137 | mynt.tripleClick 138 | ``` 139 | 140 | ### @property (nonatomic, assign, readonly) MYNTClickValue hold; 141 | > 小觅的长按事件 142 | 143 | ``` 144 | mynt.hold 145 | ``` 146 | 147 | ### @property (nonatomic, assign, readonly) MYNTClickValue clickHold; 148 | > 小觅的单击+长按事件 149 | 150 | ``` 151 | mynt.clickHold 152 | ``` 153 | 154 | ### @property (nonatomic, strong, readonly, nullable) NSString *manufaturer; 155 | > 小觅的制造商 156 | 157 | ``` 158 | mynt.manufaturer 159 | ``` 160 | 161 | ### @property (nonatomic, strong, readonly, nullable) NSString *model; 162 | > 小觅的型号 163 | 164 | ``` 165 | mynt.model 166 | ``` 167 | 168 | ### @property (nonatomic, strong, readonly, nonnull) NSString *sn; 169 | > 小觅的sn 170 | 171 | ``` 172 | mynt.sn 173 | ``` 174 | 175 | ### @property (nonatomic, strong, readonly, nullable) NSString *firmware; 176 | > 小觅的固件信息(BLE-26XX-2.1.0) 177 | 178 | ``` 179 | mynt.firmware 180 | ``` 181 | 182 | ### @property (nonatomic, strong, readonly, nullable) NSString *hardware; 183 | > 小觅固件打包时间信息(16041516:xx(年) xx(月) xx(日) xx(小时)) 184 | 185 | ``` 186 | mynt.hardware 187 | ``` 188 | 189 | ### @property (nonatomic, strong, readonly, nullable) NSString *software; 190 | > 小觅的固件版本信息 191 | 192 | ``` 193 | mynt.software 194 | ``` 195 | 196 | ### @property (nonatomic, assign) BOOL isDiscovering; 197 | > 一个标志位,用于查看mynt是否被发现 198 | 199 | ``` 200 | mynt.isDiscovering 201 | ``` 202 | 203 | ### @property (nonatomic, weak, nullable) id\ delegate; 204 | > [STMyntDelegate](readme_cn_2.md) 205 | 206 | ### - (void)connect; 207 | > 连接小觅 208 | 209 | ``` 210 | mynt.connect() 211 | ``` 212 | 213 | ### - (void)disconnect; 214 | > 断开小觅的连接 215 | 216 | ``` 217 | mynt.disconnect() 218 | ``` 219 | 220 | ### - (void)toggleAlarm:(BOOL)alarm; 221 | > 让小觅报警(一般用于找小觅 小觅会持续报警40秒后停止,你也可以手动小觅的按钮取消报警) 222 | 223 | ``` 224 | mynt.toggleAlarm(true) 225 | ``` 226 | 227 | ### - (void)writeAlarmCount:(NSInteger)count; 228 | > 设置小觅断线后的报警次数 229 | > 230 | > ⚠️: 用于防丢场景 231 | 232 | ``` 233 | mynt.writeAlarmCount(3) 234 | ``` 235 | 236 | ### - (void)writeAlarmDelay:(NSInteger)seconds; 237 | > 设置小觅断线后的报警延迟时间 238 | > 239 | > ⚠️: 用于防丢场景,根据蓝牙的性能不同,为了防止误报,iOS一般设置为15S,Androd设备一般设置为40S. 240 | 241 | ``` 242 | mynt.writeAlarmDelay(20) 243 | ``` 244 | 245 | ### - (void)writeControlMode:(MYNTControlMode)mode; 246 | > 设置小觅的控制模式,当控制模式为Custom时 小觅的自定义点击事件才会生效 247 | 248 | ``` 249 | mynt?.writeControlMode(.Music) 250 | ``` 251 | 252 | ### - (void)writeClickValue:(MYNTClickEvent)clickEvent eventValue:(MYNTClickValue)eventValue; 253 | > 单独设置小觅的点击事件 254 | > 255 | > ⚠️: 如果设置了点击事件,小觅的控制模式将自动切换为Custom 256 | > 257 | > ⚠️: 当且仅当小觅的Controlmode是Custom时,并且eventValue也是Custom时,当用户点击小觅上的按钮时,才会通过``mynt:didReceiveClickEvent:``通知你是单击事件or其他事件。 258 | 259 | ``` 260 | mynt?.writeClickValue(.Click, eventValue: .MusicNext) 261 | ``` 262 | 263 | ### - (void)writeClickValue:(MYNTClickValue)click doubleClick:(MYNTClickValue)doubleClick tripleClick:(MYNTClickValue)tripleClick hold:(MYNTClickValue)hold clickHold:(MYNTClickValue)clickHold; 264 | > 同时设置小觅的5个点击事件 265 | > 266 | > ⚠️: 如果设置了点击事件,小觅的控制模式将自动切换为Custom 267 | > 268 | > ⚠️: 当且仅当小觅的Controlmode是Custom时,并且eventValue也是Custom时,当用户点击小觅上的按钮时,才会通过``mynt:didReceiveClickEvent:``通知你是单击事件or其他事件。 269 | 270 | ``` 271 | mynt?.writeClickValue(.MusicPlay, doubleClick: .MusicPlay, tripleClick: .MusicPlay, hold: .MusicPlay, clickHold: .MusicPlay) 272 | ``` 273 | 274 | ### - (void)readBattery:(void (^ _Nullable)(NSInteger battery))battery; 275 | > 读取电池电量 276 | 277 | ``` 278 | mynt?.readBattery({ (battery) in 279 | NSLog("current battery -> \(battery)") 280 | }) 281 | 282 | ``` 283 | 284 | ### - (void)readRSSI; 285 | > 读取信号强度RSSI值 286 | > 287 | > ⚠️: 信号强度会在 ``mynt:didUpdateRSSI:``中回调 288 | 289 | ``` 290 | mynt.readRSSI() 291 | ``` 292 | 293 | ### - (void)readMyntInfo:(MYNTInfoType)type handler:(void(^ _Nullable)(NSString * _Nullable))handler; 294 | > 读取小觅的设备信息,可以读取的值: 厂商、型号、序列号、硬件信息、软件信息、固件信息 295 | 296 | ``` 297 | mynt?.readMyntInfo(.Manufaturer, handler: { (info) in 298 | NSLog("manufaturer -> \(info)") 299 | }) 300 | ``` 301 | 302 | ### - (void)readControlMode:(void(^ _Nullable)(MYNTControlMode mode))handler; 303 | > 读取小觅的控制模式 304 | 305 | ``` 306 | mynt?.readControlMode({ (controlMode) in 307 | NSLog("current controlmode -> \(controlMode)") 308 | }) 309 | ``` 310 | 311 | ### - (void)readClickValue:(void(^ _Nullable)(MYNTClickValue click, MYNTClickValue doubleClick, MYNTClickValue tripleClick, MYNTClickValue hold, MYNTClickValue clickHold))handler; 312 | > 读取小觅的点击设置 313 | 314 | ``` 315 | mynt?.readClickValue({ (click, doubleClick, tripleClick, hold, clickHold) in 316 | NSLog("click -> \(click) doubleClick -> \(doubleClick) tripleClick -> \(tripleClick) hold -> \(hold) clickHold -> \(clickHold)") 317 | }) 318 | ``` 319 | -------------------------------------------------------------------------------- /doc/readme_cn_1.md: -------------------------------------------------------------------------------- 1 | # STMyntBluetoothDelegate 2 | 3 | ``` 4 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didUpdateState state: CBCentralManagerState) { 5 | // 蓝牙状态更新 (蓝牙关闭,蓝牙打开等等) 6 | } 7 | 8 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didDiscoverMynt mynt: STMynt) { 9 | // 发现设备 10 | } 11 | 12 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didDiscoverTimeoutMynt mynt: STMynt) { 13 | // 设备发现超时 14 | } 15 | 16 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didFilterMyntWithSn sn: String) -> Bool { 17 | // 如果需要过滤mynt 实现这个方法 18 | } 19 | ``` 20 | -------------------------------------------------------------------------------- /doc/readme_cn_2.md: -------------------------------------------------------------------------------- 1 | # STMyntDelegate 2 | 3 | func myntDidStartConnect(mynt: STMynt) { 4 | // 开始连接 5 | } 6 | 7 | func myntDidConnected(mynt: STMynt) { 8 | // 连接成功 9 | } 10 | 11 | func mynt(mynt: STMynt, didConnectFailed error: NSError?) { 12 | // 连接失败 13 | } 14 | 15 | func mynt(mynt: STMynt, didDisconnected error: NSError?) { 16 | // 断开连接 17 | } 18 | 19 | func mynt(mynt: STMynt, didUpdateRSSI RSSI: Int) { 20 | // 更新RSSI 21 | } 22 | 23 | func mynt(mynt: STMynt, didUpdateBattery battery: Int) { 24 | // 电池更新 25 | } 26 | 27 | func mynt(mynt: STMynt, didUpdateAlarmState alarmState: Bool) { 28 | // 更新报警状态 29 | } 30 | 31 | func mynt(mynt: STMynt, didReceiveClickEvent clickEvent: MYNTClickEvent) { 32 | // ⚠️: 如果controlMode为Custom 33 | // ⚠️: 并且clickValue为CustomClick 34 | // 当点击了小觅的按钮,这个方法会回调 35 | } 36 | 37 | func didRequestAutoconnect(mynt: STMynt) -> Bool { 38 | // 如果你需要小觅自动重连,则需要返回true,反之,返回false 手动调用disconnect时 不会自动重连 39 | return true 40 | } 41 | 42 | func didNeedRestartBluetooth(mynt: STMynt) { 43 | // 遇到连接异常的时候,会回调这个方法,你可以在这里通知用户重启蓝牙或者重启手机来保持蓝牙的稳定性 44 | } -------------------------------------------------------------------------------- /doc/readme_cn_3.md: -------------------------------------------------------------------------------- 1 | # Enum 2 | 3 | ## MYNTClickValue 4 | > 点击事件对应的值 5 | 6 | ``` 7 | typedef NS_ENUM(NSInteger, MYNTClickValue) { 8 | // 无内容 9 | MYNTClickValueNone = 0x00, 10 | // 音乐播放 11 | MYNTClickValueMusicPlay = 0x01, 12 | // 下一曲 13 | MYNTClickValueMusicNext = 0x02, 14 | // 上一曲 15 | MYNTClickValueMusicPrevious = 0x03, 16 | // 音量增大 17 | MYNTClickValueMusicVolumeUp = 0x04, 18 | // 音量减小 19 | MYNTClickValueMusicVolumeDown = 0x05, 20 | // 拍照 21 | MYNTClickValueCameraShutter = 0x09, 22 | // 连拍 23 | MYNTClickValueCameraBurst = 0x0A, 24 | // PPT 下一页 25 | MYNTClickValuePPTNextPage = 0x06, 26 | // PPT 上一页 27 | MYNTClickValuePPTPreviousPage = 0x07, 28 | // 退出PPT 29 | MYNTClickValuePPTExit = 0x08, 30 | // 自定义按键 31 | MYNTClickValueCustomClick = 0xB0 32 | }; 33 | ``` 34 | 35 | ## MYNTControlMode 36 | > 控制模式 37 | 38 | | | 单击 | 双击 | 三击 | 长按 | 单击长按 | 39 | |:---:|:------:|:-------:|:-----:|:-----:|:-------:| 40 | | 音乐 | 播放 | 下一曲 | 上一曲 | 音量加 | 音量减 | 41 | | 相机 | 快门 | / | / | 连拍 | / | 42 | | PPT | 下一页 | 上一页 | / | 退出 | / | 43 | | 默认 | 播放 | 下一曲 | 上一曲 | / | 音量减 | 44 | > 自定义: 自己设置的ClickValue 45 | 46 | ``` 47 | typedef NS_ENUM(NSInteger, MYNTControlMode) { 48 | // 音乐控制 49 | MYNTControlModeMusic = 0x01, 50 | // 控制相机 51 | MYNTControlModeCamera = 0x02, 52 | // 控制PPT 53 | MYNTControlModePPT = 0x03, 54 | // 自定义 55 | MYNTControlModeCustom = 0x04, 56 | // 默认 57 | MYNTControlModeDefault = 0x05, 58 | }; 59 | ``` 60 | 61 | ## MYNTClickEvent 62 | > 点击事件 63 | 64 | ``` 65 | typedef NS_ENUM(NSInteger, MYNTClickEvent) { 66 | // 单击 67 | MYNTClickEventClick = 0x01, 68 | // 双击 69 | MYNTClickEventDoubleClick = 0x02, 70 | // 三击 71 | MYNTClickEventTripleClick = 0x03, 72 | // 长按 73 | MYNTClickEventHold = 0x09, 74 | // 单击长按 75 | MYNTClickEventClickHold 76 | }; 77 | ``` 78 | 79 | ## MYNTInfoType 80 | > 设备信息类型 81 | 82 | ``` 83 | typedef NS_ENUM(NSInteger, MYNTInfoType) { 84 | // 厂商信息 85 | MYNTInfoTypeManufaturer = 0x00, 86 | // 设备型号 87 | MYNTInfoTypeModel, 88 | // 设备序列号 89 | MYNTInfoTypeSn, 90 | // 固件信息 91 | MYNTInfoTypeFirmware, 92 | // 硬件信息 93 | MYNTInfoTypeHardware, 94 | // 软件信息 95 | MYNTInfoTypeSoftware, 96 | }; 97 | ``` 98 | 99 | ## MYNTState 100 | > 小觅的连接状态 101 | 102 | ``` 103 | typedef NS_ENUM(NSInteger, MYNTState) { 104 | // 断开连接 105 | MYNTStateDisconnected = 0x00, 106 | // 连接中 107 | MYNTStateConnecting, 108 | // 连接成功 109 | MYNTStateConnected, 110 | }; 111 | ``` -------------------------------------------------------------------------------- /doc/readme_cn_install.md: -------------------------------------------------------------------------------- 1 | 2 | ## 安装 3 | 4 | ### CocoaPods 5 | 6 | 1. 在 Podfile 中添加 `pod 'MYNT-SDK-IOS'`。 7 | 2. 执行 `pod install` 或 `pod update`. 8 | 3. 导入 \. 9 | 10 | 11 | ### 手动安装 12 | 13 | 1. 下载 `MYNT-SDK-IOS` 文件夹内的所有内容。 14 | 2. 将 `MYNT-SDK-IOS` 内的源文件添加(拖放)到你的工程。 15 | 3. 加入frameworks: 16 | 17 | > ios 18 | 19 | * CoreBluetooth 20 | * sqlite3 21 | 22 | > osx 23 | 24 | * IOBluetooth 25 | * sqlite3 26 | 4. 添加 **-ObjC** 27 | 28 | Build Settings -> Other Linker Flags 29 | 30 | add -ObjC 31 | 32 | 5. 导入 `STMyntBluetooth.h`. 33 | 34 | ## 系统要求 35 | 该项目最低支持 `iOS 7.0` 和 `OSX 10.9`。 36 | 37 | ###[文档](readme_cn.md) -------------------------------------------------------------------------------- /doc/readme_en.md: -------------------------------------------------------------------------------- 1 | # How to use the SDK 2 | 3 | ## Enum 4 | > [see](readme_en_3.md) 5 | 6 | ## STMyntBluetooth 7 | > The STMyntBluetooth is a singleton 8 | 9 | ``` 10 | STMyntBluetooth.sharedInstance() 11 | ``` 12 | ### - (void)startScan; 13 | > Use to start scanning mynt (if mynt has paired in system, always return). 14 | 15 | ``` 16 | STMyntBluetooth.sharedInstance().startScan() 17 | ``` 18 | 19 | ### - (void)stopScan; 20 | > Use to stop scanning mynt. 21 | 22 | ``` 23 | STMyntBluetooth.sharedInstance().stopScan() 24 | ``` 25 | 26 | ### @property (nonatomic, assign) BOOL isScanning; 27 | > You can get the state of ``isScanning`` with True / False. 28 | > 29 | > ⚠️: If bluetooth is closed, but you do not stopScan, the state of ``isScanning `` will always be true. 30 | 31 | ``` 32 | STMyntBluetooth.sharedInstance().isScanning 33 | ``` 34 | 35 | ### @property (nonatomic, assign) CBCentralManagerState centralState; 36 | > The state of the Bluetooth 37 | 38 | ``` 39 | STMyntBluetooth.sharedInstance().centralState 40 | ``` 41 | 42 | ### @property (nonatomic, assign) BOOL reportLost; 43 | > If you want to help others find mynts, you can set ``reportList`` true 44 | 45 | ``` 46 | STMyntBluetooth.sharedInstance(). reportLost = true 47 | ``` 48 | 49 | ### - (NSArray *)retrieveConnectedMynts; 50 | > All of the connectd mynts, not only in app. 51 | 52 | ``` 53 | let mynts = STMyntBluetooth.sharedInstance().retrieveConnectedMynts() 54 | ``` 55 | 56 | ### - (STMynt *)findMyntWithSn:(NSString *_Nonnull)sn; 57 | > You can get the mynt object with the sn from iOS 58 | 59 | ``` 60 | let mynt = STMyntBluetooth.sharedInstance().findMyntWithSn("K043E9H9A0") 61 | ``` 62 | ### @property (nonatomic, weak, nullable) id\ delegate; 63 | > [STMyntBluetoothDelegate](readme_en_1.md) 64 | 65 | --- 66 | ## STMynt 67 | 68 | ### @property (nonatomic, strong, readonly, nonnull) NSString *name; 69 | > The name of the mynt. 70 | 71 | ``` 72 | mynt.name 73 | ``` 74 | 75 | ### @property (nonatomic, assign) NSInteger RSSI; 76 | > the signal strength of the mynt. 77 | 78 | ``` 79 | mynt.RSSI 80 | ``` 81 | 82 | ### @property (nonatomic, assign, readonly) MYNTFirmwareType firmwareType; 83 | > the firmwareType of the mynt. 84 | 85 | ``` 86 | mynt.firmwareType 87 | ``` 88 | 89 | ### @property (nonatomic, assign, readonly) MYNTHardwareType hardwareType; 90 | > the hardwareType of the mynt. [CC25XX CSR | CC26XX CSR] 91 | > 92 | > ⚠️: Only CC26XX CSR 93 | 94 | ``` 95 | mynt.hardwareType 96 | ``` 97 | 98 | ### @property (nonatomic, assign, readonly) MYNTState state; 99 | > The connecting state of the mynt. 100 | 101 | ``` 102 | mynt.state 103 | ``` 104 | 105 | ### @property (nonatomic, assign, readonly) NSInteger battery; 106 | > The battery quatity information of the mynt. 107 | 108 | ``` 109 | mynt.battery 110 | ``` 111 | 112 | ### @property (nonatomic, assign, readonly) MYNTControlMode controlMode; 113 | > The controlmode of the mynt. 114 | 115 | ``` 116 | mynt.controlMode 117 | ``` 118 | 119 | ### @property (nonatomic, assign, readonly) MYNTClickValue click; 120 | > The value of the operation: click. 121 | 122 | ``` 123 | mynt.click 124 | ``` 125 | 126 | ### @property (nonatomic, assign, readonly) MYNTClickValue doubleClick; 127 | > The value of the operation: doubleclick. 128 | 129 | ``` 130 | mynt.doubleClick 131 | ``` 132 | 133 | ### @property (nonatomic, assign, readonly) MYNTClickValue tripleClick; 134 | > The value of the operation: tripleclick. 135 | 136 | ``` 137 | mynt.tripleClick 138 | ``` 139 | 140 | ### @property (nonatomic, assign, readonly) MYNTClickValue hold; 141 | > The value of the operation: hold. 142 | 143 | ``` 144 | mynt.hold 145 | ``` 146 | 147 | ### @property (nonatomic, assign, readonly) MYNTClickValue clickHold; 148 | > The value of the operation: click + hold. 149 | 150 | ``` 151 | mynt.clickHold 152 | ``` 153 | 154 | ### @property (nonatomic, strong, readonly, nullable) NSString *manufaturer; 155 | > The manufaturer of the mynt. 156 | 157 | ``` 158 | mynt.manufaturer 159 | ``` 160 | 161 | ### @property (nonatomic, strong, readonly, nullable) NSString *model; 162 | > The model of the mynt. 163 | 164 | ``` 165 | mynt.model 166 | ``` 167 | 168 | ### @property (nonatomic, strong, readonly, nonnull) NSString *sn; 169 | > The sn of the mynt. 170 | 171 | ``` 172 | mynt.sn 173 | ``` 174 | 175 | ### @property (nonatomic, strong, readonly, nullable) NSString *firmware; 176 | > The firmware information of the mynt. (BLE-26XX-2.1.0) 177 | 178 | ``` 179 | mynt.firmware 180 | ``` 181 | 182 | ### @property (nonatomic, strong, readonly, nullable) NSString *hardware; 183 | > The firmware compiling date of the mynt. (16041516:xx(year) xx(month) xx(day) xx(hour)) 184 | 185 | ``` 186 | mynt.hardware 187 | ``` 188 | 189 | ### @property (nonatomic, strong, readonly, nullable) NSString *software; 190 | > The firmware version of the mynt. 191 | 192 | ``` 193 | mynt.software 194 | ``` 195 | 196 | ### @property (nonatomic, assign) BOOL isDiscovering; 197 | > The flag will be true if the mynt is discoverd. 198 | 199 | ``` 200 | mynt.isDiscovering 201 | ``` 202 | 203 | ### @property (nonatomic, weak, nullable) id\ delegate; 204 | > [STMyntDelegate](readme_en_2.md) 205 | 206 | ### - (void)connect; 207 | > Used to start Func (connect) 208 | 209 | ``` 210 | mynt.connect() 211 | ``` 212 | 213 | ### - (void)disconnect; 214 | > Used to cancel Func (connect) 215 | 216 | ``` 217 | mynt.disconnect() 218 | ``` 219 | 220 | ### - (void)toggleAlarm:(BOOL)alarm; 221 | > Uesd to set mynt ring or not. 222 | > 223 | > ⚠️:When you press the mynt ring icon in App, Mynt will ring for 40 Sec. You can click the button on mynt to stop ringing. This is used for finding items(mynt). 224 | 225 | ``` 226 | mynt.toggleAlarm(true) 227 | ``` 228 | 229 | ### - (void)writeAlarmCount:(NSInteger)count; 230 | > Used to set the alarm times of the mynt wnen mynt is disconnect 231 | > 232 | > ⚠️: This is used for anti-lost sceanrio. When mynt disconnected with your device, your mynt will alarm x (the value you set) times. 233 | 234 | ``` 235 | mynt.writeAlarmCount(3) 236 | ``` 237 | 238 | ### - (void)writeAlarmDelay:(NSInteger)seconds; 239 | > Used to set the alarmdelay of the mynt(unit: second) 240 | > 241 | > ⚠️: This is used for anti-lost sceanrio. When mynt disconnected with your device, how the alarm will be dealyed. This is used to avoid false alarm. For iOS devices, we suggest to set this value to "15" seconds. And for Android device, we would suggest to set this value to "40". Depending on bluetooth performance. 242 | 243 | ``` 244 | mynt.writeAlarmDelay(20) 245 | ``` 246 | 247 | ### - (void)writeControlMode:(MYNTControlMode)mode; 248 | > Used to set the controlmode of the mynt. Only when the controlMode is Custom, customClickValue will be effective. 249 | 250 | ``` 251 | mynt?.writeControlMode(.Music) 252 | ``` 253 | 254 | ### - (void)writeClickValue:(MYNTClickEvent)clickEvent eventValue:(MYNTClickValue)eventValue; 255 | > Used to set the clickvalue of the mynt. 256 | > 257 | > ⚠️: If set this, controlmode will switch to custom. 258 | > ⚠️: Only when the Controlmode and eventValue of MYNT are "Custom", when users press the button on MYNT, then you will get notification of what the clickEvent is (click, doubleClick or others) by method ``mynt:didReceiveClickEvent:`` 259 | 260 | ``` 261 | mynt?.writeClickValue(.Click, eventValue: .MusicNext) 262 | ``` 263 | 264 | ### - (void)writeClickValue:(MYNTClickValue)click doubleClick:(MYNTClickValue)doubleClick tripleClick:(MYNTClickValue)tripleClick hold:(MYNTClickValue)hold clickHold:(MYNTClickValue)clickHold; 265 | > Used to set the clickvalue of the mynt. 266 | > 267 | > ⚠️: If set this, controlmode will switch to custom. 268 | > ⚠️: Only when the Controlmode and eventValue of MYNT are "Custom", when users press the button on MYNT, then you will get notification of what the clickEvent is (click, doubleClick or others) by method ``mynt:didReceiveClickEvent:`` 269 | 270 | ``` 271 | mynt?.writeClickValue(.MusicPlay, doubleClick: .MusicPlay, tripleClick: .MusicPlay, hold: .MusicPlay, clickHold: .MusicPlay) 272 | ``` 273 | 274 | ### - (void)readBattery:(void (^)(NSInteger battery))battery; 275 | > Used to read the battey of the mynt. 276 | 277 | ``` 278 | mynt?.readBattery({ (battery) in 279 | NSLog("current battery -> \(battery)") 280 | }) 281 | 282 | ``` 283 | 284 | ### - (void)readRSSI; 285 | > Used to read the signal strength of the mynt. 286 | > 287 | > ⚠️: signal strength will return in ``mynt:didUpdateRSSI:`` 288 | 289 | ``` 290 | mynt.readRSSI() 291 | ``` 292 | 293 | ### - (void)readMyntInfo:(MYNTInfoType)type handler:(void(^)(NSString * _Nullable))handler; 294 | > Used to read the deviceinfo of the mynt. 295 | 296 | ``` 297 | mynt?.readMyntInfo(.Manufaturer, handler: { (info) in 298 | NSLog("manufaturer -> \(info)") 299 | }) 300 | ``` 301 | 302 | ### - (void)readControlMode:(void(^)(MYNTControlMode mode))handler; 303 | > Used to read controlmode of the mynt. 304 | 305 | ``` 306 | mynt?.readControlMode({ (controlMode) in 307 | NSLog("current controlmode -> \(controlMode)") 308 | }) 309 | ``` 310 | 311 | ### - (void)readClickValue:(void(^)(MYNTClickValue click, MYNTClickValue doubleClick, MYNTClickValue tripleClick, MYNTClickValue hold, MYNTClickValue clickHold))handler; 312 | > Used to read clickValue of the mynt 313 | 314 | ``` 315 | mynt?.readClickValue({ (click, doubleClick, tripleClick, hold, clickHold) in 316 | NSLog("click -> \(click) doubleClick -> \(doubleClick) tripleClick -> \(tripleClick) hold -> \(hold) clickHold -> \(clickHold)") 317 | }) 318 | ``` -------------------------------------------------------------------------------- /doc/readme_en_1.md: -------------------------------------------------------------------------------- 1 | # STMyntBluetoothDelegate 2 | 3 | ``` 4 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didUpdateState state: CBCentralManagerState) { 5 | // Bluetooth status update (Bluetooth including but not limited to: Bluetooth is off, Buletooth is on etc.) 6 | } 7 | 8 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didDiscoverMynt mynt: STMynt) { 9 | // Found MYNT 10 | } 11 | 12 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didDiscoverTimeoutMynt mynt: STMynt) { 13 | // The found MYNT is time out 14 | } 15 | 16 | func myntBluetooth(myntBluetooth: STMyntBluetooth, didFilterMyntWithSn sn: String) -> Bool { 17 | // If you want to filter out some MYNT devices as your requirement, use this Func. 18 | } 19 | ``` 20 | -------------------------------------------------------------------------------- /doc/readme_en_2.md: -------------------------------------------------------------------------------- 1 | # STMyntDelegate 2 | 3 | func myntDidStartConnect(mynt: STMynt) { 4 | // Start connecting 5 | } 6 | 7 | func myntDidConnected(mynt: STMynt) { 8 | // Connection established 9 | } 10 | 11 | func mynt(mynt: STMynt, didConnectFailed error: NSError?) { 12 | // Failed to connect 13 | } 14 | 15 | func mynt(mynt: STMynt, didDisconnected error: NSError?) { 16 | // Disconnected 17 | } 18 | 19 | func mynt(mynt: STMynt, didUpdateRSSI RSSI: Int) { 20 | // RSSI updated 21 | } 22 | 23 | func mynt(mynt: STMynt, didUpdateBattery battery: Int) { 24 | // Battery quantity information updated 25 | } 26 | 27 | func mynt(mynt: STMynt, didUpdateAlarmState alarmState: Bool) { 28 | // Alarm status updated 29 | } 30 | 31 | func mynt(mynt: STMynt, didReceiveClickEvent clickEvent: MYNTClickEvent) { 32 | // ⚠️: If controlMode is Custom 33 | // ⚠️: And clickValue is CustomClick 34 | // When pressed the button in the center of MYNT, the this Func will return a value (clickEvent) 35 | } 36 | 37 | func didRequestAutoconnect(mynt: STMynt) -> Bool { 38 | // If you want the MYNT re-connect automatically, you should set the reutrn value to "True", else "False". When you manually invoke Func "Disconnect", you App will not connect MYNT automatically. 39 | return true 40 | } 41 | 42 | func didNeedRestartBluetooth(mynt: STMynt) { 43 | // When iOS can not connect to / scan the MYNT device, and log return error, meanwhile the system connect or scan abnormally. System will return this Func (didNeedRestartBluetooth(mynt: STMynt)). You can use it to notify users restart Bluetooth or Phone. When firmware updated and some Bluetooth broadcast values changed, this situation may occur. 44 | } -------------------------------------------------------------------------------- /doc/readme_en_3.md: -------------------------------------------------------------------------------- 1 | # Enum 2 | 3 | ## MYNTClickValue 4 | > The value of the Event. 5 | 6 | ``` 7 | typedef NS_ENUM(NSInteger, MYNTClickValue) { 8 | // No Value 9 | MYNTClickValueNone = 0x00, 10 | // Play / Pause 11 | MYNTClickValueMusicPlay = 0x01, 12 | // Next 13 | MYNTClickValueMusicNext = 0x02, 14 | // Pervious 15 | MYNTClickValueMusicPrevious = 0x03, 16 | // VolumeUp 17 | MYNTClickValueMusicVolumeUp = 0x04, 18 | // VolumeDown 19 | MYNTClickValueMusicVolumeDown = 0x05, 20 | // Shutter 21 | MYNTClickValueCameraShutter = 0x09, 22 | // Burst 23 | MYNTClickValueCameraBurst = 0x0A, 24 | // Next Page 25 | MYNTClickValuePPTNextPage = 0x06, 26 | // Previous Page 27 | MYNTClickValuePPTPreviousPage = 0x07, 28 | // Exit PPT 29 | MYNTClickValuePPTExit = 0x08, 30 | // CustomClick 31 | MYNTClickValueCustomClick = 0xB0 32 | }; 33 | ``` 34 | 35 | ## MYNTControlMode 36 | > The value of the ControlMode. 37 | 38 | | | Click | DoubleClick | TripleClick | Hold | ClickHold | 39 | |:---:|:------:|:-------:|:-----:|:-----:|:-------:| 40 | | Music | Play / Pause | Next | Previous | VolumeUp | VolumeDown | 41 | | Camera | Shutter | / | / | Burst | / | 42 | | PPT | Next Page | Previous Page | / | Exit PPT | / | 43 | | Default | Play / Pause | Next | Previous | / | VolumeDown | 44 | > Custom: the custom click value 45 | 46 | ``` 47 | typedef NS_ENUM(NSInteger, MYNTControlMode) { 48 | // Music 49 | MYNTControlModeMusic = 0x01, 50 | // Camera 51 | MYNTControlModeCamera = 0x02, 52 | // PPT 53 | MYNTControlModePPT = 0x03, 54 | // Custom 55 | MYNTControlModeCustom = 0x04, 56 | // Default 57 | MYNTControlModeDefault = 0x05, 58 | }; 59 | ``` 60 | 61 | ## MYNTClickEvent 62 | > The value of the clickEvent 63 | 64 | ``` 65 | typedef NS_ENUM(NSInteger, MYNTClickEvent) { 66 | // Click 67 | MYNTClickEventClick = 0x01, 68 | // DoubleClick 69 | MYNTClickEventDoubleClick = 0x02, 70 | // TripleClick 71 | MYNTClickEventTripleClick = 0x03, 72 | // Hold 73 | MYNTClickEventHold = 0x09, 74 | // Click+Hold 75 | MYNTClickEventClickHold 76 | }; 77 | ``` 78 | 79 | ## MYNTInfoType 80 | > The value of the infoType 81 | 82 | ``` 83 | typedef NS_ENUM(NSInteger, MYNTInfoType) { 84 | // manufaturer 85 | MYNTInfoTypeManufaturer = 0x00, 86 | // model 87 | MYNTInfoTypeModel, 88 | // sn 89 | MYNTInfoTypeSn, 90 | // firmware 91 | MYNTInfoTypeFirmware, 92 | // hardware 93 | MYNTInfoTypeHardware, 94 | // software 95 | MYNTInfoTypeSoftware, 96 | }; 97 | ``` 98 | 99 | ## MYNTState 100 | > The connect state of the mynt 101 | 102 | ``` 103 | typedef NS_ENUM(NSInteger, MYNTState) { 104 | // disconnect 105 | MYNTStateDisconnected = 0x00, 106 | // connecting 107 | MYNTStateConnecting, 108 | // connected 109 | MYNTStateConnected, 110 | }; 111 | ``` -------------------------------------------------------------------------------- /doc/readme_en_install.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | ### CocoaPods 4 | 5 | 1. Add `pod 'MYNT-SDK-IOS'` to your Podfile. 6 | 2. Run `pod install` or `pod update`. 7 | 3. import \. 8 | 9 | ### Manually 10 | 11 | 1. Download all the files in the `MYNT-SDK-IOS` subdirectory. 12 | 2. Add the source files to your Xcode project. 13 | 3. add frameworks: 14 | 15 | > ios 16 | 17 | * CoreBluetooth 18 | * sqlite3 19 | 20 | > osx 21 | 22 | * IOBluetooth 23 | * sqlite3 24 | 4. 添加 **-ObjC** 25 | 26 | Build Settings -> Other Linker Flags 27 | 28 | add -ObjC 29 | 5. import `STMyntBluetooth.h`. 30 | 31 | ## Requirements 32 | This library requires `iOS 7.0+` and `OSX 10.9+`. 33 | 34 | ###[Documentation](readme_en.md) --------------------------------------------------------------------------------