public synchronized Boolean start ( ) { if ( started ) { return true ; } createSerialPort ( ) ; serialPort . addEventListener ( this ) ; if ( ! serialPort . connect ( ) ) { log . error ( "Failed to start Firmata Library. Cannot connect to Serial Port." ) ; log . error ( "Configuration is {}" , configuration ) ; stop ( ) ; return false ; } if ( configuration . getTestProtocolCommunication ( ) ) { if ( ! testProtocolCommunication ( ) ) { stop ( ) ; return false ; } } started = true ; return true ; }
Starts the firmata library . If the library is already started this will just return true . Starts the SerialPort and handlers and ensures the attached device is able to communicate with our library . This will return an UnsupportedDevice exception if the attached device does not meet the library requirements .