Closed nherriot closed 6 years ago
Fixed in a number of commits for the BLE embedded device and the Sapper/Svelte application:
This fixes: 1) SSID's that have spaces between them. 2) Properly stores local values for the BLE manager as simple coma delimited strings. 3) Ensures the PWA delimiter is ','. 4) Converts between JS SET and strings properly.
During testing of the embedded Bluetooth WiFi manager - an error happens when calling up the NetworkCharaceristic.onreadRequest method.
To reproduce run on a Raspberry pi zero with the latest raspbian image.
The will generate an error like:
WiFi -> stateChange: COMPLETED WARNING! NetworkCharacteristic state is: srt2 srguest srg2 srtest srsec srbackup RandomPhone SWIFT_1 daliwifi srtest-g AGAH Guest WiFi BTWifi-X BTWi-fi Redmi but the wifi manager has it as: [object Set] updating BLE values buffer.js:202 throw new TypeError(kFromErrorMsg); ^
TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object. at Function.Buffer.from (buffer.js:202:9) at new Buffer (buffer.js:158:17) at NetworkCharacteristic.onReadRequest (/home/pi/samsung/SamsungBluetoothWiFiManager/bleno/bluetooth-wifi-manager/wifi-networks-characteristic.js:47:14) at emitTwo (events.js:126:13) at NetworkCharacteristic.emit (events.js:214:7) at Gatt.handleReadOrReadBlobRequest (/home/pi/samsung/SamsungBluetoothWiFiManager/bleno/node_modules/bleno/lib/hci-socket/gatt.js:787:29) at Gatt.handleRequest (/home/pi/samsung/SamsungBluetoothWiFiManager/bleno/node_modules/bleno/lib/hci-socket/gatt.js:335:23) at Gatt.onAclStreamData (/home/pi/samsung/SamsungBluetoothWiFiManager/bleno/node_modules/bleno/lib/hci-socket/gatt.js:274:8) at emitTwo (events.js:131:20) at AclStream.emit (events.js:214:7)