pd_is_class_supported()

Checks if a class of peripheral is supported by the device.

Synopsis:

#include <peripheral_discovery.h>
 
int pd_is_class_supported(pd_class_t class_id, bool *is_supported)

Since:

BlackBerry 10.2.0

Arguments:

class_id

The class of peripherals to be checked.

is_supported

true if the class 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:

This function should be called before calling any functions that take a pd_class_t as a parameter.

Prior to BlackBerry 10.2.1, PD_CLASS_PRINTER was not supported, regardless of what this function returns.

This code sample shows how to check if serial peripherals are supported:
 bool is_supported;
 if( pd_is_class_supported( PD_CLASS_SERIAL, &is_supported ) == EOK ) {
     if( !is_supported ) {
         printf( "Class not supported\n" );
     }
 } else {
     printf( "Error determining if class is supported\n" );
 }

Returns:

EOK on success.