Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Karel Kalthoff committed Aug 11, 2016
2 parents a31463a + 8928bc1 commit 05585d7
Show file tree
Hide file tree
Showing 25 changed files with 48 additions and 24 deletions.
2 changes: 1 addition & 1 deletion App Message Definitions
Submodule App Message Definitions updated from 369b76 to 22a7de
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
201605240000
201607260001
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
201605240000
201606030000
2 changes: 1 addition & 1 deletion Bean-iOS-OSX-SDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pod::Spec.new do |s|

s.name = "Bean-iOS-OSX-SDK"
s.version = "2.1.0"
s.version = "2.2.0"
s.summary = "Punch Through Design's SDK for speeding up development with the LightBlue Bean development platform"
s.homepage = "https://github.com/PunchThrough/Bean-iOS-OSX-SDK"
s.license = { :type => "MIT", :file => "LICENSE.txt" }
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@
__/ | SDK for iOS and OS X
|___/

---------------------------------
2.2.0
Released on 2016-08-11
---------------------------------
App Message Definitions: master/22a7dea (2016-03-28)
Bean Test Firmware: 201606030000 (2016-06-03)
Bean+ Test Firmware: 201607260001 (2016-07-26)
---------------------------------

FEATURES:
* Updated firmware for Bean and Bean+
* Updated App Message Definitions

IMPROVEMENTS:
* Better sketch upload error messages
* Deprecated [PTDBean eraseSketchWithHandler:]; use
[PTDBean setArduinoPowerState:] instead

BUG FIXES:
* Fixed spelling errors in logging messages from Bean Manager
* Fixed improper handling of certain completion blocks

---------------------------------
2.1.0
Released on 2016-05-26
Expand Down
Binary file removed firmware/201504270003_BEAN_imgA.bin
Binary file not shown.
Binary file removed firmware/201504270003_BEAN_imgB.bin
Binary file not shown.
Binary file added firmware/Bean+/b_BeanPlus_imgB_large.bin
Binary file not shown.
Binary file added firmware/Bean+/c_BeanPlusSmallImgA.bin
Binary file not shown.
1 change: 1 addition & 0 deletions firmware/Bean+/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
201607260001
Binary file added firmware/Bean/a_BeanSmallImgAPadded.bin
Binary file not shown.
Binary file added firmware/Bean/b_Bean_imgB_large.bin
Binary file not shown.
Binary file added firmware/Bean/c_BeanSmallImgA.bin
Binary file not shown.
Binary file added firmware/Bean/d_BeanSmallImgB.bin
Binary file not shown.
1 change: 1 addition & 0 deletions firmware/Bean/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
201606030000
26 changes: 13 additions & 13 deletions source/PTDBean.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ @interface PTDBean () <CBPeripheralDelegate, AppMessagingLayerDelegate, OAD_Dele
@property (nonatomic, readwrite) NSString *sketchName;
@property (nonatomic, assign) NSInteger 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);

@end

Expand All @@ -53,9 +55,6 @@ @implementation PTDBean
BeanArduinoOADLocalState localArduinoOADState;
NSTimer* arduinoOADStateTimout;
NSTimer* arduinoOADChunkSendTimer;

void (^firmwareVersionAvailableHandler)(BOOL firmwareAvailable, NSError *error);
void (^hardwareVersionAvailableHandler)(BOOL hardwareAvailable, NSError *error);
NSDate* firmwareUpdateStartTime;

}
Expand Down Expand Up @@ -322,7 +321,7 @@ - (void)checkFirmwareVersionAvailableWithHandler:(void (^)(BOOL firmwareAvailabl
if ( [self firmwareVersion] ) {
handler( YES, nil );
} else {
firmwareVersionAvailableHandler = handler; // Wait until device info is valid
self.firmwareVersionAvailableHandler = handler; // Wait until device info is valid
}
}

Expand All @@ -331,7 +330,7 @@ - (void)checkHardwareVersionAvailableWithHandler:(void (^)(BOOL hardwareAvailabl
if ( [self hardwareVersion] ) {
handler( YES, nil );
} else {
hardwareVersionAvailableHandler = handler; // Wait until device info is valid
self.hardwareVersionAvailableHandler = handler; // Wait until device info is valid
}
}

Expand Down Expand Up @@ -365,6 +364,7 @@ - (void)cancelFirmwareUpdate{
}
}

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

if([self.sketchName isEqualToString:@""]) {
Expand Down Expand Up @@ -450,7 +450,7 @@ -(void)__setArduinoOADTimeout:(NSTimeInterval)duration{
arduinoOADStateTimout = [NSTimer scheduledTimerWithTimeInterval:duration target:self selector:@selector(__arduinoOADTimeout:) userInfo:nil repeats:NO];
}
-(void)__arduinoOADTimeout:(NSTimer*)timer{
NSError* error = [BEAN_Helper basicError:@"Sketch upload failed!" domain:NSStringFromClass([self class]) code:0];
NSError* error = [BEAN_Helper basicError:@"Sketch upload failed: Arduino communication timed out" domain:NSStringFromClass([self class]) code:0];
if (self.uploadInProgress) {
[self __alertDelegateOfArduinoOADCompletion:error];
}
Expand Down Expand Up @@ -516,7 +516,7 @@ -(void)__handleArduinoOADRemoteStateChange:(BL_HL_STATE_T)state{
break;
case BL_HL_STATE_ERROR:
{
NSError *error = [BEAN_Helper basicError:@"Sketch upload failed!" domain:NSStringFromClass([self class]) code:0];
NSError *error = [BEAN_Helper basicError:@"Sketch upload failed: Bootloader error" domain:NSStringFromClass([self class]) code:0];
if (self.uploadInProgress) {
[self __alertDelegateOfArduinoOADCompletion:error];
}
Expand Down Expand Up @@ -926,9 +926,9 @@ -(void)batteryProfileDidUpdate

- (void)hardwareVersionDidUpdate
{
if (hardwareVersionAvailableHandler){
[self checkHardwareVersionAvailableWithHandler:hardwareVersionAvailableHandler];
hardwareVersionAvailableHandler = nil;
if (self.hardwareVersionAvailableHandler){
[self checkHardwareVersionAvailableWithHandler:self.hardwareVersionAvailableHandler];
self.hardwareVersionAvailableHandler = nil;
}
}

Expand All @@ -940,9 +940,9 @@ - (void)firmwareVersionDidUpdate
// Don't send firmware version back to handler when firmware update is still in progress
if (self.updateInProgress) return;

if (firmwareVersionAvailableHandler) {
[self checkFirmwareVersionAvailableWithHandler:firmwareVersionAvailableHandler];
firmwareVersionAvailableHandler = nil;
if (self.firmwareVersionAvailableHandler) {
[self checkFirmwareVersionAvailableWithHandler:self.firmwareVersionAvailableHandler];
self.firmwareVersionAvailableHandler = nil;
}
}

Expand Down
12 changes: 6 additions & 6 deletions source/PTDBeanManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,20 @@ -(void)connectToBean:(PTDBean*)bean_ withOptions:(NSDictionary*)options error:(N
PTDBean* bean = [beanRecords objectForKey:bean_.identifier];
//If there is no such peripheral, return error
if(!bean){
if(error) *error = [BEAN_Helper basicError:@"Attemp to connect to Bean failed. No peripheral discovered with the corresponding UUID." domain:NSStringFromClass([self class]) code:BeanErrors_NoPeriphealDiscovered];
if(error) *error = [BEAN_Helper basicError:@"Attempt to connect to Bean failed. No peripheral discovered with the corresponding UUID." domain:NSStringFromClass([self class]) code:BeanErrors_NoPeriphealDiscovered];
return;
}
//Check if the device is already connected
else if(bean.state == BeanState_ConnectedAndValidated){
if(error) *error = [BEAN_Helper basicError:@"Attemp to connect to Bean failed. A device with this UUID is already connected" domain:NSStringFromClass([self class]) code:BeanErrors_AlreadyConnected];
if(error) *error = [BEAN_Helper basicError:@"Attempt to connect to Bean failed. A device with this UUID is already connected" domain:NSStringFromClass([self class]) code:BeanErrors_AlreadyConnected];
return;
}
//Check if the device is already in the middle of an attempted connected
else if(bean.state == BeanState_AttemptingConnection || bean.state == BeanState_AttemptingValidation){
if(error) *error = [BEAN_Helper basicError:@"Attemp to connect to Bean failed. A device with this UUID is in the process of being connected to." domain:NSStringFromClass([self class]) code:BeanErrors_AlreadyConnecting];
if(error) *error = [BEAN_Helper basicError:@"Attempt to connect to Bean failed. A device with this UUID is in the process of being connected to." domain:NSStringFromClass([self class]) code:BeanErrors_AlreadyConnecting];
return;
}else if(bean.state != BeanState_Discovered){
if(error) *error = [BEAN_Helper basicError:@"Attemp to connect to Bean failed. The device's current state is not eligible for a connection attempt." domain:NSStringFromClass([self class]) code:BeanErrors_DeviceNotEligible];
if(error) *error = [BEAN_Helper basicError:@"Attempt to connect to Bean failed. The device's current state is not eligible for a connection attempt." domain:NSStringFromClass([self class]) code:BeanErrors_DeviceNotEligible];
return;
}

Expand All @@ -164,7 +164,7 @@ -(void)disconnectBean:(PTDBean*)bean_ error:(NSError**)error
PTDBean* bean = [beanRecords objectForKey:bean_.identifier];
//Check if the device isn't currently connected
if(!bean){
if(error) *error = [BEAN_Helper basicError:@"Failed attemp to disconnect Bean. No device with this UUID is currently connected" domain:NSStringFromClass([self class]) code:BeanErrors_FailedDisconnect];
if(error) *error = [BEAN_Helper basicError:@"Failed attempt to disconnect Bean. No device with this UUID is currently connected" domain:NSStringFromClass([self class]) code:BeanErrors_FailedDisconnect];
return;
}
if(bean.peripheral.state != CBPeripheralStateConnected
Expand Down Expand Up @@ -206,7 +206,7 @@ -(void)bean:(PTDBean*)device hasBeenValidated_error:(NSError*)error{
PTDBean* bean = [beanRecords objectForKey:[device identifier]];
//If there is no such peripheral, return error
if(!bean){
localError = [BEAN_Helper basicError:@"Attemp to connect to Bean failed. No peripheral discovered with the corresponding UUID." domain:NSStringFromClass([self class]) code:BeanErrors_NoPeriphealDiscovered];
localError = [BEAN_Helper basicError:@"Attempt to connect to Bean failed. No peripheral discovered with the corresponding UUID." domain:NSStringFromClass([self class]) code:BeanErrors_NoPeriphealDiscovered];
}else if (error){
localError = error;
bean.state = BeanState_Discovered; // Reset bean state to the default, ready to connect
Expand Down
2 changes: 1 addition & 1 deletion source/Public/PTDBean.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ typedef NS_ENUM(NSUInteger, BeanBluetoothError) {
* 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;
- (void)eraseSketchWithHandler:(void (^)(BOOL sketchErased))handler __attribute__((deprecated(("Use [setArduinoPowerState:] instead"))));

@end

Expand Down

0 comments on commit 05585d7

Please sign in to comment.