Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.25 KB

README.md

File metadata and controls

52 lines (38 loc) · 1.25 KB

How to add the feature

Put /lib/bluetooth_ext.jar under the ext folder of your webwork project.

Add this line into your config.xml

<feature id="vxmt.bluetooth.basic" required="true" version="1.0.0" />

Then everything just works.

How to use

List all paired bluetooth devices

<script>
    var handle = vxmt.bluetooth.basic;

    //Store your array here:
    alert(handle.service_list);
</script>

Connect to bluetooth device

<script>
    function call_back(mess) {
        //You can do anything else here:
        alert(mess);
    }

    var handle = vxmt.bluetooth.basic;
    handle.connect('BLUETOOTH_SERIVICE_NAME', 'call_back');

    bluetooth.connect('uniq_key', 'BLUETOOTH_SERIVICE_NAME', 'call_back');
    // for example bluetooth.connect('abc', 'DEVICE_BLABLA', 'bluetooth_mess_arrived');
</script>

Write bytes to bluetooth device

<script>
    // for example, 'abc' is the key you used to connect previously
    var bluetooth = vxmt.bluetooth.basic;
    bluetooth.write_back('abc', 'message string');
</script>

License

The software is released under the MIT license: www.opensource.org/licenses/MIT