Comment out all ble methods, to be replaced with new Bluetooth API calls

This commit is contained in:
mmcwilliams 2019-03-17 11:56:03 -04:00
parent 3bf4bebbd5
commit 6557b48acc
1 changed files with 25 additions and 25 deletions

View File

@ -120,7 +120,7 @@ mobile.wble.disconnect = function () {
} }
device = mobile.wble.device; device = mobile.wble.device;
console.log(`BLE - Disconnecting from ${device.id}`); console.log(`BLE - Disconnecting from ${device.id}`);
ble.disconnect(device.id, mobile.wble.onDisconnect, mobile.wble.onDisconnect); //ble.disconnect(device.id, mobile.wble.onDisconnect, mobile.wble.onDisconnect);
elem.innerHTML = ''; elem.innerHTML = '';
option.text = 'N/A'; option.text = 'N/A';
@ -186,11 +186,11 @@ mobile.getState = function () {
if (!mobile.wble.connected) { if (!mobile.wble.connected) {
//returning here will prevent error alert //returning here will prevent error alert
} }
ble.read(mobile.wble.device.id, /*ble.read(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.CHAR_ID, mobile.wble.CHAR_ID,
mobile.stateSuccess, mobile.stateSuccess,
mobile.wble.onError); mobile.wble.onError);*/
}; };
mobile.stateSuccess = function (data) { mobile.stateSuccess = function (data) {
let str = bytesToString(data); let str = bytesToString(data);
@ -208,12 +208,12 @@ mobile.frame = function () {
if (mobile.wble.active) { if (mobile.wble.active) {
return false; return false;
} }
ble.write(mobile.wble.device.id, /*ble.write(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.CHAR_ID, mobile.wble.CHAR_ID,
stringToBytes(JSON.stringify(opts)), //check length? stringToBytes(JSON.stringify(opts)), //check length?
mobile.frameSuccess, mobile.frameSuccess,
mobile.wble.onError); mobile.wble.onError);*/
document.getElementById('frame').classList.add('focus'); document.getElementById('frame').classList.add('focus');
mobile.wble.active = true; mobile.wble.active = true;
}; };
@ -240,12 +240,12 @@ mobile.setDir = function () {
dir : !document.getElementById('dir').checked dir : !document.getElementById('dir').checked
}; };
ble.write(mobile.wble.device.id, /*ble.write(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.CHAR_ID, mobile.wble.CHAR_ID,
stringToBytes(JSON.stringify(opts)), //check length? stringToBytes(JSON.stringify(opts)), //check length?
mobile.dirSuccess, mobile.dirSuccess,
mobile.wble.onError); mobile.wble.onError);*/
}; };
mobile.dirSuccess = function () { mobile.dirSuccess = function () {
console.log('Set direction'); console.log('Set direction');
@ -265,12 +265,12 @@ mobile.setExposure = function () {
} }
scaledExposure = scaleTime(exposure, STATE.scale); scaledExposure = scaleTime(exposure, STATE.scale);
opts.exposure = scaledExposure; opts.exposure = scaledExposure;
ble.write(mobile.wble.device.id, /*ble.write(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.CHAR_ID, mobile.wble.CHAR_ID,
stringToBytes(JSON.stringify(opts)), //check length? stringToBytes(JSON.stringify(opts)), //check length?
mobile.exposureSuccess, mobile.exposureSuccess,
mobile.wble.onError); mobile.wble.onError);*/
}; };
mobile.exposureSuccess = function () { mobile.exposureSuccess = function () {
console.log('Set exposure'); console.log('Set exposure');
@ -284,12 +284,12 @@ mobile.setDelay = function () {
type : 'delay', type : 'delay',
delay : scaledDelay delay : scaledDelay
}; };
ble.write(mobile.wble.device.id, /*ble.write(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.CHAR_ID, mobile.wble.CHAR_ID,
stringToBytes(JSON.stringify(opts)), //check length? stringToBytes(JSON.stringify(opts)), //check length?
mobile.delaySuccess, mobile.delaySuccess,
mobile.wble.onError); mobile.wble.onError);*/
} }
mobile.delaySuccess = function () { mobile.delaySuccess = function () {
@ -308,12 +308,12 @@ mobile.setCounter = function () {
if (results.buttonIndex === 1) { if (results.buttonIndex === 1) {
if (change === null || !isNumeric(change)) return false; if (change === null || !isNumeric(change)) return false;
opts.counter = change; opts.counter = change;
ble.write(mobile.wble.device.id, /*ble.write(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.CHAR_ID, mobile.wble.CHAR_ID,
stringToBytes(JSON.stringify(opts)), //check length? stringToBytes(JSON.stringify(opts)), //check length?
mobile.counterSuccess, mobile.counterSuccess,
mobile.wble.onError); mobile.wble.onError);*/
} }
} }
navigator.notification.prompt( navigator.notification.prompt(
@ -337,12 +337,12 @@ mobile.sequence = function () {
if (!mobile.wble.connected) { if (!mobile.wble.connected) {
return mobile.alert('Not connected to an INTVAL3 device.'); return mobile.alert('Not connected to an INTVAL3 device.');
} }
ble.write(mobile.wble.device.id, /*ble.write(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.CHAR_ID, mobile.wble.CHAR_ID,
stringToBytes(JSON.stringify(opts)), //check length? stringToBytes(JSON.stringify(opts)), //check length?
mobile.sequenceSuccess, mobile.sequenceSuccess,
mobile.wble.onError); mobile.wble.onError);*/
if (!elem.classList.contains('focus')) { if (!elem.classList.contains('focus')) {
elem.classList.add('focus'); elem.classList.add('focus');
@ -372,11 +372,11 @@ mobile.getWifi = function () {
UI.spinner.show('Refreshing WIFI...'); UI.spinner.show('Refreshing WIFI...');
UI.overlay.show(); UI.overlay.show();
ble.read(mobile.wble.device.id, /*ble.read(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.WIFI_ID, mobile.wble.WIFI_ID,
mobile.getWifiSuccess, mobile.getWifiSuccess,
mobile.wble.onError); mobile.wble.onError);*/
}; };
mobile.getWifiSuccess = function (data) { mobile.getWifiSuccess = function (data) {
@ -476,12 +476,12 @@ mobile.setWifi = function () {
if (pwd.length < 8 || pwd.length > 63) { if (pwd.length < 8 || pwd.length > 63) {
return mobile.alert('Passphrase must be 8..63 characters'); return mobile.alert('Passphrase must be 8..63 characters');
} }
ble.write(mobile.wble.device.id, /*ble.write(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.WIFI_ID, mobile.wble.WIFI_ID,
stringToBytes(JSON.stringify(opts)), stringToBytes(JSON.stringify(opts)),
mobile.setWifiSuccess, mobile.setWifiSuccess,
mobile.wble.onError); mobile.wble.onError);*/
}; };
mobile.setWifiSuccess = function () { mobile.setWifiSuccess = function () {
@ -671,12 +671,12 @@ mobile.reset = function () {
}; };
function resetConfirm (index) { function resetConfirm (index) {
if (index === 1) { if (index === 1) {
ble.write(mobile.wble.device.id, /*ble.write(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.CHAR_ID, mobile.wble.CHAR_ID,
stringToBytes(JSON.stringify(opts)), stringToBytes(JSON.stringify(opts)),
mobile.resetSuccess, mobile.resetSuccess,
mobile.wble.onError); mobile.wble.onError);*/
} }
} }
navigator.notification.confirm( navigator.notification.confirm(
@ -702,12 +702,12 @@ mobile.update = function () {
if (index === 1) { if (index === 1) {
UI.spinner.show('Updating INTVAL3...'); UI.spinner.show('Updating INTVAL3...');
UI.overlay.show(); UI.overlay.show();
ble.write(mobile.wble.device.id, /*ble.write(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.CHAR_ID, mobile.wble.CHAR_ID,
stringToBytes(JSON.stringify(opts)), stringToBytes(JSON.stringify(opts)),
mobile.updateSuccess, mobile.updateSuccess,
mobile.wble.onError); mobile.wble.onError);*/
} }
} }
navigator.notification.confirm( navigator.notification.confirm(
@ -730,12 +730,12 @@ mobile.restart = function () {
if (index === 1) { if (index === 1) {
UI.spinner.show('Restarting INTVAL3...'); UI.spinner.show('Restarting INTVAL3...');
UI.overlay.show(); UI.overlay.show();
ble.write(mobile.wble.device.id, /*ble.write(mobile.wble.device.id,
mobile.wble.SERVICE_ID, mobile.wble.SERVICE_ID,
mobile.wble.CHAR_ID, mobile.wble.CHAR_ID,
stringToBytes(JSON.stringify(opts)), stringToBytes(JSON.stringify(opts)),
mobile.restartSuccess, mobile.restartSuccess,
mobile.wble.onError); mobile.wble.onError);*/
} }
} }
navigator.notification.confirm( navigator.notification.confirm(