Skip to content

Commit 3259856

Browse files
committed
fix: fix various syntax issues
1 parent 9baf051 commit 3259856

6 files changed

Lines changed: 413 additions & 121 deletions

File tree

index.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,37 @@
22
var events = require('events');
33

44
// Local modules
5-
var client = require('./lib/bacnet-client');
5+
var client = require('./lib/bacnet-client');
6+
var enumerations = require('./lib/bacnet-enum');
67

78
module.exports = function() {
89
var self = new events.EventEmitter();
910

11+
// Public enums
12+
self.enum = enumerations;
13+
1014
// Public functions
1115
self.whoIs = function(lowLimit, highLimit, receiver) {
1216
client.whoIs(lowLimit, highLimit, null, function(address, deviceId, maxAdpu, segmentation, vendorId) {
1317
self.emit('iAm', address, deviceId, maxAdpu, segmentation, vendorId);
1418
});
1519
};
1620

17-
self.readProperty = function(address, objectType, objectInstance, propertyId, arrayIndex, cb) {
18-
client.readProperty(address, objectType, objectInstance, propertyId, arrayIndex, cb);
21+
self.readProperty = function(address, objectType, objectInstance, propertyId, arrayIndex, next) {
22+
client.readProperty(address, objectType, objectInstance, propertyId, arrayIndex, next);
1923
};
2024

21-
self.writeProperty = function() {
22-
25+
self.writeProperty = function(address, objectType, objectInstance, propertyId, priority, valueList) {
26+
client.writeProperty(address, objectType, objectInstance, propertyId, priority, valueList);
2327
};
2428

25-
self.readPropertyMultiple = function(address, objectType, objectInstance, propertyIdAndArrayIndex, cb) {
26-
client.readPropertyMultiple(address, objectType, objectInstance, propertyIdAndArrayIndex, cb);
29+
self.readPropertyMultiple = function(address, objectType, objectInstance, propertyIdAndArrayIndex, next) {
30+
client.readPropertyMultiple(address, objectType, objectInstance, propertyIdAndArrayIndex, next);
2731
};
2832

2933
self.writePropertyMultiple = function() {
3034

3135
};
3236

33-
// Initialisation
34-
3537
return self;
3638
};

lib/bacnet-adpu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var baEnum = require('./bacnet-enum');
22

3-
module.exports.getDecodedType = function(buffer, offset) {
3+
var getDecodedType = module.exports.getDecodedType = function(buffer, offset) {
44
return buffer[offset];
55
};
66

0 commit comments

Comments
 (0)