我需要获得一些权限才能为Arduino写消息吗? OR ,我必须更改我的以下代码吗? OR 我在Arduino中遇到问题(实际上,Arduino可以从其他设备获取消息...因此,Arduino源代码很好.也许...)Do i need to get some permission to writing the message for an Arduino?OR I have to change my following code?OR I have a problem in Arduino(Acutally, Arduino can get a message from other device... so, Arduino source code is fine. maybe...)NSString* data = @"1";NSData* dataToWrite = [data dataUsingEncoding:NSUTF8StringEncoding];我有点像蓝牙菜鸟.因此,这可能是我已经忽略的显而易见的东西,但是任何帮助将不胜感激.I'm a bit of a bluetooth noob. So it's probably something obvious I've overlooked but any help would be much appreciated.谢谢!:)推荐答案非常感谢!!!!Paulw11.最后,我从iPhone向Arduino发送了数据.我检查了我特性的属性是< CB特性:0x13564a680,UUID = FFE1,属性= 0x16,值=(null),通知= NO> .我的特征的属性= 0x16.但我找不到属性枚举中的0x16.不过,我不知道0x16的含义.有人说代表特征可能特性的值.由于可以组合特征特性,因此特征可以设置多个属性值."URL:解释特征属性(iOS和BLE).无论如何,我可以在PaulW11的帮助下找到解决方案!我该怎么办?这是我的解决方法.首先,我的方法是 [peripheral writeValue:dataToWrite forCharacteristic:characteristic * type:CBCharacteristicWriteWithResponse] *; .问题代码是类型字段.我必须了解类型.该类型具有写,读等含义.因此,我将类型从 CBCharacteristicWriteWithResponse 更改为 CBCharacteristicPropertyWrite .那就是我所做的. [外围设备的writeValue:dataToWrite forCharacteristic:characteristic * type:CBCharacteristicPropertyWrite *]; 再次感谢你!Paulw11Thank you a lot!!!!!!! Paulw11. Finally, i sent a data from iphone to Arduino. what i checked properties of my characteristic is<CBCharacteristic: 0x13564a680, UUID = FFE1, properties = 0x16, value = (null), notifying = NO>.My characteristic's properties = 0x16. but i can not find a 0x16 in enum of properties. Still, I don't know the 0x16 meaning. Someone said that "Values representing the possible properties of a characteristic. Since characteristic properties can be combined, a characteristic may have multiple property values set."URL: Interpret Characteristic Properties (iOS and BLE) . Anyway I could find a solution by PaulW11 help! How i can do it? Here is my way of solution.At first, My method is [peripheral writeValue:dataToWrite forCharacteristic:characteristic *type:CBCharacteristicWriteWithResponse]*;.The problem code is type field. I had to understand the type. The type has a meaning of write, read and so on. So, I changed the type from CBCharacteristicWriteWithResponse to CBCharacteristicPropertyWrite. That is what i did. [peripheral writeValue:dataToWrite forCharacteristic:characteristic *type:CBCharacteristicPropertyWrite*];Thank you again! Paulw11 这篇关于不允许iOS集中书写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的.. 09-06 09:16