if a DeviceProperytChanged event arrives, invalidate this properties
cache git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15126 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -2134,6 +2134,24 @@ store_event:
|
||||
if (ret == PTP_RC_OK) {
|
||||
ptp_debug (params, "event: nparams=0x%X, code=0x%X, trans_id=0x%X, p1=0x%X, p2=0x%X, p3=0x%X", event.Nparam,event.Code,event.Transaction_ID, event.Param1, event.Param2, event.Param3);
|
||||
ptp_add_event (params, &event);
|
||||
|
||||
/* handle some PTP stack internal events */
|
||||
switch (event.Code) {
|
||||
case PTP_EC_DevicePropChanged: {
|
||||
unsigned int i;
|
||||
|
||||
/* mark the property for a forced refresh on the next query */
|
||||
for (i=0;i<params->nrofdeviceproperties;i++)
|
||||
if (params->deviceproperties[i].desc.DevicePropertyCode == event.Param1) {
|
||||
params->deviceproperties[i].timestamp = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: /* check if we should handle it internally too */
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (ret == PTP_ERROR_TIMEOUT) /* ok, just new events */
|
||||
ret = PTP_RC_OK;
|
||||
|
||||
Reference in New Issue
Block a user