Hi everyone,
I’m having problems with ofxcanonSDK. I want to control multiple cameras, take a picture at the same time from all of them.
But i can’t seem to read camera serials.
Btw, how can i get all the connected cameras as an array and loop through them?
Thanks,
Alp
Here is my code so far:
===============header=============
EdsError _err;
EdsCameraListRef _cameraList;
EdsCameraRef _camera;
EdsCameraRef _camera2;
EdsDataType dataType;
EdsDataType dataType2;
EdsUInt32 dataSize;
EdsUInt32 dataSize2;
EdsUInt32 data;
EdsUInt32 data2;
EdsDeviceInfo deviceInfo;
EdsDeviceInfo deviceInfo2;
===============cpp=============
_err = EdsGetCameraList(&_cameraList);
_err = EdsGetChildAtIndex(_cameraList , 0 , &_camera);
_err = EdsGetChildAtIndex(_cameraList , 1 , &_camera2);
_err = EdsGetDeviceInfo(_camera,&deviceInfo);
_err = EdsGetDeviceInfo(_camera2,&deviceInfo2);
cout << "CAMERA INFO = " << deviceInfo.szDeviceDescription << endl;
cout << "CAMERA INFO = " << deviceInfo2.szDeviceDescription << endl;
_err = EdsGetPropertySize(_camera, kEdsPropID_BodyIDEx, 0, &dataType, &dataSize);
_err = EdsGetPropertyData(_camera, kEdsPropID_BodyIDEx, 0, dataSize, &data );
_err = EdsGetPropertySize(_camera2, kEdsPropID_BodyIDEx, 0, &dataType, &dataSize);
_err = EdsGetPropertyData(_camera2, kEdsPropID_BodyIDEx, 0, dataSize, &data2 );
cout << "CAMERA INFO SERIAL1 = " << data << endl;
cout << "CAMERA INFO SERIAL2 = " << data2 << endl;
cout << "DATASIZE INFO = " << dataSize << endl;
cout << "DATASIZE INFO = " << dataSize2 << endl;
cout << "err INFO = " << _err << endl;
char * value = new char[dataSize];
char * value2 = new char[dataSize2];
// Get the serial
_err = EdsGetPropertyData(_camera, kEdsPropID_BodyIDEx, 0, dataSize, value );
_err = EdsGetPropertyData(_camera2, kEdsPropID_BodyIDEx, 0, dataSize2, value2 );
cout << "SERIAL INFO = " << value << endl;
cout << "SERIAL INFO = " << value2 << endl;
===============output=============
[notice ] SETUP
CAMERA INFO = Canon EOS 40D
CAMERA INFO = Canon EOS 5D Mark II
CAMERA INFO SERIAL1 = 0
CAMERA INFO SERIAL2 = 0
DATASIZE INFO = 0
DATASIZE INFO = 0
err INFO = 193
SERIAL INFO =
SERIAL INFO =