Package org.thingml.bglib

Examples of org.thingml.bglib.BGAPI


    public static void main( String[] args )
    {
        System.out.println( "Connecting BLED112 Dongle..." );
        BGAPITransport bgapi = BLED112.connectBLED112();
        bgapi.addListener(new BGAPIPacketLogger());
        BGAPI impl = new BGAPI(bgapi);
        impl.addListener(new SimpleDiscovery());
       
        try {
            Thread.sleep(500);
        } catch (InterruptedException ex) {
            Logger.getLogger(SimpleDiscovery.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println( "Requesting Version Number..." );
        impl.send_system_get_info();
        impl.send_system_hello();
        impl.send_gap_set_scan_parameters(10, 250, 1);
        impl.send_gap_discover(1);
       
    }
View Full Code Here


        jButtonBLED112Disc.setEnabled(false);
        port  = BLED112.connectSerial(BLED112.selectSerialPort());
        if (port != null) {
            try {
                jTextFieldBLED112.setText("Connected on " + port);
                bgapi = new BGAPI(new BGAPITransport(port.getInputStream(), port.getOutputStream()));
                bgapi.addListener(this);
                Thread.sleep(250);
                bgapi.send_system_get_info();
                jButtonBLED112Disc.setEnabled(true);
                if (jCheckBoxDebug.isSelected()) bgapi.getLowLevelDriver().addListener(logger);
View Full Code Here

TOP

Related Classes of org.thingml.bglib.BGAPI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.