Skip to content

Commit

Permalink
chore(ObjC): remove old code
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Froment <sfroment42@gmail.com>
  • Loading branch information
sfroment committed Dec 12, 2018
1 parent adf1e49 commit 2634306
Showing 1 changed file with 0 additions and 69 deletions.
69 changes: 0 additions & 69 deletions core/network/ble/BertyPeripheralManagerDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,75 +138,6 @@ - (void)sendReadResponse:(CBPeripheralManager *)peripheral request:(CBATTRequest
[peripheral respondToRequest:request withResult:CBATTErrorSuccess];
}

/*!
* @method peripheralManager:didReceiveReadRequest:
*
* @param peripheral The peripheral manager requesting this information.
* @param request A <code>CBATTRequest</code> object.
*
* @discussion This method is invoked when <i>peripheral</i> receives an ATT request for a characteristic with a dynamic value.
* For every invocation of this method, @link respondToRequest:withResult: @/link must be called.
*
* @see CBATTRequest
*
*/
//- (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveReadRequest:(CBATTRequest *)request {
// NSLog(@"peripheralManager:peripheral didReceiveReadRequest: %@ %lu", request.central.identifier, request.offset);
// BertyUtils *me = [BertyUtils sharedUtils];
// BertyDevice *bDevice = [BertyUtils getDeviceFromRequest:request];
//
// if (bDevice == nil) {
//
// NSArray<CBPeripheral *> *peripherals = [centralManager retrieveConnectedPeripheralsWithServices:@[me.serviceUUID]];
//
// for (CBPeripheral *peripheral in peripherals) {
// if ([peripheral.identifier isEqual:request.central.identifier]) {
// NSLog(@"ICI %@", peripheral);
// [peripheral setDelegate:self.peripheralDelegate];
// BertyDevice *device = [[BertyDevice alloc] initWithPeripheral:peripheral withCentralManager:centralManager];
// [BertyUtils addDevice:device];
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
//// [centralManager connectPeripheral:peripheral options:nil];
// NSLog(@"ICI bis %@", peripheral);
// [NSThread sleepForTimeInterval:1.0f];
// NSLog(@"ICI bis2 %@", peripheral);
//
// dispatch_semaphore_signal(device.connSema);
// });
// }
// }
//
// NSLog(@"peripheral: didReceiveReadRequest error unknown peripheral connected");
// [peripheral respondToRequest:request withResult:CBATTErrorRequestNotSupported];
// return;
// }
// if ([request.characteristic.UUID isEqual:me.maUUID]) {
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
// request.value = [me.ma dataUsingEncoding:NSUTF8StringEncoding];
//// [peripheral respondToRequest:request withResult:CBATTErrorSuccess];
// [self sendReadResponse:peripheral request:request value:request.value];
// NSLog(@"ma countDown other %@", bDevice);
// if (request.offset > request.value.length || (request.offset + [bDevice.peripheral maximumWriteValueLengthForType:CBCharacteristicWriteWithResponse]) > request.value.length) {
// NSLog(@"ma countDown other %@", bDevice);
// [bDevice.latchOtherRead coundDown];
// };
// });
// } else if ([request.characteristic.UUID isEqual:me.peerUUID]) {
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
// request.value = [me.peerID dataUsingEncoding:NSUTF8StringEncoding];
//// [peripheral respondToRequest:request withResult:CBATTErrorSuccess];
// [self sendReadResponse:peripheral request:request value:request.value];
// if (request.offset > request.value.length || (request.offset + [bDevice.peripheral maximumWriteValueLengthForType:CBCharacteristicWriteWithResponse]) > request.value.length) {
// NSLog(@"peerID countDown other %@", bDevice);
// [bDevice.latchOtherRead coundDown];
// };
//
// });
// } else {
// [peripheral respondToRequest:request withResult:CBATTErrorInvalidHandle];
// }
//}

/*!
* @method peripheralManager:didReceiveWriteRequests:
*
Expand Down

0 comments on commit 2634306

Please sign in to comment.