You could check out this function: https://github.com/espruino/Espruino/blob/master/libs/bluetooth/jswrap_bluetooth.c#L708
I'll try and release 1v93 soon, which should have it in (or you can use the travis builds at http://www.espruino.com/binaries/travis/master).
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
You could check out this function: https://github.com/espruino/Espruino/blob/master/libs/bluetooth/jswrap_bluetooth.c#L708
I'll try and release 1v93 soon, which should have it in (or you can use the travis builds at http://www.espruino.com/binaries/travis/master).