Push dev work to master #2

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

View File

@ -71,6 +71,8 @@ function onWifiWrite (data, offset, withoutResponse, callback) {
result = bleno.Characteristic.RESULT_UNLIKELY_ERROR
return callback(result)
}
console.log(hash)
console.log(plaintext)
return wifi.setNetwork(ssid, plaintext, hash, (err, data) => {
if (err) {
log.error('Error configuring wifi', err)
@ -89,7 +91,6 @@ function onWifiRead (offset, callback) {
const result = bleno.Characteristic.RESULT_SUCCESS
const wifiRes = {}
let data
log.info('Getting wifi data for onWifiRead')
wifi.list((err, list) => {
if (err) {
result = bleno.Characteristic.RESULT_UNLIKELY_ERROR

View File

@ -61,11 +61,15 @@ class Wifi {
console.error(err)
return _cb(err)
}
console.dir(data)
console.log(data.search(networkPattern))
console.log(_entry)
if (data.search(networkPattern) === -1) {
data += `\n${_entry}`
} else {
data = data.replace(networkPattern, _entry)
}
console.dir(data)
_entry = null
//fs.writeFile(filePath, data, 'utf8', this._writeConfigCb)
}
@ -112,6 +116,9 @@ class Wifi {
console.log('Wifi refreshed')
//this._callback(null, { ssid : ssid, pwd : pwd.length })
_cb = () => {}
}
_parseConfig () {
}
/**
* Create sanitized wpa_supplicant.conf stanza for