cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Smart Bluetooth

Anonymous
Not applicable

After a central sends a write request to a peripheral, will there be a callback to indicate that write request was successful?

0 Likes
Reply
1 Solution
Employee

See leatt_regWriteRspCb() and how hello_client sample app uses this. The callback registered with this function will be invoked when the write is executed successfully by the server.

View solution in original post

2 Replies
Anonymous
Not applicable

If your central is an iOS app and you are connected to a BTLE device (peripheral) you can use this:

- (void)writeValue:(NSData *)data forCharacteristic:(CBCharacteristic *)characteristic type:(CBCharacteristicWriteType)type

As type you use:

CBCharacteristicWriteWithResponse (to get the response)

or:

CBCharacteristicWriteWithoutResponse (no response)

If you choose the response you will get a callback:

- (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error


then you can check  error value:

if (error == NULL)

{

     //write successful

}


0 Likes
Reply
Employee

See leatt_regWriteRspCb() and how hello_client sample app uses this. The callback registered with this function will be invoked when the write is executed successfully by the server.

View solution in original post