pd_is_bus_supported()

Checks if a bus type is supported by the device.

Synopsis:

#include <peripheral_discovery.h>
 
int pd_is_bus_supported(pd_bus_t bus_id, bool *is_supported)

Since:

BlackBerry 10.2.0

Arguments:

bus_id

The bus to be checked.

is_supported

true if the bus is supported, false if it is not.

Library:

libperipheral_discovery (For the qcc command, use the -l peripheral_discovery option to link against this library)

Description:

You can use function to determine if devices will appear on the specified bus. For example, if the peripheral to support is a USB peripheral that will be connected when the device is in host mode, this function should be called to check if USB host mode is actually supported.

This code sample shows how to check if USB host mode is supported:
 bool is_supported;
 if( pd_is_bus_supported( PD_BUS_USB_HOST_MODE, &is_supported ) == EOK ) {
     if( !is_supported ) {
         printf( "Bus not supported\n" );
     }
 } else {
     printf( "Error determining if bus is supported\n" );
 }

Returns:

EOK on success.