Description
We add a new API since V3.6.0.12 in order to allow the app to lock/unlock file. following the standard operation code 0x1012(PTP_OC_SetObjectProtection).
The PIMA spec:
- OC code PTP_OC_SetObjectProtection 0x1012
- Parameter1 —> oid(uint32_t) The Object handle
- Parameter2 —> newprot(uint16_t) object protection flag
The ICatchCameraControl’s API
For Java
boolean setFileProtection(ICatchFile file, int newprot)throws IchSocketException, IchDeviceException, IchInvalidSessionException;
For C++
bool setFileProtection(shared_ptr<ICatchFile> file, unsigned int newprot);
Sample code
this.cameraSession = ICatchCameraSession.createSession();try {this.cameraSession.prepareSession(this.transport);} catch (IchTransportException e) {e.printStackTrace();}try {/* The parameter 1 should be a real object handle */ICatchFile file = new ICatchFile(1);/* The parameter 2 based on the camera' impl, maybe ingored by the camera. */boolean retVal = this.cameraSession.getControlClient().setObjectProtection(file, 0);Log.i("__file_protection__", "retVal: " + retVal);}catch (Exception ex) {ex.printStackTrace();}
