forked from agsh/onvif
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalytics.js
More file actions
39 lines (34 loc) · 1.12 KB
/
Copy pathanalytics.js
File metadata and controls
39 lines (34 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @namespace cam
* @description Analytics section for Cam class
* @author Arteco Global S.p.A. <developers@arteco-global.com>
* @licence MIT
*/
module.exports = function(Cam) {
const linerase = require('./utils').linerase;
/**
* Get the whole set of analytics rules supported by the device
* @param {string} options.configurationToken Contains a reference to the AnalyticsConfiguration to use.
* @param {Cam~GetSupportedRules} [callback]
*/
Cam.prototype.getSupportedRules = function(options, callback) {
this._request({
service: 'analytics'
, body: this._envelopeHeader() +
'<GetSupportedRules xmlns="http://www.onvif.org/ver20/analytics/wsdl">' +
'<ConfigurationToken>' + options.configurationToken + '</ConfigurationToken>' +
'</GetSupportedRules>' +
this._envelopeFooter()
}, function(err, data, xml) {
if (!err) {
/**
* Rules supported by the device
*/
this.rules = linerase(data).getSupportedRulesResponse.supportedRules.ruleDescription; // Array of RuleDescription
}
if (callback) {
callback.call(this, err, this.rules, xml);
}
}.bind(this));
};
};