Skip to content

A black berry webwork extension to provide serial communication support for Bluetooth connections

Notifications You must be signed in to change notification settings

lewisou/webwork-bluetooth-ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A black berry webwork extension to provide serial communication support for Bluetooth connections

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages