-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
34 lines (25 loc) · 917 Bytes
/
Gruntfile.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
iot = require("bindings")("iotivity_wrapper_native");
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});
grunt.registerTask('version', 'IoTivity version', function() {
grunt.log.write('Running iotivity_nodejs version: ' + iot.version() ).ok();
});
grunt.registerTask('stop', 'IoTivity stop', function() {
grunt.log.write('Running iotivity_nodejs stop: ' + iot.stop() ).ok();
});
grunt.registerTask('test', 'IoTivity stssop', function() {
grunt.log.write('Running iotivity_nodejs test: ' + iot.tstCast() ).ok();
});
grunt.registerTask('start', 'IoTivity start', function() {
function handleRequest(req) {
console.log("Got a request for: " + req.resource);
req.respond();
}
console.log("Booting iotivity");
iot.start(handleRequest);
//don't exit
setInterval(function() { }, 3000 );
});
}