55 lines
1.7 KiB
C++
55 lines
1.7 KiB
C++
/********************************************************************************************
|
||
Copyright : XianZhisensorTechnologiesCo.,Ltd
|
||
File Name : discovery.h
|
||
Description: Privide class of discover
|
||
Author : Yaming Wang
|
||
Version : 1.0
|
||
Data : 2019-11-18
|
||
History :
|
||
*********************************************************************************************/
|
||
#ifndef DKAM_DISCOVERY_H
|
||
#define DKAM_DISCOVERY_H
|
||
#include "dkam_log.h"
|
||
#include "dkam_base_type.h"
|
||
#include "dkam_common_socket.h"
|
||
#include <string>
|
||
#include <vector>
|
||
|
||
|
||
class Discovery :private CommonSocket{
|
||
public:
|
||
Discovery();
|
||
~Discovery();
|
||
//设置发现设备时log日志的等级开关,决定是否开启某一个等级的日志打印,默认关闭(0:关闭 1:开启)
|
||
void SetLogLevelSwitch(int error, int debug, int warnning, int info);
|
||
//发现相机
|
||
int DiscoverCamera(std::vector<DiscoveryInfo>* discovery_info);
|
||
//对发现的相机排序 0 IP 1 序列号
|
||
int CameraSort(std::vector <DiscoveryInfo>* discovery_info, int sort_mode);
|
||
//设置相机ip
|
||
int ForceIp(DiscoveryInfo discovery_info, char* ip, char* mask, char* gateway);
|
||
//两点分十进制ip转化为int型
|
||
unsigned int ConvertIpStringToInt(char* str_ip);
|
||
//将int型ip转换为点分十进制形式
|
||
char *ConvertIpIntToString(unsigned int ip);
|
||
//判断相机的IP和PC的IP是否在同一网段
|
||
bool WhetherIsSameSegment(DiscoveryInfo discovery_info);
|
||
|
||
private:
|
||
//win32平台发现相机
|
||
int DiscoverCameraWin32(std::vector<DiscoveryInfo>** discovery_info);
|
||
//linux平台发现相机
|
||
int DiscoverCameraLinux(std::vector<DiscoveryInfo>** discovery_info);
|
||
|
||
private:
|
||
int camera_num_;
|
||
unsigned short req_id_;
|
||
char *camera_ip_;
|
||
cameralog logq;
|
||
};
|
||
|
||
|
||
|
||
#endif //!DKAM_DISCOVERY_H
|
||
|