Push dev work to master #2
|
@ -279,16 +279,19 @@ mobile.sequence = function () {
|
|||
const opts = {
|
||||
type : 'sequence'
|
||||
};
|
||||
const elem = document.getElementById('seq');
|
||||
if (!mobile.ble.connected) {
|
||||
return alert('Not connected to an INTVAL device.');
|
||||
return alert('Not connected to an INTVAL3 device.');
|
||||
}
|
||||
ble.write(mobile.ble.device.id,
|
||||
mobile.ble.SERVICE_ID,
|
||||
mobile.ble.CHAR_ID,
|
||||
stringToBytes(JSON.stringify(opts)), //check length?
|
||||
mobile.frameSuccess,
|
||||
mobile.sequenceSuccess,
|
||||
mobile.ble.onError);
|
||||
document.getElementById('seq').classList.add('focus');
|
||||
if (!elem.classList.contains('focus')) {
|
||||
elem.classList.add('focus');
|
||||
}
|
||||
mobile.ble.active = true;
|
||||
};
|
||||
|
||||
|
@ -306,6 +309,7 @@ mobile.sequenceSuccess = function () {
|
|||
}, 20);
|
||||
};
|
||||
|
||||
|
||||
//retreive object with list of available Wifi APs,
|
||||
//and state of current connection, if available
|
||||
mobile.getWifi = function () {
|
||||
|
|
2
index.js
2
index.js
|
@ -37,6 +37,7 @@ function createServer () {
|
|||
app.post('/frame', rFrame)
|
||||
app.get( '/sequence', rSequence)
|
||||
app.post('/sequence', rSequence)
|
||||
|
||||
app.post('/reset', rReset)
|
||||
app.get( '/status', rStatus)
|
||||
app.listen(PORT, () => {
|
||||
|
@ -54,7 +55,6 @@ function createBLE () {
|
|||
ble.on('delay', bDelay)
|
||||
ble.on('counter', bCounter)
|
||||
ble.on('sequence', bSequence)
|
||||
ble.on('stop', bSequenceStop)
|
||||
ble.on('reset', bReset)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue