Ogp Sdk
The top level SDK interface
The client should use this class to discover, connect, and retrieve GoPro objects
TODO currently multiple instances of OGP SDK are not supported and have not been tested.
// Initialize OGP SDK
val ogpSdk = OgpSdk(dispatcher, appContext)
coroutineScope.launch {
// Discover and take the first device we find
val target = ogpSdk.discover(NetworkType.BLE).first()
// Connect
val goproId = ogpSdk.connect(target).getOrThrow()
// Now retrieve the gopro
val gopro = ogpSdk.getGoPro(goproId)
// Set the shutter
gopro.commands.setShutter(true)
}
Content copied to clipboard
Parameters
dispatcher
dispatcher that OGP SDK should use for coroutine scopes
app Context
platform-specific application context
Functions
Link copied to clipboard
suspend fun connect(target: ScanResult, connectionRequestContext: ConnectionRequestContext? = null): Result<GoProId>
Establish a connection to a discovered GoPro
Link copied to clipboard
Scan for available GoPro's on one or more network types