Mac 용과 iOS 용의 두 가지 프로그램이 있습니다. Mac에서 iOS 장치에 연결할 때 원하는 서비스와 원하는 특성을 찾습니다. 특성을 찾은 후에는 peripheral.setNotifyValue(true, forCharacteristic: characteristic)
을 사용하지만 iOS 측에서는 peripheralManager:central:didSubscribeToCharacteristic:
메서드가 호출되지 않습니다. characteristic.isNotifying
인지 확인하면 거짓입니다. 알림 값을 true로 설정하면 이해할 수있는 것으로부터 알리고 있어야하며 값을 변경할 때마다 값이 업데이트됩니다. 왜 업데이트되지 않는거야? 미리 감사드립니다. 여기 CoreBluetooth 주변기기 .setNotifyValue (true, characteristic)가 알림을 보내지 않음
self.characteristic = CBMutableCharacteristic(type: UUID_CHARACTERISTIC, properties: CBCharacteristicProperties.Read|CBCharacteristicProperties.Notifiy, value: self.dataToSend, permissions: CBAttributePermissions.Readable);
을 - 당신이 원하는 경우
self.characteristic = CBMutableCharacteristic(type: UUID_CHARACTERISTIC, properties: CBCharacteristicProperties.Read, value: self.dataToSend, permissions: CBAttributePermissions.Readable)
theService = CBMutableService(type: UUID_SERVICE, primary: true)
theService.characteristics = [characteristic]
self.peripheralManager.addService(theService)
당신이 알림을 허용하도록 특성에 속성을 설정 한 - service.characteristics에서 문자 {의 OS (X) 측의 – Paulw11
에 서비스를 설정하는 코드를 보여 var에 aCharacteristic : CBCharacteristic로 CBCharacteristic = 문자; println ("\ t \ tFound 특성 \ (aCharacteristic)") 주변 장치 .setNotifyValue (true, 특성 : aCharacteristic) } – dmerr