0

我正在尝试将项目 blueToothMe 转换为我自己的用途。我在代码中更改了 UUID

NSArray *characteristics = [NSArray arrayWithObjects:[CBUUID UUIDWithString:@"2A1E"], 
                                                         [CBUUID UUIDWithString:@"2A1C"],
                                                         [CBUUID UUIDWithString:@"2A21"], nil];

NSArray *characteristics = [NSArray arrayWithObjects:[CBUUID UUIDWithString:@"2A04"], 
                                                         [CBUUID UUIDWithString:@"2A03"],
                                                         [CBUUID UUIDWithString:@"2A19"], nil];

我可以从 cc2540 获得连接,但我无法获得任何特征服务。

我知道电池服务 UUID,并希望使用它们来让用户了解电池电量。

我试图替换:

[instance setCharacteristics:characteristics forServiceCBUUID:@"1809"];
[instance setLetWriteDataCBUUID:[NSArray arrayWithObject:@"1809"]];

characteristics = [NSArray arrayWithObject:[CBUUID UUIDWithString:@"2A29"]];

[instance setCharacteristics:characteristics forServiceCBUUID:@"180A"];

[instance setCharacteristics:characteristics forServiceCBUUID:@"2803"];
        [instance setLetWriteDataCBUUID:[NSArray arrayWithObject:@"2803"]];

        characteristics = [NSArray arrayWithObject:[CBUUID UUIDWithString:@"2A19"]];

        [instance setCharacteristics:characteristics forServiceCBUUID:@"180F"];

有没有人使用过这个并且有任何想法?

谢谢

4

0 回答 0