SDK API - Auto Config Profiles
PLEASE NOTE: THE USAGE OF THIS FEATURE IS RESTRICTED AND ONLY AVAILABLE AS BETA THROUGH OUR EARLY ACCESS PROGRAM. PLEASE FILL OUT THE REGISTRATION FORM TO APPLY.
Configuration profile wraps MARK configuration and Workflow Rules. Profiles are identified with a uniquie profile name (id).
More details about profiles and their behavior can be found here.
Profile commands, like all commands that trigger an action on MARK, will by default be queued in ProGlove Connect.
By providing a special flag in PgCommandParams, this behaviour can be changed to replace the queue with this new command.
For more Information about the queueing behaviour click here.
Activating profile
To change active configuration profile, call changeConfigProfile() on your PgManager reference with the following parameters:
PgCommandobject holding thePgConfigProfileand optionalPgCommandParams. The containingPgConfigProfilemust have set profile name (profileId)- the object implementing
IPgConfigProfileCallback. After the profile was successfully set (or in case of any errors), theIPgConfigProfileCallbackwill be called with the relevant information
Activation is successful if profile with the specified id exists in the configuration file and the MARK device is connected.
Example code:
val profileName: String = "myProfileToSet"
pgManager.changeConfigProfile(
PgCommand(PgConfigProfile(profileName)),
object : IPgConfigProfileCallback {
override fun onConfigProfileChanged(profile: PgConfigProfile) {
runOnUiThread {
Toast.makeText(
applicationContext,
"${profile.profileId} set successfully",
Toast.LENGTH_LONG
).show()
}
}
override fun onError(error: PgError) {
runOnUiThread {
Toast.makeText(
applicationContext,
"Failed to set $profileName - $error",
Toast.LENGTH_LONG
).show()
}
}
}
)