-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
49 lines (40 loc) · 1.07 KB
/
index.js
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
40
41
42
43
44
45
46
47
48
49
'use strict';
var logger = require('log4js').getLogger('Sensor');
function initDrivers() {
var meltemCVSSensor;
var meltemCVSActuator;
try {
meltemCVSSensor = require('./driver/meltemCVSSensor');
} catch(e) {
logger.error('Cannot load ./driver/meltemCVSSensor', e);
}
try {
meltemCVSActuator = require('./driver/meltemCVSActuator');
} catch(e) {
logger.error('Cannot load ./driver/meltemCVSActuator', e);
}
return {
meltemCVSSensor: meltemCVSSensor,
meltemCVSActuator: meltemCVSActuator
};
}
function initNetworks() {
var network;
try {
network = require('./network/meltem-tcp');
} catch (e) {
logger.error('Cannot load ./network/meltem-tcp', e);
}
return {
'meltem': network
};
}
module.exports = {
networks: ['meltem-cvs-tcp'],
drivers: {
meltemCVSSensor: ['meltemCVSMode', 'meltemCVSRPM', 'meltemCVSCurrent', 'meltemCVSPressure', 'meltemCVSPower', 'meltemCVSTemperature', 'meltemCVSOperatingTime'],
meltemCVSActuator: ['meltemCVSSettings']
},
initNetworks: initNetworks,
initDrivers: initDrivers
};