Hi!
Official Android native library for Canon EOS digital cameras however exists, but an SDK for Android was not (yet?) published by Canon company.
The native library (name is libEDSDKCore.so) can be easily extracted from either Canon Camera Connect or EOS Remote applications.
The list of SDK methods, structures and constants in the EDSDKCore library is attached to this post (EDSDKCore.java.txt - got this file after some reverse engineering).
I started to create a Xamarin C# wrapper class around the library, so far the following methods:
using System;
using System.Runtime.InteropServices;
namespace CCApp {
public class EDSDKWrapper {
[StructLayout(LayoutKind.Sequential)]
public struct EdsDeviceInfo {
public int DeviceCode;
public string DeviceName;
public int ProductID;
public string SerialNumber;
}
[DllImport("EDSDKCore", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
public static extern int EdsInitializeSDK();
[DllImport("EDSDKCore", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
public static extern int EdsTerminateSDK();
[DllImport("EDSDKCore", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
public static extern int EdsRelease(IntPtr target);
[DllImport("EDSDKCore", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
public static extern int EdsGetCameraList(out IntPtr CameraList);
[DllImport("EDSDKCore", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
public static extern int EdsGetChildCount(IntPtr CameraRef, out int Count);
[DllImport("EDSDKCore", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
public static extern int EdsGetChildAtIndex(IntPtr CameraRef, int Index, out EdsDeviceInfo DeviceInfo);
}
}
Problem is at the test app where I called some of above methods.
My app detects the camera (Canon EOS 1300D) connected to smartphone via USB cable, I can also query some general USB information.
Return values of all above methods are OK (=0) but the EdsGetChildCount returns always 0 in the Count parameter and I have no idea why.
Example code:
// prerequisite#1: a Canon EOS camera connected via USB cable to smartphone
// prerequisite#2: UsbManager instance initialized, UsbDevice instance referencing the camera created
// prerequisite#3: .OpenDevice(dev) method called on UsbManager instance
var r0 = EDSDKWrapper.EdsInitializeSDK(); // r0 should be 0
var r1 = EDSDKWrapper.EdsGetCameraList(out IntPtr camList); // r1 should be 0
var r2 = EDSDKWrapper.EdsGetChildCount(camList, out int c); // r2 should be 0; c should be 1 -- here is the problem, it is always zero
var r3 = EDSDKWrapper.EdsRelease(camList); // r3 should be 0
var r4 = EDSDKWrapper.EdsTerminateSDK(); // r4 should be 0
Either the wrapper methods or the calls are incorrect but the connected camera count is always zero.
Any help on this would be appreciated!
Best Regards,
Ladislav