Callback Interface¶
IDeviceCallback¶
The callback interface of the SDK. This interface is used by the Camera Remote SDK to communicate the result of various asynchronous events to the user.
The user must implement a class deriving from this interface to use the SDK. This derived class should be passed to the Connect API to establish the callback communication channel with the SDK.
Pure Virtual Functions
Signature |
Description |
|---|---|
virtual void OnConnected(DeviceConnectionVersion version) |
Called by the SDK when a device is successfully connected |
virtual void OnDisconnected(CrInt32u error) |
Called by the SDK when a device disconnects. The error code may indicate a reason |
virtual void OnPropertyChanged() |
Called by the SDK when a device property changes |
virtual void OnLvPropertyChanged() |
Called by the SDK when a LiveView property changes |
virtual void OnCompleteDownload(CrChar *filename, CrInt32u type = 0xFFFFFFFF) |
Called by the SDK when a capture image or setting file has completely been transferred to the host device.
When capture image transfer is complete, the type parameter is 0xFFFFFFFF.
When DownloadSettingFile() succeeds, type parameter becomes CrDownloadSettingFileType_Setup, CrDownloadSettingFileType_FTPTransferSetting and CrDownloadSettingFileType_SceneFile.
|
virtual void OnCompleteOperation(CrInt32u code, CrOperationResultData* resultData) |
This is a callback that notifies the acquired data storage pointer and acquired data length if data acquisition from the body is successful after sending RequestOperation().
If resultData is not null, always release it by calling ReleaseOperationResultObject() to prevent memory leaks.
|
virtual void OnWarning(CrInt32u warning) |
Called when the SDK detects a warning. The warning code is passed back to the application as a parameter |
virtual void OnError(CrInt32u error) |
Called when the SDK detects an error. The error code is passed back to the application as a parameter |
virtual void OnPropertyChangedCodes(CrInt32u num, CrInt32u* codes) |
Called by the SDK when a device property changes.
The difference from OnPropertyChanged() is that you can get the updated device property code list. If you pass the device property code list received by this callback to GetSelectDeviceProperties(), you can get only the updated property information. Performance improvement can be expected by minimizing the amount of receive data.
|
virtual void OnLvPropertyChangedCodes(CrInt32u num, CrInt32u* codes) |
Called by the SDK when a LiveView property changes |
virtual void OnNotifyContentsTransfer(CrInt32u notify, CrContentHandle handle, CrChar* filename = 0) |
Called when content transfer starts and ends, or when transfer fails.
The filename parameter is the name (including path) of the content that will be set when the content transfer is complete.
The filename parameter is not set when content transfer is started or when content transfer fails.
|
virtual void OnWarningExt(CrInt32u warning, CrInt32 param1, CrInt32 param2, CrInt32 param3) |
Extended version of OnWarning.
Only one parameter can be notified by OnWarning, but multiple parameters can be notified using this callback.
refs: Error & Event Code
|
virtual void OnNotifyFTPTransferResult(CrInt32u notify, CrInt32u numOfSuccess, CrInt32u numOfFail) |
This is a callback that notifies the number of contents transferred to the host PC by the FTP Transfer function.
RequestFTPTransferResult() results will be notified.
refs: Error & Event Code
|
virtual void OnNotifyRemoteTransferResult(CrInt32u notify, CrInt32u per, CrChar* filename) |
This is a callback that notifies the result of get contents with remote transfer mode.
Refs: Contents Transfer with remote control
|
virtual void OnNotifyRemoteTransferResult(CrInt32u notify, CrInt32u per, CrInt8u* data, CrInt64u size) |
This is a callback that notifies the result of get contents with remote transfer mode.
|
virtual void OnNotifyRemoteTransferContentsListChanged(CrInt32u notify, CrInt32u slotNumber, CrInt32u addSize) |
This is a callback that notifies the contents list changed.
|
virtual void OnNotifyRemoteFirmwareUpdateResult(CrInt32u notify, const void* param) |
This is a callback that notifies the result of firmware update.
refs: Remote firmware update
|
virtual void OnReceivePlaybackTimeCode(CrInt32u timeCode) |
Called when receive time code of playback. |
virtual void OnReceivePlaybackData(CrInt8u mediaType, CrInt32 dataSize, CrInt8u* data, CrInt64 pts, CrInt64 dts, CrInt32 param1, CrInt32 param2) |
Called when receive video or audio data of playback. |
virtual void OnNotifyMonitorUpdated(CrInt32u type, CrInt32u frameNo) |
This is a callback that notifies the frame number of LiveView/OSD image update. type parameter becomes CrMonitorUpdated_LiveView and CrMonitorUpdated_OSD.
|
virtual void OnNotifyPostViewImage(CrChar* filename, CrInt32u size) |
This is a callback that notifies the PostView image update.
CrPostViewTransferring_UserSelect_File: filename is the full path to the saved file.
CrPostViewTransferring_UserSelect_RAM: filename is the camera’s filename, size is data size.
refs: Get PostView Image Data
|
ICrCameraObjectInfo¶
Your application can access to the specified camera information that is enumerated by EnumCameraObjects() using this interface.
The information retrieved from this interface is useful for displaying various information about the corresponding device to the end user of an application utilising the Camera Remote SDK. The information provided by this class is also required when establishing a new connection to a camera device. It should be provided when calling the Connect API.
The user should never manually free these objects by calling free or delete. Instead, the user should call ICrCameraObjectInfo::Release. This passes responsibility for releasing the allocated memory to the SDK, where it can be properly released.
Pure Virtual Functions
Signature |
Description |
|---|---|
virtual void Release() |
Calls the SDK to destroy the allocated object |
virtual CrChar* GetName() const |
Gets the friendly device name as a null-terminated character string
(Friendly device name is not available through SDK, currently.)
|
virtual CrInt32u GetNameSize() const |
Gets the size of the name string |
virtual CrChar* GetModel() const |
Gets the device model name as a null-terminated character string |
virtual CrInt32u GetModelSize() const |
Gets the size of the model string |
virtual CrInt16 GetUsbPid() const |
Gets the product id of a USB device |
virtual CrInt8u* GetId() const |
Gets the pointer to the device id data buffer |
virtual CrInt32u GetIdSize() const |
Gets the id data size |
virtual CrInt32u GetIdType() const |
Gets the id data type (binary or string data) |
virtual CrInt32u GetConnectionStatus() const |
Gets the current connection status of the device |
virtual CrChar* GetConnectionTypeName() const |
Gets the connection type string |
virtual CrChar* GetAdaptorName() const |
Gets the adaptor name string |
virtual CrChar* GetGuid() const |
It cannot be used. Reserved function. |
virtual CrChar* GetPairingNecessity() const |
Gets the need for pairing |
virtual CrInt16u GetAuthenticationState() const |
It cannot be used. Reserved function. |
virtual CrInt32u GetSSHsupport() const |
Gets the device SSH Support |
virtual CrInt32u GetIPAddress() const |
Gets the IP address by 4bytes data. |
virtual CrChar* GetIPAddressChar() const |
Gets the IP address by strings. |
virtual CrInt32u GetIPAddressCharSize() const |
Gets size of the IP address by strings. |
virtual CrInt8u* GetMACAddress() const |
Gets MAC address for either wired LAN or wireless LAN. Which one to get depends on the model. It does not depend on the connection type. |
virtual CrInt32u GetMACAddressSize() const |
Gets MAC address size. |
virtual CrChar* GetMACAddressChar() const |
Gets MAC address by string for either wired LAN or wireless LAN. Which one to get depends on the model. It does not depend on the connection type. |
virtual CrInt32u GetMACAddressCharSize() const |
Gets size of MAC address by string. |
ICrEnumCameraObjectInfo¶
The virtual interface for interacting with enumerated device info list created by the SDK.
This is the enumerator object interface to access the list of connectable cameras. Your application can get the access interface to the each camera using GetCameraObjectInfo().
A “connectable” device fulfils three requirements. One, the device itself supports PC Remote Control features. Two, the device model is supported by the current Camera Remote SDK release. Three, the connection method used by the device is supported by the current Camera Remote SDK. All three requirements must be fulfilled for the device information to be populated in the list.
All ICrEnumCameraObjectInfo interface objects are allocated internally by the SDK before having their address passed back to the user. The user should never manually free these objects by calling free or delete. Instead, the user should call ICrEnumCameraObjectInfo::Release. This passes responsibility for releasing the allocated memory to the SDK, where it can be properly released.
Pure Virtual Functions
Signature |
Description |
|---|---|
virtual void Release() |
Calls the SDK to destroy the allocated device info list |
virtual CrInt32u GetCount() const |
Returns the number of device info objects in the allocated list |
virtual const ICrCameraObjectInfo* GetCameraObjectInfo(CrInt32u index) const |
Get a pointer to the ICrCameraObjectInfo at the index specified |