@@ -90,7 +90,7 @@ - (void) startScan {
9090}
9191
9292- (void ) stopScan {
93- if ([[BLEConnecter sharedInstance ] isScanning ] && ![[DPLinkingBeaconManager sharedInstance ] isStartBeaconScan ]) {
93+ if ([[BLEConnecter sharedInstance ] isCanDiscovery ] && ![[DPLinkingBeaconManager sharedInstance ] isStartBeaconScan ]) {
9494 DCLogInfo (@" stopScan" );
9595 [[BLEConnecter sharedInstance ] stopScan ];
9696 } else {
@@ -99,7 +99,7 @@ - (void) stopScan {
9999}
100100
101101- (BOOL ) isStartScan {
102- return [[BLEConnecter sharedInstance ] isScanning ];
102+ return [[BLEConnecter sharedInstance ] isCanDiscovery ];
103103}
104104
105105- (void ) restart {
@@ -217,11 +217,13 @@ - (void) sendLEDCommand:(DPLinkingDevice *)device power:(BOOL)on {
217217 if (on) {
218218 [request startDemoSelectSettingInformationWithLED: device.setting.settingInformationDataLED
219219 vibration: nil
220+ notifySound: nil
220221 peripheral: device.peripheral
221222 disconnect: NO ];
222223 } else {
223224 [request stopDemoSelectSettingInformationWithLED: nil
224225 vibration: nil
226+ notifySound: nil
225227 peripheral: device.peripheral
226228 disconnect: NO ];
227229 }
@@ -232,11 +234,13 @@ - (void) sendVibrationCommand:(DPLinkingDevice *)device power:(BOOL)on {
232234 if (on) {
233235 [request startDemoSelectSettingInformationWithLED: nil
234236 vibration: device.setting.settingInformationDataVibration
237+ notifySound: nil
235238 peripheral: device.peripheral
236239 disconnect: NO ];
237240 } else {
238241 [request stopDemoSelectSettingInformationWithLED: nil
239242 vibration: nil
243+ notifySound: nil
240244 peripheral: device.peripheral
241245 disconnect: NO ];
242246 }
@@ -245,13 +249,15 @@ - (void) sendVibrationCommand:(DPLinkingDevice *)device power:(BOOL)on {
245249- (void ) setDefaultLED : (DPLinkingDevice *)device {
246250 [[BLERequestController sharedInstance ] setSelectSettingInformationWithLED: device.setting.settingInformationDataLED
247251 vibration: nil
252+ notifySound: nil
248253 peripheral: device.peripheral
249254 disconnect: NO ];
250255}
251256
252257- (void ) setDefaultVibration : (DPLinkingDevice *)device {
253258 [[BLERequestController sharedInstance ] setSelectSettingInformationWithLED: nil
254259 vibration: device.setting.settingInformationDataVibration
260+ notifySound: nil
255261 peripheral: device.peripheral
256262 disconnect: NO ];
257263}
@@ -260,21 +266,22 @@ - (void) sendNotification:(DPLinkingDevice *)device title:(NSString *)title mess
260266 // TODO: 設定が反映されない。
261267 NSString *appName = @" Linking Plugin" ;
262268 NSString *bundleId = [[NSBundle mainBundle ] bundleIdentifier ];
263-
269+ BLEDeviceNotificationSetting * dnSetting = [BLEDeviceNotificationSetting new ];
270+ dnSetting.title = title;
271+ dnSetting.text = message;
272+ dnSetting.appName = appName;
273+ dnSetting.appNameLocal = appName;
274+ dnSetting.package = bundleId;
275+ dnSetting.notifyId = 0 ;
276+ dnSetting.notifyCategoryId = 0 ;
277+ dnSetting.ledSetting = YES ;
278+ dnSetting.vibrationSetting = YES ;
279+ dnSetting.led = nil ;
280+ dnSetting.vibration = nil ;
281+ dnSetting.deviceId = device.setting .deviceId ;
282+ dnSetting.deviceUId = nil ;
264283 BLERequestController *request = [BLERequestController sharedInstance ];
265- [request sendGeneralInformation: title
266- text: message
267- appName: appName
268- appNameLocal: appName
269- package: bundleId
270- notifyId: 0
271- notifyCategoryId: 0
272- ledSetting: YES
273- vibrationSetting: YES
274- led: nil
275- vibration: nil
276- deviceId: device.setting.deviceId
277- deviceUId: nil
284+ [request sendGeneralInformation: dnSetting
278285 peripheral: device.peripheral
279286 disconnect: NO ];
280287}
@@ -866,7 +873,7 @@ - (void)didConnectDevice:(BLEDeviceSetting *)setting {
866873 DCLogInfo (@" setting.saved: %@ " , setting.saved ? @" YES" : @" NO" );
867874 DCLogInfo (@" setting.connectionStatus: %@ " , setting.connectionStatus );
868875
869- setting.isInDistanceThreshold = YES ;
876+ setting.inDistanceThreshold = YES ;
870877}
871878
872879- (void )didDeviceInitialFinished : (CBPeripheral *)peripheral {
0 commit comments