MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / hid_open_path

Function hid_open_path

Engine/lib/sdl/src/hidapi/android/hid.cpp:1119–1150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1117}
1118
1119HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path, int bExclusive)
1120{
1121 LOGV( "hid_open_path( %s )", path );
1122
1123 hid_device_ref< CHIDDevice > pDevice;
1124 {
1125 hid_mutex_guard r( &g_DevicesRefCountMutex );
1126 hid_mutex_guard l( &g_DevicesMutex );
1127 for ( hid_device_ref<CHIDDevice> pCurr = g_Devices; pCurr; pCurr = pCurr->next )
1128 {
1129 if ( SDL_strcmp( pCurr->GetDeviceInfo()->path, path ) == 0 )
1130 {
1131 hid_device *pValue = pCurr->GetDevice();
1132 if ( pValue )
1133 {
1134 ++pValue->m_nDeviceRefCount;
1135 LOGD("Incrementing device %d (%p), refCount = %d\n", pValue->m_nId, pValue, pValue->m_nDeviceRefCount);
1136 return pValue;
1137 }
1138
1139 // Hold a shared pointer to the controller for the duration
1140 pDevice = pCurr;
1141 break;
1142 }
1143 }
1144 }
1145 if ( pDevice && pDevice->BOpen() )
1146 {
1147 return pDevice->GetDevice();
1148 }
1149 return NULL;
1150}
1151
1152int HID_API_EXPORT HID_API_CALL hid_write(hid_device *device, const unsigned char *data, size_t length)
1153{

Callers 5

hid.cFile · 0.85
hid_openFunction · 0.85
hid_openFunction · 0.85
onConnectMethod · 0.85
hid.cFile · 0.85

Calls 4

SDL_strcmpFunction · 0.85
GetDeviceInfoMethod · 0.80
GetDeviceMethod · 0.80
BOpenMethod · 0.80

Tested by 1

onConnectMethod · 0.68