File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ var util = require ( 'util' ) ;
4+
5+
6+ function Camera ( syno ) {
7+ this . syno = syno ;
8+ return this ;
9+ }
10+
11+ Camera . prototype . getSnapshot = function ( ) {
12+ /*jshint validthis:true */
13+ var
14+ userParams =
15+ typeof arguments [ 0 ] === 'object' ? arguments [ 0 ] :
16+ { } ,
17+ callback =
18+ typeof arguments [ 1 ] === 'function' ? arguments [ 1 ] :
19+ typeof arguments [ 0 ] === 'function' ? arguments [ 0 ] :
20+ null
21+ ;
22+ var params = {
23+ api : 'SYNO.SurveillanceStation.Camera' ,
24+ version : 9 ,
25+ method : 'GetSnapshot'
26+ } ;
27+ util . _extend ( params , userParams ) ;
28+
29+ var query = this . syno . query ( {
30+ path : '/webapi/entry.cgi' ,
31+ params : params ,
32+ headers : {
33+ 'Accept' : 'image/jpeg' ,
34+ }
35+ } , callback || null ) ;
36+
37+ return query ;
38+ }
39+
140module . exports = function ( syno ) {
241 return {
42+ camera : new Camera ( syno ) ,
343 } ;
444} ;
You can’t perform that action at this time.
0 commit comments