Skip to content

Commit 9d864d3

Browse files
Merge pull request PunchThrough#33 from PunchThrough/remove-deprecated-methods
Remove Erase Sketch
2 parents 42b9d4e + 11c3481 commit 9d864d3

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

source/PTDBean.m

-29
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ @interface PTDBean () <CBPeripheralDelegate, AppMessagingLayerDelegate, OAD_Dele
2929
@property (nonatomic, readwrite) BOOL uploadInProgress;
3030
@property (nonatomic, readwrite) NSString *sketchName;
3131
@property (nonatomic, readwrite) NSString *targetFirmwareVersion;
32-
@property (nonatomic, copy) void (^sketchErasedHandler)(BOOL sketchErased);
3332
@property (nonatomic, copy) void (^firmwareVersionAvailableHandler)(BOOL firmwareAvailable, NSError *error);
3433
@property (nonatomic, copy) void (^hardwareVersionAvailableHandler)(BOOL hardwareAvailable, NSError *error);
3534

@@ -363,27 +362,6 @@ - (void)cancelFirmwareUpdate{
363362
}
364363
}
365364

366-
// Deprecated
367-
- (void)eraseSketchWithHandler:(void (^)(BOOL sketchErased))handler{
368-
369-
if([self.sketchName isEqualToString:@""]) {
370-
if (handler) {
371-
handler(YES);
372-
}
373-
return;
374-
}
375-
376-
// program a nil image and image name to clear sketch
377-
self.sketchErasedHandler = handler;
378-
#if TARGET_OS_IPHONE
379-
[self setLedColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:1]];
380-
#else
381-
[self setLedColor:[NSColor colorWithRed:0 green:0 blue:0 alpha:1]];
382-
#endif
383-
[self programArduinoWithRawHexImage:nil andImageName:@""];
384-
[self readArduinoSketchInfo];
385-
}
386-
387365
#pragma mark - Protected Methods
388366
-(id)initWithPeripheral:(CBPeripheral*)peripheral beanManager:(id<PTDBeanManager>)manager{
389367
self = [super initWithPeripheral:peripheral];
@@ -801,13 +779,6 @@ -(void)appMessagingLayer:(AppMessagingLayer*)layer recievedIncomingMessageWithID
801779
NSDate *date = [NSDate dateWithTimeIntervalSince1970:meta.timestamp];
802780
self.sketchName = name;
803781
_dateProgrammed = date;
804-
805-
// check for sketch erased handler
806-
if (self.sketchErasedHandler) {
807-
// execute sketch erased handler and clear
808-
self.sketchErasedHandler([name isEqualToString:@""]);
809-
self.sketchErasedHandler = nil;
810-
}
811782

812783
if (self.delegate && [self.delegate respondsToSelector:@selector(bean:didUpdateSketchName:dateProgrammed:crc32:)]) {
813784
[self.delegate bean:self didUpdateSketchName:name dateProgrammed:date crc32:meta.hexCrc];

source/Public/PTDBean.h

-6
Original file line numberDiff line numberDiff line change
@@ -620,12 +620,6 @@ typedef NS_ENUM(NSUInteger, BeanBluetoothError) {
620620
*/
621621
-(void)readTemperature;
622622

623-
/*
624-
* Erases sketch with completion handler. Used to ensure sketch is cleared before updating from Sym. to Asym. FW
625-
* @param The handler to run once the sketch name has been updated. The sketchErased bool indicates whether the erasure was successful or not.
626-
*/
627-
- (void)eraseSketchWithHandler:(void (^)(BOOL sketchErased))handler __attribute__((deprecated(("Use [setArduinoPowerState:] instead"))));
628-
629623
@end
630624

631625

0 commit comments

Comments
 (0)