Hi I am trying to create a write characteristic for my app
My characteristic creation code is this
// Start with the Read CBMutableCharacteristic
self.transferCharacteristic = [[CBMutableCharacteristic alloc] initWithType:[CBUUID UUIDWithString:TRANSFER_CHARACTERISTIC_UUID]
properties:CBCharacteristicPropertyNotify|CBCharacteristicPropertyRead value:nil
permissions:CBAttributePermissionsReadable];
self.writeCharacteristic = [[CBMutableCharacteristic alloc] initWithType:[CBUUID UUIDWithString:WRITE_CHARACTERISTIC_UUID]
properties:CBCharacteristicPropertyNotify|CBCharacteristicPropertyWriteWithoutResponse value:nil
permissions:CBAttributePermissionsWriteable];
// Then the service
CBMutableService *transferService = [[CBMutableService alloc] initWithType:[CBUUID UUIDWithString:TRANSFER_SERVICE_UUID]
primary:YES];
// Add the characteristic to the service
transferService.characteristics = @[self.transferCharacteristic, self.writeCharacteristic];
// And add it to the peripheral manager
[self.peripheralManager addService:transferService];
I have verified that two characteristics are present when adding the service. Although when I scan for this peripheral it only shows one characteristic. Scanning code:
[self.centralManager scanForPeripheralsWithServices:nil
options:nil];
I checked various links and saw that my creation of write characteristic is correct, can anyone point out what am I doing wrong here and why is my service only showing one characteristic?
Note: This is an iPhone to iPhone app. Lightblue app shows two characteristics with their accurate properties
EDIT:
Characteristics fetch:
[peripheral discoverCharacteristics:nil forService:service];
didDiscoverCharacteristicsperipheral delegate method? What does thecharacteristicsproperty of the service contain? - Paulw11didDiscoverCharacteristics, it contains only my transferCharacteristic and not my writeCharacteristic - Amogh Shettigar