subject-two/ohos/so/@ohos.onvifclient.d.ts
2025-02-11 09:26:26 +08:00

176 lines
7.3 KiB
TypeScript
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.

/**
* A utility class used for handling objects that use the DataAbilityHelper scheme.
* @name dataUriUtils
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
*/
declare namespace onvifclient {
interface LoginInfo {
/** Host Uri: the maximum length is 64 */
host: string;
/** Username: the length is 32 */
user: string;
/** Password: maximum length is 32 */
pass: string;
}
interface SpeedInfo {
/** horizen speed: -1.0<->1.0 */
speed_x: number;
/** vertical speed -1.0<->1.0 */
speed_y: number;
/** room speed: 0<->1.0 */
speed_room: number;
}
interface PositionInfo {
/** horizen speed: -1.0<->1.0 */
pantiltX: number;
/** vertical speed -1.0<->1.0 */
pantiltY: number;
/** room speed: 0<->1 */
zoom: number;
}
interface OnvifResult {
/** isSuccess */
result: boolean;
/** errorCode: */
errorCode: number;
/** errorString: */
errorString: string;
/** int Data: */
dataInt: number;
/** string Data: */
dataString: string;
}
/* datetime_type : 0 manual ,1 NTP*/
interface TimeInfo {
datetime_type:number;
year: number;
month: number;
day: number;
hour: number;
minute: number;
second: number;
}
/***
#define SOAP_OK 0
#define SOAP_CLI_FAULT 1
#define SOAP_SVR_FAULT 2
#define SOAP_TAG_MISMATCH 3
#define SOAP_TYPE 4
#define SOAP_SYNTAX_ERROR 5
#define SOAP_NO_TAG 6
#define SOAP_IOB 7
#define SOAP_MUSTUNDERSTAND 8
#define SOAP_NAMESPACE 9
#define SOAP_USER_ERROR 10
#define SOAP_FATAL_ERROR 11 deprecated
#define SOAP_FAULT 12
#define SOAP_NO_METHOD 13
#define SOAP_NO_DATA 14
#define SOAP_GET_METHOD 15
#define SOAP_PUT_METHOD 16
#define SOAP_PATCH_METHOD 17
#define SOAP_DEL_METHOD 18
#define SOAP_HTTP_METHOD 19
#define SOAP_EOM 20
#define SOAP_MOE 21
#define SOAP_HDR 22
#define SOAP_NULL 23
#define SOAP_DUPLICATE_ID 24
#define SOAP_MISSING_ID 25
#define SOAP_HREF 26
#define SOAP_UDP_ERROR 27
#define SOAP_TCP_ERROR 28
#define SOAP_HTTP_ERROR 29
#define SOAP_SSL_ERROR 30
#define SOAP_ZLIB_ERROR 31
#define SOAP_DIME_ERROR 32
#define SOAP_DIME_HREF 33
#define SOAP_DIME_MISMATCH 34
#define SOAP_DIME_END 35
#define SOAP_MIME_ERROR 36
#define SOAP_MIME_HREF 37
#define SOAP_MIME_END 38
#define SOAP_VERSIONMISMATCH 39
#define SOAP_PLUGIN_ERROR 40
#define SOAP_DATAENCODINGUNKNOWN 41 unused
#define SOAP_REQUIRED 42
#define SOAP_PROHIBITED 43
#define SOAP_OCCURS 44
#define SOAP_LENGTH 45
#define SOAP_PATTERN 46
#define SOAP_FD_EXCEEDED 47
#define SOAP_UTF_ERROR 48
#define SOAP_NTLM_ERROR 49
#define SOAP_LEVEL 50
#define SOAP_FIXED 51
#define SOAP_EMPTY 52
#define SOAP_END_TAG 53
#define SOAP_ERR 99
*/
/**
* Obtains the ID attached to the end of the path component of the given uri.
*
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param uri Indicates the uri object from which the ID is to be obtained.
* @return Returns the ID attached to the end of the path component;
*/
function startProbDetect(params: string): OnvifResult;
function getProbResult(): OnvifResult;
function rebootDevice(loginInfo: LoginInfo): OnvifResult;
function probDevice(loginInfo: LoginInfo): OnvifResult;
function ptzMoveTime( speedInfo: SpeedInfo, millsec: number,loginInfo: LoginInfo) : OnvifResult;
function ptzMovePosition(positionInfo:PositionInfo,speedInfo: SpeedInfo, loginInfo: LoginInfo): OnvifResult;
function ptzGetPresets( loginInfo: LoginInfo):OnvifResult;
function ptzGotoPreset(presetToken: string, loginInfo: LoginInfo): OnvifResult;
function ptzSetPreset(presetToken: string,loginInfo: LoginInfo): OnvifResult;
function ptzRemovePreset(presetToken: string,loginInfo: LoginInfo): OnvifResult;
function rebootDevice(loginInfo: LoginInfo): OnvifResult;
//调用海康SDk直接打开摄像头不会获取流地址,播放和暂停和关闭摄像头
function openStreaming(loginInfo: LoginInfo,uri:string): OnvifResult;
function closeStreaming(loginInfo: LoginInfo,uri:string): OnvifResult;
//录像通过传入文件路径调用SDK开启视频录像第二次点击录像调用sdk关闭视频录制视频
function startRecordVideo(uri:string,filePath:string,fileHandler:number): OnvifResult;
function endRecordVideo(videoHandle: number): OnvifResult;
//抓拍照片,通过传入文件路径,实现图片的抓拍和下载
function getVideoSnapshot(uri:string,filePath:string,fileHandler:number): OnvifResult;
//获取摄像头信息,包含亮度、对比度、饱和度、色度等
function getImageInfo(loginInfo: LoginInfo): OnvifResult;
//设置摄像头时间信息
function setDeviceTime(loginInfo: LoginInfo, timeinfo:TimeInfo): OnvifResult;
// 获取所有的水印 OSD(on-screen display) ,作为文字水印有两种TextType模式DateAndTime 和 Plain
//{"OSDToken":"OsdToken_100","ConfigurationToken": "VideoSourceToken","Type": "Text","PositionType": "Custom","Position_X": -1,"Position_Y": 0.88888901472091675,
// "TextType": "DateAndTime","DateFormat": "yyyy/MM/dd","TimeFormat": "HH:mm:ss","FontSize": 32 }
// { "OSDToken":"OsdToken_100","ConfigurationToken": "VideoSourceToken","Type": "Text","PositionType": "Custom","Position_X": 0.45454499125480652,"Position_Y": -0.7777780294418335,
// "TextType": "Plain", "FontSize": 32,"PlainText": "Camera 01" }
function getAllOSD(loginInfo: LoginInfo): OnvifResult;
// 设置水印 osdString 是json string 形式如同 getAllOSD 返回的结果
function setOSD(loginInfo: LoginInfo,osdString:string): OnvifResult;
// 创建水印 osdString 是json string 形式如同 setOSD方法 但不用传递OSDToken OSDToken 在方法的返回值里携带
function createOSD(loginInfo: LoginInfo,osdString:string): OnvifResult;
// 删除水印 osdToken 是唯一的传入参数,不必其他参数
function deleteOSD(loginInfo: LoginInfo,osdToken:string): OnvifResult;
}
export default onvifclient;