(int baud)
| 167 | } |
| 168 | |
| 169 | public synchronized AndroidPort open(int baud) throws IOException { |
| 170 | if (port != null) |
| 171 | throw new IOException("Port already occupied"); |
| 172 | |
| 173 | port = new UsbSerialPort(this, baud); |
| 174 | if (usbmanager.hasPermission(device)) { |
| 175 | port.open(usbmanager, device, iface); |
| 176 | } else { |
| 177 | requestPermission(device); |
| 178 | } |
| 179 | |
| 180 | return port; |
| 181 | } |
| 182 | |
| 183 | public synchronized void permissionGranted() { |
| 184 | if (!port.isOpen()) |
no test coverage detected