2025-03-12 15:01:58 +08:00

72 lines
1.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
@file DogAuthImpl.h
@brief 加密狗认证接口类的实现文件
@author 周正龙
*/
#pragma once
#include "sys_license_auth_api/LicenseAuthInterface.h"
#include "sys_dog_auth_api/DogAuthInterface.h"
#ifndef DISABLE_DOG_AUTH
#ifdef KBD_X86
#include "sys_dog_auth_api/dog_api.h"
#endif
#endif
namespace iot_sys
{
class CDogAuthImpl : public CDogAuthInterface
{
public:
explicit CDogAuthImpl();
virtual ~CDogAuthImpl();
/**
@brief 检查系统授权状态
@return 成功返回iotSucces,失败返回相应错误码
*/
virtual int checkAuthStatus() override;
/**
@brief 初始化
@return 成功返回iotSucces,失败返回相应错误码
*/
int initialize();
protected:
/**
@brief 检查超级狗授权状态
@return 成功返回iotSucces,失败返回相应错误码
*/
int checkDogAuthStatus();
/**
@brief 检查License授权状态
@return 成功返回iotSucces,失败返回相应错误码
*/
int checLicenseAuthStatus();
/**
* @brief :CDogAuthImpl::loginSupperDog()
* 超级狗登录
* @return 成功返回iotSuccess失败返回iotFailed
*/
int loginSupperDog(int nProductId);
private:
#ifndef DISABLE_DOG_AUTH
#ifdef KBD_X86
dog_status_t m_dogStatus;
dog_handle_t m_dogHandle;
#endif
#endif
CLicenseAuthInterfacePtr m_ptrLicenseAuth;
int m_nProductId;
int m_nAuthModel;//授权模式
};
typedef boost::shared_ptr<CDogAuthImpl> CDogAuthImplPtr;
}
//namespace iot_sys