public class EquipmentManager extends Service implements ServiceListener
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG_MODE |
static java.lang.String |
KEY_ACCESSORY_SERIAL |
static int |
notificationID |
boolean |
streamThrow |
static java.lang.String |
TAG |
Constructor and Description |
---|
EquipmentManager()
Do not call.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getConsoleVersion() |
java.lang.Integer |
getDeviceType()
Returns the console device Types.
|
static EquipmentManager |
getInstance()
Access the instance of the equipment manager using this.
|
java.util.List<WorkoutPreset> |
getWorkoutlistfromObservers() |
void |
notifyObserversOnError(java.lang.Exception e) |
IBinder |
onBind(Intent intent) |
void |
onCreate() |
void |
onDataReceived(com.lf.api.controller.usb.ProtocolCommand pCommand)
Will be called whenever the device sends a command
|
void |
onDestroy() |
void |
onDeviceDisconnected()
called during device disconnection
|
void |
onPause()
Call when the Parent activity is on Pause.
|
void |
registerObserver(EquipmentObserver pObserver)
Adds an observer which listens for the console state change
|
void |
returnUserInfo(java.lang.String userInfoXml) |
void |
sendSetWorkoutIncline(double incline)
Raises or lowers the incline of the treadmill.
|
void |
sendSetWorkoutLevel(int level)
Increases or decreases the difficulty level of a workout.
|
void |
sendSetWorkoutThr(int thr)
Increase or decreases the Target Heart Rate.
|
void |
sendSetWorkoutWatts(int watts)
Increases or decreases the resistance of equipment.
|
boolean |
sendShowConsoleMessage(java.lang.String message)
Sends a string 1024 size characters which creates a dialog pop-up in the Discover console screen.
This feature is available for all equipments with Discover Consoles Related Methods: EquipmentObserver onShowConsoleMessageAckReceived(boolean) |
void |
sendUserAuthenticationProfile(java.lang.String userOauthProfile) |
void |
start()
Call this after the service is bound and instantiated.
|
void |
stop()
Call to stop listening to the device.
|
void |
unregisterObserver(EquipmentObserver pObserver)
Removes an observer from the collection
|
public static final java.lang.String TAG
public static final java.lang.String KEY_ACCESSORY_SERIAL
public static final int notificationID
public static boolean DEBUG_MODE
public volatile boolean streamThrow
public EquipmentManager()
public void notifyObserversOnError(java.lang.Exception e)
public java.util.List<WorkoutPreset> getWorkoutlistfromObservers()
public static EquipmentManager getInstance()
public void onCreate()
public void registerObserver(EquipmentObserver pObserver)
pobserver
- EquipmentObserver
public void unregisterObserver(EquipmentObserver pObserver)
pobserver
- EquipmentObserver
public java.lang.String getConsoleVersion()
public IBinder onBind(Intent intent)
public void onPause()
public void onDestroy()
public void stop()
public java.lang.Integer getDeviceType()
public void start()
public void onDataReceived(com.lf.api.controller.usb.ProtocolCommand pCommand)
ServiceListener
onDataReceived
in interface ServiceListener
public void onDeviceDisconnected()
ServiceListener
onDeviceDisconnected
in interface ServiceListener
public void sendSetWorkoutIncline(double incline)
incline
- value in percent.WorkoutStream
,
EquipmentObserver
public void sendSetWorkoutWatts(int watts)
resistance.
- WorkoutStream
,
EquipmentObserver
public void sendSetWorkoutLevel(int level)
difficulty
- levelWorkoutStream
,
EquipmentObserver
public void sendSetWorkoutThr(int thr)
Target
- Heart RateEquipmentObserver
,
WorkoutStream
public boolean sendShowConsoleMessage(java.lang.String message)
message
- String message to be displayedEquipmentObserver
public void returnUserInfo(java.lang.String userInfoXml)
public void sendUserAuthenticationProfile(java.lang.String userOauthProfile)