UNPKG

@br8kppooint/visca

Version:

Advanced nodejs library for working with VISCA-based PTZ cameras over IP and over serial connections.

214 lines (213 loc) 16.1 kB
import { ViscaTransport } from './transport'; import { CamImageData, CamLensData, CamWideDParams, PTSpeed, PTPos, PTStatus } from './camera'; export interface ViscaCommandParams { description?: string; source?: number; recipient?: any; broadcast?: boolean; msgType?: number; socket?: number; dataType?: number; data?: number[]; onComplete?: Function; onError?: (x: string) => void; onAck?: Function; dataParser?: (x: number[]) => any; status?: number; } export declare class ViscaCommand { source: number; recipient: any; broadcast: boolean; msgType: number; socket: number; dataType: number; data: number[]; packetHexString: string; status: number; description: string; dataParser: (x: number[]) => any; onAck: Function; onComplete: Function; onError: (x: string) => void; addedAt: number; sentAt: number; constructor({ source, recipient, broadcast, description, msgType, socket, dataType, data, onComplete, onError, onAck, dataParser, }: ViscaCommandParams); _header(): number; _hexify(data: number[]): string; _parsePacket(packet: number[]): void; _makeDescription(): string; handleAck(): void; handleError(err: string): void; handleComplete(data?: number[]): void; toString(): string; toPacket(): number[]; send(transport: ViscaTransport): void; static fromPacket(packet: number[]): ViscaCommand; static raw(recipient: number, raw: number[]): ViscaCommand; static cmd(recipient: number, dataType: number, data?: number[], description?: string): ViscaCommand; static inquire(recipient: number, dataType: number, data: number[], onComplete: Function, dataParser: (x: number[]) => any, description?: string): ViscaCommand; static cancel(recipient?: number, socket?: number): ViscaCommand; static addressSet(): ViscaCommand; static cmdInterfaceClearAll(recipient?: number): ViscaCommand; static cmdCamera(recipient?: number, data?: number[], description?: string): ViscaCommand; static cmdOp(recipient?: number, data?: number[], description?: string): ViscaCommand; static inqCamera(recipient: number, query: number[], onComplete?: Function, dataParser?: (x: number[]) => any, description?: string): ViscaCommand; static inqOp(recipient: number, query: number[], onComplete: Function, dataParser: (x: number[]) => any, description?: string): ViscaCommand; static cmdCameraPower(device: number, enable?: boolean): ViscaCommand; static cmdCameraPowerAutoOff(device: number, time?: number): ViscaCommand; static cmdCameraPresetReset(device: number, preset?: number): ViscaCommand; static cmdCameraPresetSet(device: number, preset?: number): ViscaCommand; static cmdCameraPresetRecall(device: number, preset?: number): ViscaCommand; static cmdCameraPanTilt(device: number, xspeed: number, yspeed: number, xmode: number, ymode: number): ViscaCommand; static cmdCameraPanTiltUp(device: number, xspeed: number, yspeed: number): ViscaCommand; static cmdCameraPanTiltDown(device: number, xspeed: number, yspeed: number): ViscaCommand; static cmdCameraPanTiltLeft(device: number, xspeed: number, yspeed: number): ViscaCommand; static cmdCameraPanTiltRight(device: number, xspeed: number, yspeed: number): ViscaCommand; static cmdCameraPanTiltUpLeft(device: number, xspeed: number, yspeed: number): ViscaCommand; static cmdCameraPanTiltDownLeft(device: number, xspeed: number, yspeed: number): ViscaCommand; static cmdCameraPanTiltDownRight(device: number, xspeed: number, yspeed: number): ViscaCommand; static cmdCameraPanTiltUpRight(device: number, xspeed: number, yspeed: number): ViscaCommand; static cmdCameraPanTiltDirect(device: number, xspeed: number, yspeed: number, x: number, y: number, relative?: boolean): ViscaCommand; static cmdCameraPanTiltHome(device: number): ViscaCommand; static cmdCameraPanTiltReset(device: number): ViscaCommand; static cmdCameraPanTiltLimitSet(device: number, corner: number, x: number, y: number): ViscaCommand; static cmdCameraPanTiltLimitClear(device: number, corner: number): ViscaCommand; static cmdCameraZoom(device: number, offinout?: any, speed?: number): ViscaCommand; static cmdCameraZoomStop(device: number): ViscaCommand; static cmdCameraZoomIn(device: number, speed?: number): ViscaCommand; static cmdCameraZoomOut(device: number, speed?: number): ViscaCommand; static cmdCameraZoomDirect(device: number, zoomval: number): ViscaCommand; static cmdCameraDigitalZoom(device: number, enable?: boolean): ViscaCommand; static cmdCameraFocus(device: number, stopfarnear?: any, speed?: number): ViscaCommand; static cmdCameraFocusStop(device: number): ViscaCommand; static cmdCameraFocusFar(device: number, speed?: number): ViscaCommand; static cmdCameraFocusNear(device: number, speed?: number): ViscaCommand; static cmdCameraFocusDirect(device: number, focusval: number): ViscaCommand; static cmdCameraFocusAuto(device: number, enable?: boolean): ViscaCommand; static cmdCameraFocusAutoToggle(device: number, data: number): ViscaCommand; static cmdCameraFocusTrigger(device: number, data: number): ViscaCommand; static cmdCameraFocusInfinity(device: number, data: number): ViscaCommand; static cmdCameraFocusSetNearLimit(device: number, limit?: number): ViscaCommand; static cmdCameraFocusAutoSensitivity(device: number, high?: boolean): ViscaCommand; static cmdCameraFocusAutoMode(device: number, mode?: number): ViscaCommand; static cmdCameraFocusAutoIntervalTime(device: number, movementTime?: number, intervalTime?: number): ViscaCommand; static cmdCameraFocusIRCorrection(device: number, enable?: boolean): ViscaCommand; static cmdCameraZoomFocus(device: number, zoomval?: number, focusval?: number): ViscaCommand; static cmdCameraWBMode(device: number, mode?: number): ViscaCommand; static cmdCameraWBTrigger(device: number, data: number): ViscaCommand; static cmdCameraGain(device: number, mode?: string, resetupdown?: number, directvalue?: number): ViscaCommand; static cmdCameraGainUp(device: number): ViscaCommand; static cmdCameraGainDown(device: number): ViscaCommand; static cmdCameraGainReset(device: number): ViscaCommand; static cmdCameraGainDirect(device: number, value: number): ViscaCommand; static cmdCameraGainRUp(device: number): ViscaCommand; static cmdCameraGainRDown(device: number): ViscaCommand; static cmdCameraGainRReset(device: number): ViscaCommand; static cmdCameraGainRDirect(device: number, value: number): ViscaCommand; static cmdCameraGainBUp(device: number): ViscaCommand; static cmdCameraGainBDown(device: number): ViscaCommand; static cmdCameraGainBReset(device: number): ViscaCommand; static cmdCameraGainBDirect(device: number, value: number): ViscaCommand; static cmdCameraGainLimit(device: number, value: number): ViscaCommand; static cmdCameraExposureMode(device: number, mode?: number): ViscaCommand; static cmdCameraExposureCompensationEnable(device: number, enable?: boolean): ViscaCommand; static cmdCameraExposureCompensationAdjust(device: number, resetupdown: number): ViscaCommand; static cmdCameraExposureCompensationUp(device: number): ViscaCommand; static cmdCameraExposureCompensationDown(device: number): ViscaCommand; static cmdCameraExposureCompensationReset(device: number): ViscaCommand; static cmdCameraExposureCompensationDirect(device: number, directval?: number): ViscaCommand; static cmdCameraBacklightCompensation(device: number, enable?: boolean): ViscaCommand; static cmdCameraShutter(device: number, resetupdown: number, directvalue?: number): ViscaCommand; static cmdCameraShutterUp(device: number): ViscaCommand; static cmdCameraShutterDown(device: number): ViscaCommand; static cmdCameraShutterReset(device: number): ViscaCommand; static cmdCameraShutterDirect(device: number, value?: number): ViscaCommand; static cmdCameraShutterSlow(device: number, auto?: boolean): ViscaCommand; static cmdCameraIris(device: number, resetupdown: number, directvalue?: number): ViscaCommand; static cmdCameraIrisUp(device: number): ViscaCommand; static cmdCameraIrisDown(device: number): ViscaCommand; static cmdCameraIrisReset(device: number): ViscaCommand; static cmdCameraIrisDirect(device: number, value?: number): ViscaCommand; static cmdCameraAperture(device: number, resetupdown: number, directvalue?: number): ViscaCommand; static cmdCameraApertureUp(device: number): ViscaCommand; static cmdCameraApertureDown(device: number): ViscaCommand; static cmdCameraApertureReset(device: number): ViscaCommand; static cmdCameraApertureDirect(device: number, value?: number): ViscaCommand; static cmdCameraHighResMode(device: number, enable?: boolean): ViscaCommand; static cmdCameraHighSensitivityMode(device: number, enable?: boolean): ViscaCommand; static cmdCameraNoiseReduction(device: number, val: number): ViscaCommand; static cmdCameraGamma(device: number, val: number): ViscaCommand; static cmdCameraEffect(device: number, effectType: number): ViscaCommand; static cmdCameraEffectDigital(device: number, effectType: number): ViscaCommand; static cmdCameraEffectDigitalIntensity(device: number, level: number): ViscaCommand; static cmdCameraEffectOff(device: number): ViscaCommand; static cmdCameraEffectPastel(device: number): ViscaCommand; static cmdCameraEffectNegative(device: number): ViscaCommand; static cmdCameraEffectSepia(device: number): ViscaCommand; static cmdCameraEffectBW(device: number): ViscaCommand; static cmdCameraEffectSolar(device: number): ViscaCommand; static cmdCameraEffectMosaic(device: number): ViscaCommand; static cmdCameraEffectSlim(device: number): ViscaCommand; static cmdCameraEffectStretch(device: number): ViscaCommand; static cmdCameraEffectDigitalOff(device: number): ViscaCommand; static cmdCameraEffectDigitalStill(device: number): ViscaCommand; static cmdCameraEffectDigitalFlash(device: number): ViscaCommand; static cmdCameraEffectDigitalLumi(device: number): ViscaCommand; static cmdCameraEffectDigitalTrail(device: number): ViscaCommand; static cmdCameraFreeze(device: number, enable?: boolean): ViscaCommand; static cmdCameraICR(device: number, enable?: boolean): ViscaCommand; static cmdCameraICRAuto(device: number, enable?: boolean): ViscaCommand; static cmdCameraICRAutoThreshold(device: number, val?: number): ViscaCommand; static cmdCameraIDWrite(device: number, data: number): ViscaCommand; static cmdCameraChromaSuppress(device: number, value: number): ViscaCommand; static cmdCameraColorGain(device: number, value: number): ViscaCommand; static cmdCameraColorHue(device: number, value: number): ViscaCommand; static inqCameraPower: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraICRMode: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraICRAutoMode: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraICRThreshold: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraGainLimit: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraGain: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraGainR: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraGainB: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraDZoomMode: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraZoomPos: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraFocusAutoStatus: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraFocusAutoMode: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraFocusIRCorrection: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraFocusPos: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraFocusNearLimit: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraFocusAutoIntervalTime: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraFocusSensitivity: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraWBMode: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraExposureMode: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraShutterSlowMode: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraShutterPos: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraIris: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraBrightness: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraExposureCompStatus: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraExposureCompPosition: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraBacklightStatus: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraWideDMode: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraWideDParams: (recipient: number, onComplete: (x: CamWideDParams) => void) => ViscaCommand; static inqCameraAperture: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraHighResStatus: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraNoiseReductionStatus: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraHighSensitivityStatus: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraFreezeStatus: (recipient: number, onComplete: (x: boolean) => void) => ViscaCommand; static inqCameraEffect: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraEffectDigital: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraEffectDigitalLevel: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraID: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraChromaSuppressStatus: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraColorGain: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraColorHue: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqVideoFormatNow: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqVideoFormatNext: (recipient: number, onComplete: (x: number) => void) => ViscaCommand; static inqCameraPanTiltSpeed: (recipient: number, onComplete: (x: PTSpeed) => void) => ViscaCommand; static inqCameraPanTiltPos: (recipient: number, onComplete: (x: PTPos) => void) => ViscaCommand; static inqCameraPanTiltStatus: (recipient: number, onComplete: (x: PTStatus) => void) => ViscaCommand; static inqCameraLens: (recipient: number, onComplete: (x: CamLensData) => void) => ViscaCommand; static inqCameraImage: (recipient: number, onComplete: (x: CamImageData) => void) => ViscaCommand; }