Checks if a class of peripheral is supported by the device.
#include <peripheral_discovery.h>
int pd_is_class_supported(pd_class_t class_id, bool *is_supported)
BlackBerry 10.2.0
The class of peripherals to be checked.
true if the class is supported, false if it is not.
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.
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" );
}
EOK on success.