Streaming Profiles
Streaming profiles define a named set of device operations that configure a device for a specific data capture scenario. Profiles are defined in the device's profile schema on the AnyBio platform and fetched at SDK initialization.
Listing Available Profiles
let profiles = sdk.getStreamingProfiles(deviceId: device.id)
for profile in profiles {
print("\(profile.name): \(profile.description)")
}
Activating a Profile
Activating a profile executes its configured operations in order and enables auto-reconnect with profile replay:
try await sdk.activateStreamingProfile(
deviceId: device.id,
profileName: "research"
)
Once activated, the profile is persisted — if the device disconnects and reconnects (or the app is relaunched), the SDK will replay the profile automatically.
Deactivating a Profile
sdk.deactivateStreamingProfile(deviceId: device.id)
// Optionally skip the stop-streaming operation
sdk.deactivateStreamingProfile(deviceId: device.id, executeStop: false)
Checking Active Profile
if let active = sdk.activeStreamingProfile(deviceId: device.id) {
print("Active profile: \(active)")
}
Device Operations
For more granular control, you can list and execute individual device operations:
// List available operations for a device
let operations = sdk.getDeviceOperations(deviceId: device.id)
for op in operations {
print("\(op.name): \(op.description)")
}
// Execute a specific operation
try await sdk.executeOperation(
deviceId: device.id,
operationName: "StartECG"
)