Skip to content

Commit

Permalink
Merge pull request PunchThrough#33 from PunchThrough/remove-deprecate…
Browse files Browse the repository at this point in the history
…d-methods

Remove Erase Sketch
  • Loading branch information
karelkalthoff authored Aug 19, 2016
2 parents 42b9d4e + 11c3481 commit 9d864d3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
29 changes: 0 additions & 29 deletions source/PTDBean.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ @interface PTDBean () <CBPeripheralDelegate, AppMessagingLayerDelegate, OAD_Dele
@property (nonatomic, readwrite) BOOL uploadInProgress;
@property (nonatomic, readwrite) NSString *sketchName;
@property (nonatomic, readwrite) NSString *targetFirmwareVersion;
@property (nonatomic, copy) void (^sketchErasedHandler)(BOOL sketchErased);
@property (nonatomic, copy) void (^firmwareVersionAvailableHandler)(BOOL firmwareAvailable, NSError *error);
@property (nonatomic, copy) void (^hardwareVersionAvailableHandler)(BOOL hardwareAvailable, NSError *error);

Expand Down Expand Up @@ -363,27 +362,6 @@ - (void)cancelFirmwareUpdate{
}
}

// Deprecated
- (void)eraseSketchWithHandler:(void (^)(BOOL sketchErased))handler{

if([self.sketchName isEqualToString:@""]) {
if (handler) {
handler(YES);
}
return;
}

// program a nil image and image name to clear sketch
self.sketchErasedHandler = handler;
#if TARGET_OS_IPHONE
[self setLedColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:1]];
#else
[self setLedColor:[NSColor colorWithRed:0 green:0 blue:0 alpha:1]];
#endif
[self programArduinoWithRawHexImage:nil andImageName:@""];
[self readArduinoSketchInfo];
}

#pragma mark - Protected Methods
-(id)initWithPeripheral:(CBPeripheral*)peripheral beanManager:(id<PTDBeanManager>)manager{
self = [super initWithPeripheral:peripheral];
Expand Down Expand Up @@ -801,13 +779,6 @@ -(void)appMessagingLayer:(AppMessagingLayer*)layer recievedIncomingMessageWithID
NSDate *date = [NSDate dateWithTimeIntervalSince1970:meta.timestamp];
self.sketchName = name;
_dateProgrammed = date;

// check for sketch erased handler
if (self.sketchErasedHandler) {
// execute sketch erased handler and clear
self.sketchErasedHandler([name isEqualToString:@""]);
self.sketchErasedHandler = nil;
}

if (self.delegate && [self.delegate respondsToSelector:@selector(bean:didUpdateSketchName:dateProgrammed:crc32:)]) {
[self.delegate bean:self didUpdateSketchName:name dateProgrammed:date crc32:meta.hexCrc];
Expand Down
6 changes: 0 additions & 6 deletions source/Public/PTDBean.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,12 +620,6 @@ typedef NS_ENUM(NSUInteger, BeanBluetoothError) {
*/
-(void)readTemperature;

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

@end


0 comments on commit 9d864d3

Please sign in to comment.