SCLFlicButton Class Reference
Inherits from | NSObject |
---|---|
Declared in | SCLFlicPoicButton.h |
Overview
@class SCLFlicButton
An instance of this class represents a physical Flic or Poic. All commands will be directly passed to the physical Flic/Poic and any events occurring on the Flic/Poic will be passed along using the specified delegate methods.
delegate
@property delegate
@property (weak, nonatomic, nullable) id<SCLFlicButtonDelegate> delegate
Discussion
The delegate object that will receive events related to this particular Flic/Poic.
Declared In
SCLFlicPoicButton.h
buttonIdentifier
@property buttonIdentifier
@property (readonly, nonatomic, strong, nonnull) NSUUID *buttonIdentifier
Discussion
The virtual ID of the button. This is the identifier that is recommended to use when identifying the buttons.
Declared In
SCLFlicPoicButton.h
buttonPublicKey
@property buttonPublicKey
@property (readonly, nonatomic, strong, nonnull) NSString *buttonPublicKey
Discussion
The public key of the button. This in the key that is used to identify the Flic/Poic on our backend.
Declared In
SCLFlicPoicButton.h
macAddress
@property macAddress
@property (nonatomic, readonly, strong, nonnull) NSString *macAddress
Discussion
This property exposes the real mac addres of the Flic/Poic. The returned string is 17 character long on the format “xx:xx:xx:xx:xx:xx”.
Declared In
SCLFlicPoicButton.h
name
@property name
@property (atomic, readonly, strong, nonnull) NSString *name
Discussion
The Bluetooth device name of the Flic/Poic button.
Declared In
SCLFlicPoicButton.h
color
@property color
@property (atomic, readonly, strong, nonnull) UIColor *color
Discussion
The actual color of a grabbed Flic button. If for some reason the real color is not available, such as if the button was already grabbed with an earlier version of fliclib, then the color will default to white. Please note that this is only available on Flic buttons that have been grabbed from the Flic App. For Poic buttons this will always be be white.
Declared In
SCLFlicPoicButton.h
userAssignedName
@property userAssignedName
@property (atomic, readonly, strong, nonnull) NSString *userAssignedName
Discussion
This is the user assigned name of the Flic button that is assigned and displayed in the Flic App. Please note that this is only available on Flic buttons that have been grabbed from the Flic App. For Poic buttons will only be an empty string.
Declared In
SCLFlicPoicButton.h
connectionState
@property state
@property (atomic, readonly) SCLFlicButtonConnectionState connectionState
Discussion
The current state of the button.
Declared In
SCLFlicPoicButton.h
lowLatency
@property lowLatency
@property (nonatomic, readwrite) BOOL lowLatency
Discussion
The latency setting for this button. If you set this to YES then you will get lower latency on the click events when your app is in the foreground. As soon as the app leaves the foreground it will be set back to the regular latency setting. Please only use this if you have a very good reason for it, such as if you are designing a foreground game that requires it. Battery consumption will increase with this activated.
Declared In
SCLFlicPoicButton.h
triggerBehavior
@property triggerBehavior
@property (nonatomic, readwrite) SCLFlicButtonTriggerBehavior triggerBehavior
Discussion
This property specifies how the Flic/Poic press events should be handled. You are allowed to change this property any time you want. Take a look at SCLFlicButtonTriggerBehavior to see the options available.
Declared In
SCLFlicPoicButton.h
pressCount
@property pressCount
@property (nonatomic, readonly) int pressCount
Discussion
This property specifies how many times the Flic/Poic has been toggled at any given time. This will register all down events as well as the up events, which means that if you want to know how many times it has been clicked then you have to divide this number by two. Also, this property will always contain the last known registered value, meaning that if the Flic/Poic has been pressed while not being within proximity then the property will of course not be up to date. It will be updated as soon as the Flic/Poic connects the next time. Important notice: Even though this value is represented by an int the internal counter only consists of 3 bytes meaning that the counter will rollover at 0xffffff (16777215). However, it is highly unlikely that anyone will ever reach those numbers. The presscounter will be reset if a factory reset is done on the physical Flic/Poic button.
Declared In
SCLFlicPoicButton.h
isReady
@property isReady
@property (readonly) BOOL isReady
Discussion
This property lets you know wether the Flic/Poic is ready or not. Only when it is ready will you be able to recieve or send data to it.
Declared In
SCLFlicPoicButton.h
– connect
@method connect:
- (void)connect
Discussion
Attempts to connect the button. If the Flic/Poic is not available, due to either being out of range or not advertising, then
it will be connected once it becomes available since this call will not time out, also called a pending connection.
It can be canceled by calling the disconnect
method.
Declared In
SCLFlicPoicButton.h
– disconnect
@method disconnect:
- (void)disconnect
Discussion
Disconnect a currently connected Flic/Poic or cancel a pending connection.
Declared In
SCLFlicPoicButton.h
– indicateLED:
@method indicateLED:
- (void)indicateLED:(SCLFlicButtonLEDIndicateCount)count
Parameters
count |
Decides how many times the LED will indicate (fade) |
---|
Discussion
Use this method when you want to indicate something to the user by fading the LED. Be mindful with battery usage. Please note that this only works while the button is currently connected and ready.
Declared In
SCLFlicPoicButton.h
– readRSSI
@method readRSSI
- (void)readRSSI
Discussion
A call to this method will read the RSSI (received signal strength indication) of the Flic/Poic while it is currently connected. A callback will be sent to the SCLFlicButton delegate once the value has been updated. This value is represented in decibels and has an effective range from -100 to 0.
Declared In
SCLFlicPoicButton.h
– firmwareRevision
@method firmwareRevision
- (int)firmwareRevision
Discussion
An integer value representing the last known firmware version of this Flic/Poic.
Declared In
SCLFlicPoicButton.h
– buttonType
@method buttonType
- (SCLFlicButtonType)buttonType
Return Value
NSEnum value SCLFlicButtonType
Discussion
This lets you know what kind of button this is.
Declared In
SCLFlicPoicButton.h