Skip to content

Commit

Permalink
Commit of version 0.6.7 - Please see changelog for more info.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonMeier committed Oct 1, 2015
1 parent 08430d8 commit 63bca81
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 46 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
#fliclib-ios 0.6.7

**Changes**

* Added a flag for background execution in the manager initializing method.
* Swift compatibillity verified.
* Added Nullability Annotations.
* Updated documentation.

**Issues fixed**

* Fixed an issue that resulted in the flicButtonIsReady: not being sent on every connect.
* Fixed an issue with the outgoing packet signing that caused the Flic to drop indicateLED: calls.

Please note that these fixes requires the firmware version R11 on the Flic to work properly.

# fliclib-ios 0.6.6
Initial commit
38 changes: 17 additions & 21 deletions fliclib.framework/Headers/SCLFlicButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import <sqlite3.h>

/*!
* @enum SCLFlicButtonConnectionState
Expand Down Expand Up @@ -75,8 +74,6 @@ typedef NS_ENUM(NSInteger, SCLFlicButtonMode) {
* has been made. This is the most energy conservative mode, but may have a negative effect on response time. This is the recommended mode
* for all applications where latency is not an issue.
*
* While in this mode you will not get any button disconnect/connect events since all that will be handled internally.
* Update: You will now get these events! It might be removed at a later point, to be decided.
*/
SCLFlicButtonModePassive = 3,
};
Expand Down Expand Up @@ -241,31 +238,31 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* @discussion The delegate object that will receive events related to this particular flic.
*
*/
@property(weak, nonatomic) id<SCLFlicButtonDelegate> delegate;
@property(weak, nonatomic, nullable) id<SCLFlicButtonDelegate> delegate;

/*!
* @property buttonIdentifier
*
* @discussion The virtual ID of the flic.
*
*/
@property (readonly, nonatomic, strong) NSUUID *buttonIdentifier;
@property (readonly, nonatomic, strong, nonnull) NSUUID *buttonIdentifier;

/*!
* @property buttonPublicKey
*
* @discussion The public key of the flic. This in the key that is used to identify the flic on our backend.
*
*/
@property (readonly, nonatomic, strong) NSString *buttonPublicKey;
@property (readonly, nonatomic, strong, nonnull) NSString *buttonPublicKey;

/*!
* @property name
*
* @discussion The Bluetooth device name of the flic button.
*
*/
@property (atomic, readonly, strong) NSString *name;
@property (atomic, readonly, strong, nonnull) NSString *name;


/*!
Expand Down Expand Up @@ -329,6 +326,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* @method indicateLED:
*
* @discussion Use this method when you want to indicate something to the user by fading the LED. Be mindful with battery usage.
* This will only work if the Flic is connected.
*
* @param count Decides how many times the LED will indicate (fade)
*/
Expand Down Expand Up @@ -366,7 +364,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* @protocol SCLFlicButtonDelegate
*
* @discussion The delegate of a SCLFlicButton object must adopt the <code>SCLFlicButtonDelegate</code> protocol. There are not
* any required delegate methods, but all are recommended for proper use of the flic.
* any required delegate methods, but all are recommended for proper use of the Flic.
*
*/
@protocol SCLFlicButtonDelegate <NSObject>
Expand All @@ -388,7 +386,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* @discussion The flic registered a button down event.
*
*/
- (void) flicButton:(SCLFlicButton *) button didReceiveButtonDown:(BOOL) queued age: (NSInteger) age;
- (void) flicButton:(SCLFlicButton * _Nonnull) button didReceiveButtonDown:(BOOL) queued age: (NSInteger) age;

/*!
* @method flicButton:didReceiveButtonUp:age:
Expand All @@ -403,7 +401,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* @discussion The flic registered a button up event.
*
*/
- (void) flicButton:(SCLFlicButton *) button didReceiveButtonUp:(BOOL) queued age: (NSInteger) age;
- (void) flicButton:(SCLFlicButton * _Nonnull) button didReceiveButtonUp:(BOOL) queued age: (NSInteger) age;

/*!
* @method flicButton:didReceiveButtonClick:age:
Expand All @@ -419,7 +417,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to.
*
*/
- (void) flicButton:(SCLFlicButton *) button didReceiveButtonClick:(BOOL) queued age: (NSInteger) age;
- (void) flicButton:(SCLFlicButton * _Nonnull) button didReceiveButtonClick:(BOOL) queued age: (NSInteger) age;

/*!
* @method flicButton:didReceiveButtonDoubleClick:age:
Expand All @@ -435,7 +433,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to.
*
*/
- (void) flicButton:(SCLFlicButton *) button didReceiveButtonDoubleClick:(BOOL) queued age: (NSInteger) age;
- (void) flicButton:(SCLFlicButton * _Nonnull) button didReceiveButtonDoubleClick:(BOOL) queued age: (NSInteger) age;

/*!
* @method flicButton:didReceiveButtonHold:age:
Expand All @@ -451,7 +449,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to.
*
*/
- (void) flicButton:(SCLFlicButton *) button didReceiveButtonHold:(BOOL) queued age: (NSInteger) age;
- (void) flicButton:(SCLFlicButton * _Nonnull) button didReceiveButtonHold:(BOOL) queued age: (NSInteger) age;

/*!
* @method flicButtonDidConnect:
Expand All @@ -464,7 +462,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* after the <code>flicButtonIsReady:</code> callback has arrived.
*
*/
- (void) flicButtonDidConnect:(SCLFlicButton *)button;
- (void) flicButtonDidConnect:(SCLFlicButton * _Nonnull) button;

/*!
* @method flicButtonIsReady:
Expand All @@ -473,12 +471,10 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
*
* @discussion This delegate method is called every time the flic has sucessfully connected and the autheticity has been verified.
* You will not receive any press events from the flic before this callback has been sent. Typically this event will be sent
* immediately after the <code>flicButtonDidConnect:</code> event. The verification process will take longer time the very
* first time that the flic is connected to the particular iOS device since a round-trip to the backend server has to
* be completed. This also means that an active internet connection is needed during the first connect of the flic.
* immediately after the <code>flicButtonDidConnect:</code> event.
*
*/
- (void) flicButtonIsReady:(SCLFlicButton *)button;
- (void) flicButtonIsReady:(SCLFlicButton * _Nonnull) button;

/*!
* @method flicButton:didDisconnectWithError:
Expand All @@ -490,7 +486,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* This can sometimes be called during a connection event that failed before the user was notified of the connection.
*
*/
- (void) flicButton:(SCLFlicButton *) button didDisconnectWithError:(NSError *)error;
- (void) flicButton:(SCLFlicButton * _Nonnull) button didDisconnectWithError:(NSError * _Nullable) error;

/*!
* @method flicButton:didFailToConnectWithError:
Expand All @@ -505,7 +501,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* need to call the <code>connect:</code> yourself to activate the pending connection once again.
*
*/
- (void) flicButton:(SCLFlicButton *)button didFailToConnectWithError:(NSError *)error;
- (void) flicButton:(SCLFlicButton * _Nonnull) button didFailToConnectWithError:(NSError * _Nullable) error;

/*!
* @method flicButton:didUpdateRSSI:error:
Expand All @@ -518,6 +514,6 @@ typedef NS_ENUM(NSInteger, SCLFlicError) {
* @discussion This callback verifies (unless an error occurred) that the RSSI value was updated.
*
*/
- (void) flicButton:(SCLFlicButton *)button didUpdateRSSI:(NSNumber *) RSSI error:(NSError *)error;
- (void) flicButton:(SCLFlicButton * _Nonnull) button didUpdateRSSI:(NSNumber * _Nonnull) RSSI error:(NSError * _Nullable) error;

@end
41 changes: 20 additions & 21 deletions fliclib.framework/Headers/SCLFlicManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "SCLFlicButton.h"
#import <sqlite3.h>

/*!
* @enum SCLFlicManagerBluetoothState
Expand Down Expand Up @@ -53,13 +52,12 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) {
* @class SCLFlicManager
*
* @discussion An instance of this class is required in order to perform any bluetooth LE communication with
* the flic. You need to use this in order to scan for, and discover, new buttons. The object will
* keep track of all the flics that are associated to the specific iOS device. It is important to
* mention that the SCLFlicManager does not support the regular state preservation and restoration protocol
* for view controllers, meaning that it does not support NSCoding. Instead, all of the state preservation
* will be taken cared of for you by the manager. Simply reinstantiate it using the
* <code>initWithDelegate:appID:appSecret:andRestoreState:</code> method and collect the associated
* flic objects using the <code>knownButtons:</code> method.
* the flic. The object will keep track of all the flics that are associated to the specific iOS device.
* It is important to mention that the SCLFlicManager does not support the regular state preservation
* and restoration protocol for view controllers, meaning that it does not support NSCoding.
* Instead, all of the state preservation will be taken cared of for you by the manager.
* Simply reinstantiate it using the <code>initWithDelegate:appID:appSecret:andRestoreState:</code> method
* and collect the associated flic objects using the <code>knownButtons:</code> method.
*
*/
@interface SCLFlicManager : NSObject {
Expand All @@ -73,7 +71,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) {
* SCLFlicManagerDelegate to see what callbacks are available.
*
*/
@property(weak, nonatomic) id<SCLFlicManagerDelegate> delegate;
@property(weak, nonatomic, nullable) id<SCLFlicManagerDelegate> delegate;

/*!
* @property bluetoothState
Expand All @@ -96,7 +94,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) {
@property (readonly, getter=isEnabled) BOOL enabled;

/*!
* @method initWithDelegate:appID:appSecret:andRestoreState:
* @method initWithDelegate:appID:appSecret:backgroundExecution:andRestoreState:
*
* @discussion The initialization call to use when you want to create a manager. This will initiate a SCLFlicManager and do the proper
* preparation needed in order to start the bluetooth communication with flic buttons. The BOOL <code>restore</code> included
Expand All @@ -114,35 +112,36 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) {
* @param delegate The delegate that all callbacks will be sent to.
* @param appID This is the App-ID string that the developer is required to have in order to use the fliclib framework.
* @param appSecret This is the App-Secret string that the developer is required to have in order to use the fliclib framework.
* @param bExecution Flag that specifies if want to configure the Flic manager to support background execution. If YES, then you also
* have to check the "Uses Bluetooth LE accessories" option under your projects Background Modes settings.
* @param restore Whether you want to create a brand new manager (and thus clearing any old manager) or restore the manager to a
* previous state.
*
*/
- (instancetype) initWithDelegate:(id<SCLFlicManagerDelegate>) delegate appID: (NSString *) appID appSecret: (NSString *) appSecret andRestoreState:(BOOL) restore;
- (instancetype _Nullable) initWithDelegate:(id<SCLFlicManagerDelegate> _Nonnull) delegate appID: (NSString * _Nonnull) appID appSecret: (NSString * _Nonnull) appSecret backgroundExecution: (BOOL) bExecution andRestoreState:(BOOL) restore;

/*!
* @method knownButtons:
*
* @discussion All buttons that have ever been discovered by the manager and not manually been forgotten/removed.
* @discussion All buttons that have ever been added to the manager and not manually been forgotten/removed.
*
* @return Dictionary containing the SCLFlicButton objects. The keys are of NSUUID type that represent the buttonIdentifier
* of the SCLFlicButton instance.
*
*/
- (NSDictionary*) knownButtons;
- (NSDictionary* _Nonnull) knownButtons;

/*!
* @method forgetButton:
*
* @discussion This will attempt to completely remove the flic button from the manager and clear the SCLFlicButton instance. If the flic
* is connected when this method is called then it will also be disconnected first. Remember to clear all your references
* to this particular button instance so that it properly gets cleared from memory. Only after doing this will you be able
* to discover the flic again when doing a new scan.
* to this particular button instance so that it properly gets cleared from memory.
*
* @param button The button that you wish to destroy.
*
*/
- (void) forgetButton:(SCLFlicButton *) button;
- (void) forgetButton:(SCLFlicButton * _Nonnull) button;

/*!
* @method disable
Expand Down Expand Up @@ -172,7 +171,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) {
* @param callback This is the callback URL that you want the Flic app to return the data to.
*
*/
- (void) requestButtonFromFlicAppWithCallback: (NSString *) callback;
- (void) requestButtonFromFlicAppWithCallback: (NSString * _Nonnull) callback;

/*!
* @method generateButtonFromURL:
Expand All @@ -182,7 +181,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) {
* @param url This is the full url that was returned from the Flic app.
*
*/
- (SCLFlicButton *) generateButtonFromURL: (NSURL *) url;
- (SCLFlicButton * _Nullable) generateButtonFromURL: (NSURL * _Nonnull) url;

@end

Expand Down Expand Up @@ -215,7 +214,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) {
* pending again.
*
*/
- (void) flicManager:(SCLFlicManager *)manager didChangeBluetoothState: (SCLFlicManagerBluetoothState) state;
- (void) flicManager:(SCLFlicManager * _Nonnull) manager didChangeBluetoothState: (SCLFlicManagerBluetoothState) state;

/*!
* @method flicManagerDidRestoreState:
Expand All @@ -228,7 +227,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) {
* order to properly restore the rest of your application. Do not forget to re-set the delegate on all buttons.
*
*/
- (void) flicManagerDidRestoreState:(SCLFlicManager *)manager;
- (void) flicManagerDidRestoreState:(SCLFlicManager * _Nonnull) manager;

/*!
* @method flicManager:didForgetButton:error:
Expand All @@ -241,7 +240,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) {
* to also remove your references in case you still have any.
*
*/
- (void) flicManager:(SCLFlicManager *)manager didForgetButton:(NSUUID *)buttonIdentifier error:(NSError *)error;
- (void) flicManager:(SCLFlicManager * _Nonnull) manager didForgetButton:(NSUUID * _Nonnull) buttonIdentifier error:(NSError * _Nullable)error;


@end
8 changes: 4 additions & 4 deletions fliclib.framework/_CodeSignature/CodeResources
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<dict>
<key>Headers/SCLFlicButton.h</key>
<data>
1e6dR9YA1A0SgaFNdCm2YUGgnCE=
27Oc/wutVc0JJ4XB9lttupVgjXM=
</data>
<key>Headers/SCLFlicManager.h</key>
<data>
k7QBH2bCApDpb3Z2INTtcdMmIms=
QnS8dgMVi0vdWRi8E8LaWxpwWY0=
</data>
<key>Headers/fliclib.h</key>
<data>
Expand All @@ -29,11 +29,11 @@
<dict>
<key>Headers/SCLFlicButton.h</key>
<data>
1e6dR9YA1A0SgaFNdCm2YUGgnCE=
27Oc/wutVc0JJ4XB9lttupVgjXM=
</data>
<key>Headers/SCLFlicManager.h</key>
<data>
k7QBH2bCApDpb3Z2INTtcdMmIms=
QnS8dgMVi0vdWRi8E8LaWxpwWY0=
</data>
<key>Headers/fliclib.h</key>
<data>
Expand Down
Binary file modified fliclib.framework/fliclib
Binary file not shown.

0 comments on commit 63bca81

Please sign in to comment.