Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
1 changed files with 18 additions and 1 deletions
Showing only changes of commit 2a28b622f0 - Show all commits

View File

@ -48,6 +48,7 @@ function createBLE () {
ble.on('frame', bFrame) ble.on('frame', bFrame)
ble.on('dir', bDir) ble.on('dir', bDir)
ble.on('exposure', bExposure) ble.on('exposure', bExposure)
ble.on('delay', bDelay)
} }
//Restify functions //Restify functions
@ -312,7 +313,7 @@ function bFrame (obj, cb) {
/*intval.frame(dir, exposure, (len) => { /*intval.frame(dir, exposure, (len) => {
return cb() return cb()
})*/ })*/
setTimeout(cb, 630) setTimeout(cb, exposure === 0 ? 630 : exposure)
} }
function bDir (obj, cb) { function bDir (obj, cb) {
@ -344,6 +345,22 @@ function bExposure (obj, cb) {
return cb() return cb()
} }
function bDelay (obj, cb) {
let delay = 0
let set = false
if (typeof obj.delay !== 'undefined') {
if (typeof obj.delay === 'string') {
delay = parseInt(obj.delay)
} else {
delay = obj.delay
}
set = true
}
intval.setDelay(delay)
log.info('delay', { method: 'ble', delay : delay })
return cb()
}
function index (req, res, next) { function index (req, res, next) {
fs.readFile(INDEXPATH, 'utf8', (err, data) => { fs.readFile(INDEXPATH, 'utf8', (err, data) => {
if (err) { if (err) {