What should I do before using PAFERS HWAPI?

In TARGETS->Build Phase->Link Binary With Libraries, add libPFHWApi.a , ExternalAccssory.framework, SystemConfiguration.framework.

Add folder “HWAPILib” to your project. It includes NotificationConstants.h, Machine.h, Preference.h, Statistics.h, Status.h, User.h, SessionContext.h, Constants.h, and PFHWApi.h.

Add key “Supported external accessory protocols” to "Info.plist" of your project with one or more following values:
"com.pafers.protocol.general"(support Bike/Elliptica 30-pin),
"com.pafers.protocol.treadmill"(support Treadmill 30-pin),
"com.pafers.protocol.bt.general"(support Bike/Elliptica bluetooth),
"com.pafers.protocol.bt.treadmill"(support Treadmill bluetooth)


If I want to run my application in background, what should I do?

Make sure your deployment target is iOS 5.0 or higher, adding KEY “Required background modes” with VALUE “external-accessory” to Info.plist of your project.


Why does it not working as I use "setTargetSpeed"?

You can check "sessionContext.machine.machineType" first.
If the machine type is "MachineTypeTreadmill", you need to make sure that targetSpeed is not less than speedMin and is not more than speedMax.


Why can't I start a workout after "startQuickTrainingModeWithDelay" or "startCustomizedModeWithDelay" on Treadmill?

You need addObserver "PAFERSHWApiReadyToStart" to NSNotificationCenter first, then HWAPI will send you "PAFERSHWApiReadyToStart" NSNotification after user presses the start key on Treadmill.