@@ -70,7 +70,7 @@ struct PSMoveAPI {
7070
7171 void update ();
7272
73- static void on_monitor_event (enum MonitorEvent event, enum MonitorEventDeviceType device_type, const char *path, const wchar_t *serial, void *user_data);
73+ static void on_monitor_event (enum MonitorEvent event, enum MonitorEventDeviceType device_type, const char *path, const wchar_t *serial, unsigned short pid, void *user_data);
7474
7575 EventReceiver *receiver;
7676 void *user_data;
@@ -290,16 +290,14 @@ PSMoveAPI::update()
290290}
291291
292292void
293- PSMoveAPI::on_monitor_event (enum MonitorEvent event, enum MonitorEventDeviceType device_type, const char *path, const wchar_t *serial, void *user_data)
293+ PSMoveAPI::on_monitor_event (enum MonitorEvent event, enum MonitorEventDeviceType device_type, const char *path, const wchar_t *serial, unsigned short pid, void *user_data)
294294{
295295 auto self = static_cast <PSMoveAPI *>(user_data);
296296
297297 switch (event) {
298- case EVENT_ZCM1_ADDED :
299- case EVENT_ZCM2_ADDED :
298+ case EVENT_DEVICE_ADDED :
300299 {
301- PSMOVE_DEBUG (" on_monitor_event(event=%s, device_type=0x%08x, path=\" %s\" , serial=%p)" ,
302- event == EVENT_ZCM1_ADDED ? " EVENT_ZCM1_ADDED" : " EVENT_ZCM2_ADDED" ,
300+ PSMOVE_DEBUG (" on_monitor_event(event=EVENT_DEVICE_ADDED, device_type=0x%08x, path=\" %s\" , serial=%p)" ,
303301 device_type, path, serial);
304302
305303 for (auto &c: self->controllers ) {
@@ -310,7 +308,6 @@ PSMoveAPI::on_monitor_event(enum MonitorEvent event, enum MonitorEventDeviceType
310308 }
311309 }
312310
313- unsigned short pid = event == EVENT_ZCM1_ADDED ? PSMOVE_PID : PSMOVE_PS4_PID ;
314311 PSMove *move = psmove_connect_internal (serial, path, -1 , pid);
315312 if (move == nullptr ) {
316313 PSMOVE_ERROR (" Cannot open move for retrieving serial!" );
0 commit comments