Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Int Clpe_Connection(string password, int isAttachedSlave)

Description

  • PC 와 CLPE-G-Series 간의 통신 연결을 수행한다.

Parameters

  • string password :[in] 루트 계정 암호.

Ex ) “password1234”

  • int isAttachedSlave : [in] Slave 보드 장착 여부.

  • 0인 경우 보드 1대 장착(Master 보드)

  • 1인 경우 보드 2대 장착(Master & Slave 보드)

Returns

  • int : Error status.

0 = no error.

-1 = can not probe driver.

-2 = can not find network.

-3 = can not set address.

-4 = can not ping.

-5 = can not create socket.

-6 = can not connect socket.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

string password = “password1234”;
int ret = clpe_api.Clpe_Connection(password, 1); 

if(ret == 0)
{
  printf("Connection successed\n");
}

...

Int Clpe_Connection(int isAttachedSlave)

Description

  • PC 와 CLPE-G-Series 간의 통신 연결을 수행한다.

Parameters

  • int isAttachedSlave : [in] Slave 보드 장착 여부.

  • 0인 경우 보드 1대 장착(Master 보드)

  • 1인 경우 보드 2대 장착(Master & Slave 보드)

Returns

  • int : Error status.

0 = no error.

-4 = can not ping.

-5 = can not create socket.

-6 = can not connect socket.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

int ret = clpe_api.Clpe_Connection(1);
if(ret == 0)
{
  printf("Connection successed\n");
}

...

int Clpe_GetMicomVersion(unsigned char* version_master, unsigned char* version_slave) 

Description

  • CLPE-G-Series의 MICOM 펌웨어 버전 정보를 읽어온다.

Parameters

  • unsigned char* version_master : [out] Master MICOM version 정보를 읽어 올 buffer pointer. Ex ) [ ‘r’, ‘2’, ‘.’, ‘0’, ‘.’, ‘0’ ] ( Size : 6 Bytes )

  • unsigned char* version_slave : [out] Slave MICOM version 정보를 읽어 올 buffer pointer. Ex ) [ ‘r’, ‘2’, ‘.’, ‘0’, ‘.’, ‘0’ ] ( Size : 6 Bytes )

Returns

  • int :  Error status.

0 = no error.

-1 = invalid command id.

-3 = failed communication.

-4 = error data checksum.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

unsigned char *master_micomVer = (unsigned char*) malloc(6);
unsigned char *slave_micomVer = (unsigned char*) malloc(6);
int ret = clpe_api.Clpe_GetMicomVersion(master_micomVer, slave_micomVer);
if(ret == 0)
{
  printf("Master Micom Version = %s\n", master_micomVer);
  printf("Slave Micom Version = %s\n", slave_micomVer);
} 

...


int Clpe_GetXavierVersion(unsigned char* versison_master, unsigned char* versison_slave)

Description

  • CLPE-G-Series의 XavierNX 펌웨어 버전 정보를 읽어온다.

Parameters

  • unsigned char* versison_master : [out] Master CLPE-G-Series 의 XavierNX version 정보를 읽어 올 buffer pointer. Ex ) [ ‘r’, ‘1’, ‘.’, ‘0’, ‘.’, ‘0’ ] ( Size : 6 Bytes )

  • unsigned char* versison_slave : [out] Slave CLPE-G-Series의  XavierNX version 정보를 읽어 올 buffer pointer. Ex ) [ ‘r’, ‘1’, ‘.’, ‘0’, ‘.’, ‘0’ ] ( Size : 6 Bytes )

Returns

  • int :  Error status.

0 = no error.

-1 = invalid command id.

-3 = failed communication.

-4 = error data checksum.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

unsigned char *master_xavierVer = (unsigned char*) malloc(6);
unsigned char *slave_xavierVer = (unsigned char*) malloc(6);
int ret = clpe_api.Clpe_GetXavierVersion(master_xavierVer, slave_xavierVer);
if(ret == 0)
{
  printf("Master Xavier Version = %s\n", master_xavierVer);
  printf("Slave Xavier Version = %s\n", slave_xavierVer);
}

...

int Clpe_GetSDKVersion (unsigned char* version)

Description

  • CLPE-G-Series의 SDK 버전 정보를 읽어온다.

Parameters

  • unsigned char* version : [out] CLPE-G-Series SDK version 정보를 읽어 올 buffer pointer. Ex ) [ ‘r’, ‘1’, ‘.’, ‘0’, ‘.’, ‘0’ ] ( Size : 6 Bytes )

Returns

  • int :  Error status.

0 = no error.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

unsigned char *sdkVer = (unsigned char*) malloc(6);
int ret = clpe_api.Clpe_GetXavierVersion(sdkVer);
if(ret == 0)
{
  printf("SDK Version = %s\n", sdkVer);
}

...

int Clpe_GetCamStatus(int* status)

Description

  • 카메라의 연결 상태 정보를 읽어온다.

Parameters

  • int* status : [out] 각 카메라 채널 별 연결 상태를 읽어 올 buffer pointer. Ex ) [ 1, 1, 1, 1, 1, 1, 1, 1] ( Size : 8*sizeof(int) Bytes )

Returns

  • int :  Error status.

0 = no error.

-1 = invalid command id.

-3 = failed communication.

-4 = error data checksum.

Example code

Code Block
ClpeClientApi clpe_api;

int *camStat = (int*) malloc(8 * sizeof(int));
int ret = clpe_api.Clpe_GetCamStatus(camStat);

if(ret == 0)
{
  printf("Camera Status [1] = %d, [2] = %d, [3] = %d, [4] = %d, [5] = %d, [6] = %d, [7] = %d , [8] = %d \n", camStat[0], camStat[1], camStat[2], camStat[3], camStat[4] , camStat[5] , camStat[6] , camStat[7]);
}

...

int Clpe_SetXavierPowerOff()

Description

  • XavierNX 의 전원을 끄도록 요청.

Parameters

  • None.

Returns

  • int :  Error status.

0 = no error.

-1 = invalid command id.

-3 = failed communication.

-4 = error data checksum.

Code Block
languagecpp
ClpeClientApi clpe_api;

int ret = clpe_api.Clpe_SetXavierPowerOff();
if(ret == 0)
{
  printf("Xavier power off success ! Check the LED is off\n");
}

XavierNX의 전원이 정상적으로 꺼지면, 전원선 부근의 LED가 꺼지게 된다.

int Clpe_CheckPci()

Description

  • CLPE-G-Series 가 PC 에서 PCIe 디바이스로 인식되었는지 여부를 확인.

Parameters

  • None.

Returns

  • int :  Error status.

0 = no error.

-1 = pci device is not connected.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

int ret = clpe_api.Clpe_CheckPci();
if(ret == 0)
{
  printf("pci device is connected\n");
}

int Clpe_CheckNetwork()

Description

  • CLPE-G-Series 와 PC 가 네트워크에 정상적으로 연결되었는지 확인.

Parameters

  • None.

Returns

  • int :  Error status.

0 = no error.

-1 = network device is not connected.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

int ret = clpe_api.Clpe_CheckNetwork(); 
if(ret == 0)
{
  printf("network device is connected\n");
} 

int Clpe_CheckPing()

Description

  • Ping 을 통해 CLPE-G-Series 와 PC가 정상적으로 통신이 가능한지를 확인.

Parameters

  • None.

Returns

  • int :  Error status.

0 = no error.

-1 = ping failed.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

int ret = clpe_api.Clpe_CheckPing();
if(ret == 0)
{
  printf("ping successed\n");
}

...

int Clpe_CheckTimeSyncStatus()

Description

  • CLPE-G-Series 가 PC의 시간에 동기화가 되었는지 확인.

Parameters

  • None.

Returns

  • int :  Error status.

0 = no error.

-1 = time sync failed.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

int ret = clpe_api. Clpe_CheckTimeSyncStatus();
if(ret == 0)
{
  printf("time sync successed\n");
}

 

int Clpe_ReqResyncTime()

Description

  • CLPE-G-Series 가 PC와의 시간 동기화를 재요청.

Parameters

  • None.

Returns

  • int :  Error status.

0 = no error.

-1 = time sync failed.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

int ret = clpe_api. Clpe_ Clpe_ReqResyncTime();
if(ret == 0)
{
  printf("Time resync successed\n");
}

...

int Clpe_StartStream (T_CB_APP cb_app, int use_cam_0, int use_cam_1, int use_cam_2, int use_cam_3, int use_cam_4, int use_cam_5, int use_cam_6, int use_cam_7, int display_on)

Description

  • 선택된 카메라의 영상 전송 시작.

Parameters

  • int use_cam_0 : [in] 0th camera 사용 유무 (1 : use, 0 : no use).

  • int use_cam_1 : [in] 1st camera 사용 유무 (1 : use, 0 : no use)

  • int use_cam_2 : [in] 2nd camera 사용 유무 (1 : use, 0 : no use)

  • int use_cam_3 : [in] 3rd camera 사용 유무 (1 : use, 0 : no use)

  • int use_cam_4 : [in] 4st camera 사용 유무 (1 : use, 0 : no use)

  • int use_cam_5 : [in] 5st camera 사용 유무 (1 : use, 0 : no use)

  • int use_cam_6 : [in] 6st camera 사용 유무 (1 : use, 0 : no use)

  • int use_cam_7 : [in] 7st camera 사용 유무 (1 : use, 0 : no use)

  • int display_on  : [in] 카메라 영상을 display할지 유무 (1 : display, 0 : no display)

Returns

  • int :  Error status.

0 = no error.

-1 = Fail to create task.

 Example code

Code Block
languagecpp
int Clpe_GetFrameExample(unsigned int inst, unsigned char* buffer, unsigned int size, struct timeval* camera_timeStamp)
{
             return 0;
}
Code Block
languagecpp
ClpeClientApi clpe_api;

ret = clpe_api.Clpe_StartStream(Clpe_GetFrameExample, 1, 1, 1, 1, 1, 1, 1, 1, 1);
if(ret == 0)
{
  printf("Start stream successed\n");
}

 

int Clpe_StopStream ()

Description

  • 모드 카메라의 영상 전송을 멈춤.

Parameters

  • None.

Returns

  • int :  Error status.

0 = no error.

-1 = Stop error.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

int ret = clpe_api. Clpe_StopStream ();
if(ret == 0)
{
  printf("Stop stream successed\n");
}

...

int Clpe_GetFrameAllCam (int *p_camera_id, unsigned char **p_buffer, unsigned int *p_size, struct timeval *pt_camera_timeStamp)

Description

  • 호출되는 시점 기준으로 가장 최신의 카메라 채널 영상 이미지를 획득.

Parameters

  • int *p_camera_id : [out] camera id of frame

  • unsigned char **p_buffer : [out] buffer of frame

  • unsigned int *p_size : [out] size of frame

  • struct timeval *pt_camera_timeStamp : [out] timestamp of frame in XavierNX

Returns

  • int :  Error status.

0 = no error.

-2 = There is no the updated frame.

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

int camera_id = 0;
unsigned char *p_buffer;
unsigned int size;
struct timeval t_camera_timeStamp;

int ret = clpe_api.Clpe_GetFrameAllCam(&camera_id, &(p_buffer), &size, &t_camera_timeStamp);
if(ret == 0)
{
  printf("Get frame successed\n");
}

‘p_buffer’ 의 영상 포맷은 ‘UYVY’, ‘JPEG’ 이다.

  • 해당 함수 호출 전에 반드시 Clpe_StartStream() 호출되어야 한다.

...

int Clpe_GetFrameOneCam (int camera_id, unsigned char **p_buffer, unsigned int *p_size, struct timeval *pt_camera_timeStamp) 

Description

  • 호출되는 시점 기준으로 사용자가 지정한 카메라 채널의 가장 최신 영상 이미지를 획득.

Parameters

  • int camer_id : [in] camera id of frame

  • unsigned char **p_buffer : [out] buffer of frame

  • unsigned int *p_size : [out] size of frame

  • struct timeval *pt_camera_timeStamp : [out] timestamp of frame in XavierNX

Returns

  • int :  Error status.

0 = no error.

-2 = There is no the updated frame.

-3 = Not available camera id

Example code

Code Block
languagecpp
ClpeClientApi clpe_api;

int camera_id = 0;
unsigned char *p_buffer;
unsigned int size;
struct timeval t_camera_timeStamp;

int ret = clpe_api.Clpe_GetFrameOneCam(0, &(p_buffer), &size, &t_camera_timeStamp);
if(ret == 0)
{
  printf("Get frame successed\n");
}

‘p_buffer’ 의 영상 포맷은 ‘UYVY’, ‘JPEG’ 이다.

  • 해당 함수 호출 전에 반드시 Clpe_StartStream() 호출되어야 한다.

 

int ClpeClientApi::Clpe_SelectFormat(int format)

Description

  • 카메라 영상 전송 시 원하는 포맷 설정

Parameters

  • int format : [in] 포맷 선택 (0 : JPEG, 1 : UYVY)

Returns

  • int :  Error status.

0 = no error.

-1 = invalid command id.

-3 = failed communication.

-4 = error data checksum.

Example code

Code Block
ClpeClientApi clpe_api;

int format = 0;
int ret = clpe_api.Clpe_SelectFormat(format);
if(ret == 0)
{
  printf("Get frame successed\n");
}