File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2857,7 +2857,7 @@ - (void) peripheral:(CBPeripheral *)peripheral didReadRSSI:(NSNumber *)RSSI erro
28572857 [self .commandDelegate sendPluginResult: pluginResult callbackId: callback];
28582858}
28592859
2860- // Helpers for Callbacks
2860+ // This is called when peripheral is ready to accept more data when using write without response
28612861- (void )peripheralIsReadyToSendWriteWithoutResponse : (CBPeripheral *)peripheral {
28622862 CBCharacteristic * const characteristic = currentWriteCharacteristic;
28632863 currentWriteCharacteristic = nil ;
@@ -2894,6 +2894,7 @@ - (void)peripheralIsReadyToSendWriteWithoutResponse:(CBPeripheral *)peripheral {
28942894 }
28952895}
28962896
2897+ // Helpers for Callbacks
28972898- (NSMutableDictionary *) ensureCallback : (CBUUID *) characteristicUuid forConnection : (NSMutableDictionary *) connection {
28982899 // See if callback map exists for characteristic
28992900 NSMutableDictionary * characteristicCallbacks = [connection objectForKey: characteristicUuid];
@@ -3680,7 +3681,9 @@ - (void)writeDataToCharacteristic:(CBCharacteristic *)characteristic toPeriphera
36803681 self->currentWriteCharacteristic = characteristic;
36813682 }
36823683
3683- [peripheral writeValue: data forCharacteristic: characteristic type: self ->writeQtype];
3684+ if (peripheral.canSendWriteWithoutResponse ) {
3685+ [peripheral writeValue: data forCharacteristic: characteristic type: self ->writeQtype];
3686+ }
36843687}
36853688
36863689@end
You can’t perform that action at this time.
0 commit comments