SuperpoweredSDK  v2.0.2
Superpowered Audio SDK
Superpowered::AndroidUSB Class Reference

This class manages USB device connections. More...

#include "SuperpoweredAndroidUSB.h"

Static Public Member Functions

static void destroy ()
 Destroys the Superpowered Android USB system. Call this only once in an app's lifecycle. Don't initialize/destroy AndroidUSB more than once. More...
 
static void initialize (void *clientdata, AndroidUSBAudioDeviceConnectedCallback audioConnectedCallback, AndroidUSBAudioDeviceDisconnectedCallback audioDisconnectedCallback, AndroidUSBMIDIDeviceConnectedCallback midiConnectedCallback, AndroidUSBMIDIDeviceDisconnectedCallback midiDisconnectedCallback)
 Initializes the Superpowered Android USB system and set up native connection management callbacks. More...
 
static OnConnectReturn onConnect (int deviceID, int fd, const unsigned char *data, int dataBytes)
 Call this from Java when a USB device is connected. More...
 
static void onDisconnect (int deviceID)
 Call this from Java when a USB device is disconnected. More...
 

Static Public Attributes

static AndroidUSBInternals * internals
 

Detailed Description

This class manages USB device connections.

Member Function Documentation

◆ destroy()

static void Superpowered::AndroidUSB::destroy ( )
static

Destroys the Superpowered Android USB system. Call this only once in an app's lifecycle. Don't initialize/destroy AndroidUSB more than once.

◆ initialize()

static void Superpowered::AndroidUSB::initialize ( void *  clientdata,
AndroidUSBAudioDeviceConnectedCallback  audioConnectedCallback,
AndroidUSBAudioDeviceDisconnectedCallback  audioDisconnectedCallback,
AndroidUSBMIDIDeviceConnectedCallback  midiConnectedCallback,
AndroidUSBMIDIDeviceDisconnectedCallback  midiDisconnectedCallback 
)
static

Initializes the Superpowered Android USB system and set up native connection management callbacks.

It's very lightweight in memory and consumes no CPU. Call this only once in an app's lifecycle. Don't initialize/destroy AndroidUSB more than once.

Parameters
clientdataSome custom pointer you set for the callbacks.
audioConnectedCallbackCalled when a USB audio device is connected. Can be NULL.
audioDisconnectedCallbackCalled when a USB audio device is disconnected. Can be NULL.
midiConnectedCallbackCalled when a MIDI audio device is connected. Can be NULL.
midiDisconnectedCallbackCalled when a MIDI audio device is disconnected. Can be NULL.

◆ onConnect()

static OnConnectReturn Superpowered::AndroidUSB::onConnect ( int  deviceID,
int  fd,
const unsigned char *  data,
int  dataBytes 
)
static

Call this from Java when a USB device is connected.

Parameters
deviceIDUSB device identifier.
fdFile descriptor for communication.
dataPointer to the raw USB descriptor.
dataBytesLength of the raw USB descriptor.

◆ onDisconnect()

static void Superpowered::AndroidUSB::onDisconnect ( int  deviceID)
static

Call this from Java when a USB device is disconnected.

Parameters
deviceIDUSB device identifier.

Member Data Documentation

◆ internals

AndroidUSBInternals* Superpowered::AndroidUSB::internals
static

The documentation for this class was generated from the following file: