Take a look at https://mongoose-os.com/ble/#/
This is a Web (JavaScript) client, which works on Google Chrome browser only (it has BLE support).
The core logic in contained in this file: https://mongoose-os.com/ble/js/rpc_over_ble.js , which implements a blerpc
function:
var blerpc = async function(dev, method, params) {
...
};
And this is how that function is called by the https://mongoose-os.com/ble/js/main.js:
var params = {
config: {
wifi: {
ap: {enable: false},
sta: {
enable: true,
ssid: 'SSID',
pass: 'PASSWORD',
}
}
}
};
blerpc(app.state.device, 'Config.Set', params)
.then(function(f) {
blerpc(app.state.device, 'Config.Save', {reboot: true})
})
.then(function() {
alert('done.');
})
.catch(function(err) {
alert(err);
});