Jump to content

EnumCameraObjects in CameraRemote SDK returns Error 1


Recommended Posts

#include <iostream>

#include <iomanip>

#include "../CRSDK/CameraRemote_SDK.h"

#include "Text.hpp"



int main(int argc, const char * argv[]) {

    auto init_success = SCRSDK::Init();

    if (!init_success) {

        SDKTest::tout << "Failed to initialize Remote SDK. Terminating.\n";

        // cr_lib->Release();

        SCRSDK::Release();

        std::exit(EXIT_FAILURE);

    }

    SDKTest::tout << "SDK successuflly initialized. \n\n";

    

    CrInt32u version = SCRSDK::GetSDKVersion();

    int major = (version & 0xFF000000) >> 24;

    int minor = (version & 0x00FF0000) >> 16;

    int patch = (version & 0x0000FF00) >> 8;

    

    SDKTest::tout << "Remote SDK version: ";

    SDKTest::tout << major << "." << minor << "." << std::setfill(TEXT('0')) << std::setw(2) << patch << "\n";

    

    SCRSDK::ICrEnumCameraObjectInfo* camera_list = nullptr;

    auto enum_status = SCRSDK::EnumCameraObjects(&camera_list);

    if (CR_FAILED(enum_status) || camera_list == nullptr) {

        SDKTest::tout << "Current Status: " << enum_status << "\n";

        SDKTest::tout << "No cameras detected. Connect a camera and retry.\n";

        // cr_lib->Release();

        SCRSDK::Release();

        std::exit(EXIT_FAILURE);

    }

    SDKTest::tout << "Current Status:" << enum_status << "\n";

    SCRSDK::Release();

}

The above is my code for testing SONY CameraRemote SDK 1.3.0 using A7R4, and "Text.hpp" is from the source code in official sample app of CameraRemoteSDK, and my problem is when the camera is not connected, SCRSDK::EnumCameraObjects returns 0 which means CrError_None and this is OK, however when I connected my A7R4, it returns Error 1, but in the definition of CrError.h there is no error or warning code 1, and the sample app works normally, could anyone help with my problem? Thanks in advance!

Edited by passiflora
Link to post
Share on other sites

  • passiflora changed the title to EnumCameraObjects in CameraRemote SDK returns Error 1
  • 10 months later...

i searched and this was the only post on the subject of this API and driver so i posted this question here although not directly relevant to the same problem.

maybe someone can answer it ?

 

When using for example CrDeviceProperty_Media_FormatProgressRate

we return a value which has 2x 16 bit components

this is retuirned from the call as shown

 

SendCommand(CrDeviceHandle deviceHandle, CrInt32u commandId, CrCommandParam commandParam);

 

where the return value is a CrCommandParam enumerated type

this type is shown as a 16bit integer in the header file

enum CrCommandParam : CrInt16u
{
     CrCommandParam_Up = 0x0000,
     CrCommandParam_Down = 0x0001,
};

how can this be it must be 32bit to get the progress meter ? ? and the CrCommandParam was set to be 16 bit in the header file when it was defined.

/* TODO again check that CrCommandParam */
float alphaGetMediaFormatProgressRatePercent(CrDeviceHandle handle)
{
    CrCommandParam v;
    CrInt16u a,b;
    float pRate;
    SCRSDK::SendCommand(handle, CrDeviceProperty_Media_FormatProgressRate, v);
    b = static_cast<CrInt16u>(v&0xFFFF);
    a = static_cast<CrInt16u>((v>>16)&0xFFFF);
    pRate = ((static_cast<float>a) / (static_cast<float>b)) * 100.0f;
    return pRate;
}

ref page 124

Sony_CameraRemoteSDK_API-Reference_v1.04.00.pdf

in fact in CrDeviceProperty.h the type CrDevicePropertyCode is a CrInt32 but actually the function prototype would be shown as follows

 SendCommand(CrDeviceHandle deviceHandle, CrDevicePropertyCode commandId, CrCommandParam commandParam); 

 

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...