new Foscam(config)
Foscam Client SDK
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
object
|
|
Methods
(static) parseResponse(xml) → {Promise.<object>}
Parses the response from the camera API request
Parameters:
Name | Type | Description |
---|---|---|
xml |
string
|
XML response |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
addAccount()
Add user account
addMultiDev()
Add multiy device
changePassword()
Change password
changeUserName()
Change user name
changeUserNameAndPwdTogether()
Change user name and password together
clearIOAlarmOutput() → {Promise.<object>}
Clean IO alarm output.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
closeInfraLed() → {Promise.<object>}
Force close infra led.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
delAccount()
Delete user account
delMultiDev(channel)
Delete multiy device
Parameters:
Name | Type | Description |
---|---|---|
channel |
int
|
Channel number |
exportConfig() → {Promise.<object>}
Export config file. After call this command, you can get the config file by visit the following addr:/configs/export/configs.bin
Returns:
- Type:
-
Promise.<object>
A promise to the response.
flipVideo(isFlip) → {Promise.<object>}
Set flip video setting.
Parameters:
Name | Type | Description |
---|---|---|
isFlip |
boolean
|
If flip should be set or not. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
fwUpgrade()
Upgrade firmware
get(command, paramsopt) → {Promise.<object>}
Sends an API request to the camera and parses the response.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
command |
string
|
CGI command to send |
|
params |
object
|
<optional> |
Params to include with the request |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
get485Info() → {Promise.<object>}
Get informations of 485.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getAlarmRecordConfig() → {Promise.<Foscam.alarmRecordConfig>}
Get alarm record config.
getCruiseCtrlMode() → {Promise.<object>}
Get control mode for continue cruise, by time or count.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getCruiseLoopCnt() → {Promise.<object>}
Set counts for continue cruise.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getCruisePrePointLingerTime()
Get linger time for cruise,when pt arrive prepoint
getCruiseTime() → {Promise.<object>}
Set time for continue cruise.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getCruiseTimeCustomed() → {Promise.<object>}
Set time for continue cruise by costomer.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getDDNSConfig() → {Promise.<object>}
Get DDNS config.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getDeFrameLevel() → {Promise.<{level: int}>}
Get status of enhance the night vision definition
Returns:
- Type:
-
Promise.<{level: int}>
A promise to the response
getDevInfo() → {Promise.<object>}
Get camera information.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getDevName() → {Promise.<object>}
Get camera name.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getDevState() → {Promise.<object>}
Get all device state.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getFirewallConfig() → {Promise.<object>}
Get firewall config
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getFtpConfig() → {Promise.<object>}
Get FTP config.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getGeneratePubKey() → {Promise.<object>}
Get public key generated by camera for software reset.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getH264FrameReferenceMode() → {Promise.<{mode: int}>}
Get frame shipping reference mode of H264 encode stream.
Returns:
- Type:
-
Promise.<{mode: int}>
A promise to the response.
- 0: Normal reference mode
- 1: Two frames are separated by four skipping frames
getImageSetting() → {Promise.<Foscam.getImageSettingResponse>}
Get color attribute of video.
Returns:
- Type:
-
Promise.<Foscam.getImageSettingResponse>
a promise to Foscam.getImageSettingResponse
.
getInfraLedConfig() → {Promise.<object>}
Get infra led config.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getIOAlarmConfig() → {Promise.<Foscam.ioAlarmConfig>}
Get IO alarm config.
Returns:
- Type:
-
Promise.<Foscam.ioAlarmConfig>
A promise to the response.
getIPInfo() → {Promise.<object>}
Get IP Info.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getLocalAlarmRecordConfig() → {Promise.<Foscam.localAlarmRecordConfig>}
Get local alarm-record config
getLog(paramsopt) → {Promise.<object>}
Get system log
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object
|
<optional> |
Params for pagination.
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getMainVideoStreamType() → {Promise.<{streamType: int}>}
Get the stream type of main stream.
Returns:
- Type:
-
Promise.<{streamType: int}>
A promise to the response.
getMirrorAndFlipSetting() → {Promise.<Foscam.getMirrorAndFlipSettingResponse>}
Get mirror and flip attribute of video.
getMJStream() → {Promise.<object>}
Get motion jpeg stream.
- Motion jpeg stream data is returned from http server by a serverpush mode
- MJ stream is VGA resolution @ 15fps
- For some version of Firefox browse, the Firefox will crash when use
“GetMJStream” CGI to get mjstream long time. This problem is due to the
browse has some defects, it can not parse data correctly and directly. In
order to fix this problem, we should as follows:
- Create a .html empty document, such as “MJ.html”.
- Input the content into you .txt document, as follows:
<html><body> <img src="http://example.com:99/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=admin&pwd=" /> </body></html>
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getMotionDetectConfig() → {Promise.<Foscam.motionDetectConfig>}
Get motion detect config.
- Motion alarm linkage (bit3 | bit2 | bit1 | bit0 )
- bit0: Ring
- bit1: Sent mail
- bit2: Snap picture
- bit3: Record
getMotionDetectConfig1() → {Promise.<Foscam.motionDetectConfig1>}
Get motion detect config. New CGI command obtained from Foscam Technical Support
- Motion alarm linkage (bit3 | bit2 | bit1 | bit0 )
- bit0: Ring
- bit1: Sent mail
- bit2: Snap picture
- bit3: Record
Returns:
- Type:
-
Promise.<Foscam.motionDetectConfig1>
A promise to the response.
getMultiDevDetailInfo(channel) → {Promise.<object>}
Get multi device information.
Parameters:
Name | Type | Description |
---|---|---|
channel |
int
|
Channel no |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getMultiDevList() → {Promise.<object>}
Get multi device list.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getOSDMask() → {Promise.<Foscam.getOSDMaskResponse>}
Get OSD mask status.
Returns:
- Type:
-
Promise.<Foscam.getOSDMaskResponse>
A promise to the response.
getOSDMaskArea() → {Promise.<Foscam.getOSDMaskArea>}
Get OSD mask area info. Our device can only support 4 mask areas.
getOSDSetting() → {Promise.<Foscam.getOSDSetting>}
Get OSD config.
getP2PEnable() → {Promise.<object>}
Get p2p status.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getP2PInfo() → {Promise.<object>}
Get p2p UID.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getP2PPort() → {Promise.<object>}
Get p2p port.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getPCAudioAlarmCfg() → {Promise.<{isEnablePCAudioAlarm: boolean}>}
Get audio alarm config for PC(web live video).
Returns:
- Type:
-
Promise.<{isEnablePCAudioAlarm: boolean}>
A promise to the response.
getPortInfo() → {Promise.<object>}
Get ports of camera.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getPPPoEConfig() → {Promise.<object>}
Get PPPoE config.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductAllInfo() → {Promise.<object>}
Get camera Information.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductAppVer() → {Promise.<object>}
Get camera application version.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductAudioFlag() → {Promise.<object>}
Whether camera support audio-speak.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductIoAlarmFlag() → {Promise.<object>}
Whether camera support IO alarm.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductLanguage() → {Promise.<object>}
Get camera main language.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductModel() → {Promise.<object>}
Get camera model number.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductModelName() → {Promise.<object>}
Get camera model name.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductOnvifFlag() → {Promise.<object>}
Whether camera support Onvif.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductOutdoorFlag() → {Promise.<object>}
Whether camera is outdoor machine.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductP2pFlag() → {Promise.<object>}
Whether camera support P2p.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductPtFlag() → {Promise.<object>}
Whether camera is pt machine.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductRs485Flag() → {Promise.<object>}
Whether camera support rs485.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductSdFlag() → {Promise.<object>}
Whether camera support sd card.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductSensorType() → {Promise.<object>}
Get camera sensor type number.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductTalkFlag() → {Promise.<object>}
Whether camera support audio-talk.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductWifiType() → {Promise.<object>}
Get camera wifi type number.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductWpsFlag() → {Promise.<object>}
Whether camera support Wps.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getProductZoomFlag() → {Promise.<object>}
Whether camera is zoom machine.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getPTZPrePointForSelfTest() → {Promise.<object>}
Get the presetpoint for selftest of PTZ.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getPTZPresetPointList() → {Promise.<object>}
Get all preset point.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getPTZSelfTestMode() → {Promise.<object>}
Get the selftest mode of PTZ.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getPTZSpeed() → {Promise.<object>}
Get the speed of PT.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getRatio() → {Promise.<{ratio: int}>}
Get value for image distortion correction.
Returns:
- Type:
-
Promise.<{ratio: int}>
A promise to the response. Three ranks for image distortion correction:
- High: 150
- Middle 210
- Low: 430
getRaw(command, paramsopt, optionsopt) → {Promise.<object>}
Sends an API request to the camera and returns the raw response.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
command |
string
|
CGI command to send. |
|
params |
object
|
<optional> |
Params to include with the request. |
options |
object
|
<optional> |
Additional options to pass to request-promise |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getRecordList() → {Promise.<object>}
Get record list.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getRecordList2() → {Promise.<object>}
Get record list.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getRecordPath() → {Promise.<object>}
Get record path for storage.
Returns:
- Type:
-
Promise.<object>
A promise to the response. path: 0-SD card, 2-FTP server free: The free capacity of storage device total: The total capacity of storage device
getScheduleInfraLedConfig() → {Promise.<object>}
Get config for infra led switch schedule.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getScheduleRecordConfig() → {Promise.<Foscam.scheduleRecordConfig>}
Get config for schedule recording.
getScheduleRecordStreamChannel() → {Promise.<{chn: int}>}
Get stream channel for schedule record.
Returns:
- Type:
-
Promise.<{chn: int}>
A promise to the response.
- 0: main stream
- 1: sub stream
getScheduleSnapConfig() → {Promise.<Foscam.scheduleSnapConfig>}
Get schedule snap config. The min unit of schedule is half an hour, scheduleN value range 2N -1(N[0-48])
getSessionList() → {Promise.<object>}
Get current session list of the camera.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getSMTPConfig() → {Promise.<object>}
Get mail config.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getSnapConfig() → {Promise.<Foscam.snapConfig>}
Get snap config.
getSubVideoStreamParam() → {Promise.<object>}
Get sub video stream param.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getSubVideoStreamType() → {Promise.<{streamType: int}>}
Get the stream type of sub stream.
Returns:
- Type:
-
Promise.<{streamType: int}>
A promise to the response.
getSystemTime() → {Promise.<object>}
Get system time.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getUPnPConfig() → {Promise.<object>}
Get UpnP config.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getUserList() → {Promise.<object>}
Get user account list of the camera.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getVideoStreamParam() → {Promise.<Foscam.videoStreamParamResponse>}
Get video stream param.
getWifiConfig() → {Promise.<object>}
Get wifi config.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getWifiList(startNoopt) → {Promise.<object>}
Get the aps around after refreshWifiList.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
startNo |
int
|
<optional> |
The page number of wifilist to return. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
getZoomSpeed() → {Promise.<object>}
Get the speed of Zoom.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
importConfig()
Import config file
logIn(paramsopt) → {Promise.<object>}
User log in to camera.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
<optional> |
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
logOut(usernameopt) → {Promise.<object>}
User log out to camera.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
username |
string
|
<optional> |
Username to login. Defaults to username supplied at api initialization. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
mirrorVideo(isMirror) → {Promise.<object>}
Set mirror video setting.
Parameters:
Name | Type | Description |
---|---|---|
isMirror |
boolean
|
If mirror should be set or not. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
(private) notImplemented()
Generic method to throw an error for API methods that haven't been implemented yet
openInfraLed() → {Promise.<object>}
Force open infra led.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzAddPresetPoint()
Add preset point
ptzDelCruiseMap()
Delete a cruise map
ptzDeletePresetPoint()
Delete preset point by name
ptzGetCruiseMapInfo()
Get the detail info of a cruise map by name
ptzGetCruiseMapList() → {Promise.<object>}
Get all cruise map list. Our device can support at most 8 cruise map. We have 2 maps default:Horizental/Vertical.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzGotoPresetPoint() → {Promise.<object>}
Goto preset position.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzMoveBottomLeft() → {Promise.<object>}
Move to bottom left.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzMoveBottomRight() → {Promise.<object>}
Move to bottom right.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzMoveDown() → {Promise.<object>}
Move down.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzMoveLeft() → {Promise.<object>}
Move left.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzMoveRight() → {Promise.<object>}
Move right.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzMoveTopLeft() → {Promise.<object>}
Move to top left.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzMoveTopRight() → {Promise.<object>}
Move to top right.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzMoveUp() → {Promise.<object>}
Move up.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzReset() → {Promise.<object>}
Reset PT to default position.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzSetCruiseMap()
Add a cruise map
ptzStartCruise()
Start a specificate cruisep
ptzStopCruise() → {Promise.<object>}
Start current cruise.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
ptzStopRun() → {Promise.<object>}
Stop run PT.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
rebootSystem() → {Promise.<object>}
Reboot camera.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
refreshWifiList() → {Promise.<object>}
Start scan the aps around.
- Source:
Returns:
- Type:
-
Promise.<object>
A promise to the response.
reloadRecordIndex() → {Promise.<object>}
Synchronization of record index for Play.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
resetImageSetting() → {Promise.<object>}
Reset color parameters to default value.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
restoreToFactorySetting() → {Promise.<object>}
Restore to factory setting.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
set485Info()
Get informations of 485
setAlarmRecordConfig(config) → {Promise.<object>}
Set alarm record config
Parameters:
Name | Type | Description |
---|---|---|
config |
Foscam.alarmRecordConfig
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setBrightness(brightness) → {Promise.<object>}
Set brightness of video.
Parameters:
Name | Type | Description |
---|---|---|
brightness |
int
|
New level of brightness. Between 1-100. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setContrast(contrast) → {Promise.<object>}
Set contrast of video.
Parameters:
Name | Type | Description |
---|---|---|
contrast |
int
|
New level of contrast. Between 1-100. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setCruiseCtrlMode()
Set control mode for continue cruise, by time or count
setCruiseLoopCnt()
Set counts for continue cruise
setCruisePrePointLingerTime()
Set linger time for cruise,when pt arrive prepoint
setCruiseTime()
Set time for continue cruise
setCruiseTimeCustomed()
Set time for continue cruise by costomer
setDDNSConfig()
Set DDNS config
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
setDeFrameLevel(level) → {Promise.<object>}
Set status to enhance night vision definition
Parameters:
Name | Type | Description |
---|---|---|
level |
int
|
Enhance status, 0 or 1 |
Returns:
- Type:
-
Promise.<object>
A promise to the response
setDenoiseLevel(level) → {Promise.<object>}
Set DenoiseLevel of video. Not in use.
Parameters:
Name | Type | Description |
---|---|---|
level |
int
|
New level of denoise. Between 1-100. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setDevName(name) → {Promise.<object>}
Set camera name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Camera name. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setFirewallConfig()
Set firewall config
setFtpConfig()
Set FTP config
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
setH264FrameReferenceMode(mode) → {Promise.<object>}
Set frame shipping reference mode of H264 encode stream.
Parameters:
Name | Type | Description |
---|---|---|
mode |
int
|
1 or 0. 0 for 'Normal reference mode'. 1 for 'Two frames are separated by four skipping frames'. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setHue(hue) → {Promise.<object>}
Set hue of video.
Parameters:
Name | Type | Description |
---|---|---|
hue |
int
|
New level of hue. Between 1-100. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setInfraLedConfig()
Set infra led config
setIOAlarmConfig(ioAlarmConfig) → {Promise.<object>}
Set IO alarm config
Parameters:
Name | Type | Description |
---|---|---|
ioAlarmConfig |
Foscam.ioAlarmConfig
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setIpInfo()
Set IP Info
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
setLocalAlarmRecordConfig(params) → {Promise.<object>}
Set local alarm-record config
Parameters:
Name | Type | Description |
---|---|---|
params |
Foscam.localAlarmRecordConfig
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setMainVideoStreamType(streamType) → {Promise.<object>}
Set the stream type of main stream.
Parameters:
Name | Type | Description |
---|---|---|
streamType |
int
|
The stream type 0~3. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setMotionDetectConfig(params) → {Promise.<object>}
Set motion detect config
- Video region is divided into 10*10 sub areasideo region is divided into 10*10 sub areas
- The min unit of schedule is half an hour, scheduleN value range 2N -1(N[0-48])
- areaN value 2N -1(N[0-10])
Parameters:
Name | Type | Description |
---|---|---|
params |
Foscam.motionDetectConfig
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
Example
/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&linkage=16&
snapInterval=2&sensitivity=1&triggerInterval=5&schedule0=1023&schedule1=
1023&schedule2=1023&schedule3=1023&schedule4=1023&schedule5=1023&
schedule6=1023&area0=1023&area1=1023&area2=1023&area3=1023&area4=
1023&area5=1023&area6=1023&area7=1023&area7=1023&area8=1023&area9=1023
setMotionDetectConfig1(params) → {Promise.<object>}
Set motion detect config
- Video region is divided into 10*10 sub areasideo region is divided into 10*10 sub areas
- The min unit of schedule is half an hour, scheduleN value range 2N -1(N[0-48])
- areaN value 2N -1(N[0-10])
Parameters:
Name | Type | Description |
---|---|---|
params |
Foscam.motionDetectConfig1
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
Example
/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&linkage=0&
snapInterval=0&triggerInterval=0&isMovAlarmEnable=1&isPirAlarmEnable=1&
schedule0=0&schedule1=0&schedule2=0&schedule3=0&schedule4=0&schedule5=0&
schedule6=0&x1=0&y1=0&width1=10000&height1=10000&threshold1=52254&
sensitivity1=30396&valid1=0&x2=0&y2=0&width2=10000&height2=10000&threshold2=0&
sensitivity2=0&valid2=0&x3=0&y3=0&width3=12&height3=0&threshold3=2&
sensitivity3>0&valid3=65535
setOSDMask(isEnabledOSDMask) → {Promise.<object>}
Set OSD mask status.
Parameters:
Name | Type | Description |
---|---|---|
isEnabledOSDMask |
boolean
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setOSDMaskArea(params) → {Promise.<object>}
Set OSD mask area info. Our device can only support 4 mask areas.
Parameters:
Name | Type | Description |
---|---|---|
params |
Foscam.getOSDMaskArea
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setOSDSetting(params) → {Promise.<object>}
Set OSD config.
Parameters:
Name | Type | Description |
---|---|---|
params |
Foscam.getOSDSetting
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setP2PEnable()
Set p2p status
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
setP2PPort()
Set p2p port
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
setPCAudioAlarmCfg(isEnablePCAudioAlarm) → {Promise.<object>}
Set audio alarm config for PC(web live video.
Parameters:
Name | Type | Description |
---|---|---|
isEnablePCAudioAlarm |
boolean
|
Enable state |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setPortInfo()
Set ports of camera
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
setPowerFrequency(frequency) → {Promise.<object>}
Set power freq of sensor.
Parameters:
Name | Type | Description |
---|---|---|
frequency |
int
|
1 or 0. 0 for '60HZ'. 1 for '50HZ'. 2 for 'outdoor mode' |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setPPPoEConfig()
Set PPPoE config
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
setPTZPrePointForSelfTest()
Set informations of 485
setPTZSelfTestMode()
Set the selftest mode of PTZ
setPTZSpeed(speed) → {Promise.<object>}
Set the speed of PT.
Parameters:
Name | Type | Description |
---|---|---|
speed |
int
|
0: Very slow 1: Slow 2: Normal speed 3: Fast 4: Very fast |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setRatio(ratio) → {Promise.<object>}
Set value for image distortion correction
Parameters:
Name | Type | Description |
---|---|---|
ratio |
int
|
0-511. Three ranks:
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setSaturation(saturation) → {Promise.<object>}
Set saturation of video
Parameters:
Name | Type | Description |
---|---|---|
saturation |
int
|
New level of saturation. Between 1-100. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setScheduleInfraLedConfig()
Set config for infra led switch schedule
setScheduleRecordConfig() → {Promise.<object>}
Set schedule recordconfig.
Parameters:
Name | Type | Description |
---|---|---|
scheduleRecordConfig. |
Foscam.scheduleRecordConfig
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setScheduleRecordStreamChannel(channel) → {Promise.<object>}
Set stream channel for schedule record.
Parameters:
Name | Type | Description |
---|---|---|
channel |
int
|
1 or 0. 0 for 'Main Stream'. 1 for 'Sub Stream'. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setScheduleSnapConfig() → {Promise.<Object>}
Set schedule snap config
Parameters:
Name | Type | Description |
---|---|---|
config. |
Foscam.scheduleSnapConfig
|
Returns:
- Type:
-
Promise.<Object>
A promise to the response.
setSharpness(sharpness) → {Promise.<object>}
Set sharpness of video.
Parameters:
Name | Type | Description |
---|---|---|
sharpness |
int
|
New level of sharpness. Between 1-100. |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setSMTPConfig()
Set mail config
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
setSnapConfig(config) → {Promise.<object>}
Set snap config.
Parameters:
Name | Type | Description |
---|---|---|
config |
Foscam.snapConfig
|
Config for snap |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setSubStreamFormat(format) → {Promise.<object>}
Set the stream format of sub stream. Our device can only support 2 streams:Main stream for PC access and Sub stream for mobile access, but someone need a MJ stream to embed their camera into a webpage, in this case, we should set sub stream format to Motion Jpeg, and then you can get MJ stream by command: /cgi-bin/CGIStream.cgi?cmd=GetMJStream, but when you login as a sub stream user, the stream data will be same as main stream.
Parameters:
Name | Type | Description |
---|---|---|
format |
int
|
0: H264. 1: MotionJpeg |
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setSubVideoStreamParam(params) → {Promise.<object>}
Set the sub video stream param of stream N
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setSystemTime()
Set system time
setUPnPConfig()
Set UpnP config
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
setVideoStreamParam(params) → {Promise.<object>}
Set the video stream param of stream N
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
|
Returns:
- Type:
-
Promise.<object>
A promise to the response.
setWifiSetting()
Set wifi config
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
setZoomSpeed()
Set the speed of PTZ
smtpTest()
Test mail setting
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
snapPicture() → {Promise.<Object>}
Manual snap picture. Picture resolution is the same as main stream resolutionnapPicture.
Returns:
- Type:
-
Promise.<Object>
A promise to the response. We will return a html script directly.
snapPicture2() → {Promise.<Object>}
Manual snap picture. This command will return jpeg image data directly.
Returns:
- Type:
-
Promise.<Object>
A promise to the response. jpeg image data directly.
testFtpServer()
Test FTP server
- Source:
- To Do:
-
- Write the documentation.
- Implement this function.
toolResetToFactory()
Set camera reset to factory by software
usrBeatHeart()
user checks connection with camera
zoomIn() → {Promise.<object>}
Zoom in.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
zoomOut() → {Promise.<object>}
Zoom out.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
zoomStop() → {Promise.<object>}
Stop zoom run.
Returns:
- Type:
-
Promise.<object>
A promise to the response.
Type Definitions
alarmRecordConfig
Properties:
Name | Type | Description |
---|---|---|
isEnablePreRecord |
boolean
|
Preview record state |
preRecordSecs |
int
|
Preview record time |
alarmRecordSecs |
int
|
Alarm record time |
getImageSettingResponse
Properties:
Name | Type | Description |
---|---|---|
brightness |
int
|
0-100. |
contrast |
int
|
0-100. |
hue |
int
|
0-100. |
saturation |
int
|
0-100. |
sharpness |
int
|
0-100. |
denoiseLevel |
int
|
Not in use. |
getMirrorAndFlipSettingResponse
Properties:
Name | Type | Description |
---|---|---|
isMirror |
boolean
|
If the image or mirrored or not. |
isFlip |
boolean
|
If the image is flipped or not. |
getOSDMaskArea
Properties:
Name | Type | Description |
---|---|---|
x1_N |
int
|
The top left X position of mask N |
y1_N |
int
|
The top left Y position of mask N |
x2_N |
int
|
The bottom right X position of mask N |
y2_N |
int
|
The bottom right Y position of mask N |
getOSDSetting
Properties:
Name | Type | Description |
---|---|---|
isEnableTimeStamp |
boolean
|
Time stamp will display on screen or not. |
isEnableDevName |
boolean
|
Camera name will display on screen or not |
dispPos |
int
|
OSD display position, currently can only be 0 |
isEnableOSDMask |
boolean
|
Is OSD mask effective. |
localAlarmRecordConfig
Properties:
Name | Type | Description |
---|---|---|
isEnableLocalAlarmRecord |
boolean
|
false: Disable. true: Enable. |
localAlarmRecordSecs |
int
|
Recording time. |
motionDetectConfig
- Video region is divided into 10*10 sub areas.
- The min unit of schedule is half an hour, scheduleN value range 2^n - 1(N[0-48])
- areaN value 2^n - 1(N[0-10])
Properties:
Name | Type | Description |
---|---|---|
isEnable |
boolean
|
Is enable motion detect alarm |
linkage |
Motion alarm linkage (bit3 | bit2 | bit1 | bit0 )
|
|
snapInterval |
int
|
The interval time to snap picture again |
Motion |
int
|
sensitivity detect.
|
triggerInterval |
int
|
The time of which motion detect alarm can trigger again when a motion detection has happened. |
scheduleN |
int
|
The motion alaram schedule of one week,
|
areaN |
int
|
The area info of row N |
scheduleRecordConfig
The min unit of schedule is half an hour, scheduleN value range 2^n -1(N[0-48])
Properties:
Name | Type | Description |
---|---|---|
isEnable |
boolean
|
Schedule-Record enable status, 0-disable,1-enable. |
recordLevel |
int
|
Level for drop frame.
|
spaceFullMode |
int
|
The process method when SD card is full,0-cover the oldest video and continue record,1-stop record |
isEnableAudio |
boolean
|
Is recording include audio? |
scheduleN |
int
|
The motion alarm schedule of one week,N = 0(Monday) ~6(Sunday) |
scheduleSnapConfig
Properties:
Name | Type | Description |
---|---|---|
isEnable |
boolean
|
Is enable motion detect alarm. |
snapInterval |
int
|
The interval time to snap picture again. |
scheduleN |
int
|
The motion alaram schedule of one week.
|
snapConfig
Properties:
Name | Type | Description |
---|---|---|
snapPicQuality |
int
|
0: Low Quality. 1: Normal Quality. 2: High quality. |
saveLocation |
int
|
0: Save to sd card. 1: Not in use now. 2: Upload to FTP. |
videoStreamParamResponse
N means streamType [0~3]
Properties:
Name | Type | Description |
---|---|---|
resolutionN |
int
|
Resolution of stream type N. |
bitRateN |
int
|
Bit rate of stream type N (20480~2097152) |
frameRateN |
int
|
Frame rate of stream type N |
GOPN |
int
|
P frames between I frame of stream type N |
isVBRN |
boolean
|
Change bit rate of stream true-yes false-nosetSubVideoStreamParam |