-
Notifications
You must be signed in to change notification settings - Fork 6
Documentation
The flic2lib.framework for iOS contains 2 interfaces, FLICManager and FLICButton. Each interface has one delegate protocol that must be implemented, FLICManagerDelegate and FLICButtonDelegate, respectively.
For enum declarations, please scroll to the bottom.
@property(readonly, nonatomic, strong, nonnull) NSUUID *identifier;
This identifier is guaranteed to be the same for each Flic paired to a particular iOS device. Thus it can be used to identify a Flic within an app. However, If you need to identify Flics cross different apps on different iOS devices, then you should have look at the either uuid, serialNumber, or bluetoothAddress.
@property(weak, nonatomic, nullable) id<FLICButtonDelegate> delegate;
The delegate that will receive events related to this particular Flic. You can either set this delegate manually for each button, or let the manager do so automatically using the buttonDelegate as default.
@property(nonatomic, readonly, strong, nullable) NSString *name;
The bluetooth advertisement name of the Flic. This will be the same name that is shown by iOS it its bluetooth settings.
@property(nonatomic, readwrite, strong, nullable) NSString *nickname;
With this property you can read out the display name that the user may change in for example the Flic app. This value can also be changed from third party apps integrating this framework. The purpose of this is to provide more human readable name that the user can use to identify its Flic's across apps. For example "Kitchen Flic" or "Bedroom Lights".
@property(nonatomic, readonly, strong, nonnull) NSString *bluetoothAddress;
The bluetooth address of the Flic. This will be a string representation of a 49 bit long address. Example: "00:80:e4:da:12:34:56"
@property(nonatomic, readonly, strong, nonnull) NSString *uuid;
This is a unique identifier string that best used to identify a Flic. This is for example used to identify Flics on all our API endpoints.
@property(nonatomic, readonly, strong, nonnull) NSString *serialNumber;
The serial number is a production identifier that is printed on the backside of the Flic inside the battery hatch. This serves no other purpose than allowing a user to identify a button by manually looking at it. Can be useful in some cases.
@property(nonatomic, readwrite) FLICButtonTriggerMode triggerMode;
Use this proberty to let the flic2lib know what type of click events you are interested it. By default you will get Click, Double Click and Hold events. However, if you for eample are only interested in Click events then you can set this property to FLICButtonTriggerModeClick. Doing so will allow the flic2lib to deliver the events quicker since it can now ignore Double Click and Hold.
@property(nonatomic, readonly) FLICButtonState state;
Lets you know if the Flic is Connected, Disconnected, Connecting, or Disconnecting.
@property(nonatomic, readonly) uint32_t pressCount;
The number of times the Flic has been clicked since last time it booted.
@property(nonatomic, readonly) uint32_t firmwareRevision;
The revision of the firmware currently running on the Flic.
@property(nonatomic, readonly) BOOL isReady;
When a Flic connects it will go through a quick cryptographic verification to ensure that it is both a genuine Flic and that it is the correct Flic. Once this is completed this property will be set to YES and it is not until after that that you will start receiving click events (if any). As soon as the button disconnects this will be set to NO again.
@property(nonatomic, readonly) uint32_t batterylevel;
This will be the last know battery sample taken on the Flic. To convert this sample into voltage you can use the following formula: float voltage = ((batterylevel * 3.6) / 1024);
It is a good idea to consider changing the battery once the voltage goes below 2.65V.