Package org.jnode.driver

Examples of org.jnode.driver.Device


    }

    @Override
    protected void stopDevice() throws DriverException {
        final Device dev = getDevice();

        // Unregister the SCSI device that we host
        dev.getManager().unregister(scsiDevice);
        dev.unregisterAPI(SCSIHostControllerAPI.class);
    }
View Full Code Here


    public static void main(String[] args) {

        final String devId = (args.length > 0) ? args[0] : "fb0";
        try {
            final Device dev = DeviceUtils.getDevice(devId);

            System.out.println("Reading DDC1 data, please wait");
            final DisplayDataChannelAPI api = dev.getAPI(DisplayDataChannelAPI.class);
            final DDC1Reader reader = new DDC1Reader(api);
            final EDID data = reader.read();

            System.out.println("DDC1-EDID=" + data);
            System.out.println("DDC1-EDID (raw)=" + NumberUtils.hex(data.getRawData()));
View Full Code Here

    /**
     * @see org.jnode.driver.Driver#startDevice()
     */
    protected void startDevice() throws DriverException {
        final Device device = getDevice();
        try {
            final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
            if (renameToDevicePrefixOnly()) {
                dm.rename(device, getDevicePrefix(), true);
            } else {
                final String prefix = getDevicePrefix() + '-';
                if (!device.getId().startsWith(prefix)) {
                    dm.rename(device, getDevicePrefix() + '-' + device.getId(), false);
                }
            }
        } catch (DeviceAlreadyRegisteredException ex) {
            log.error("Cannot rename device", ex);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find DeviceManager", ex);
        }
        device.registerAPI(DeviceInfoAPI.class, this);
        device.registerAPI(NetDeviceAPI.class, this);
        txThread = new QueueProcessorThread<Object[]>(device.getId() + "-tx", txQueue, this);
        txThread.start();
    }
View Full Code Here

        final ARPNetworkLayer arp =
                (ARPNetworkLayer) NetUtils.getNLM().getNetworkLayer(EthernetConstants.ETH_P_ARP);
        final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
        final IPv4Address addr = new IPv4Address(args[0]);
        final IPv4Address myAddr = new IPv4Address(args[1]);
        final Device dev = dm.getDevice(args[2]);
        final long timeout = 5000;

        final HardwareAddress hwAddr;
        hwAddr = arp.getHardwareAddress(addr, myAddr, dev, timeout);
View Full Code Here

    /**
     * @see org.jnode.driver.Driver#startDevice()
     */
    protected final void startDevice() throws DriverException {
        final Device device = getDevice();
        final DeviceManager dm;
        try {
            dm = InitialNaming.lookup(DeviceManager.NAME);
            dm.rename(device, getDevicePrefix(), true);
        } catch (DeviceAlreadyRegisteredException ex) {
            log.error("Cannot rename device", ex);
            throw new DriverException("Cannot rename device", ex);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find DeviceManager", ex);
        }
        claimResources();
        device.registerAPI(USBHostControllerAPI.class, getAPIImplementation());
        // Create & start a monitor
        final USBHubAPI hubApi = getAPIImplementation().getRootHUB();
        this.rootHubMonitor = new USBHubMonitor(device, hubApi);
        rootHubMonitor.startMonitor();
    }
View Full Code Here

     */
    public void findDevices(DeviceManager devMan, Bus bus) throws DeviceException {
        try {
            log.debug("Starting serial port drivers");

            Device dev = new Device(bus, "serial0");
            dev.setDriver(new SerialPortDriver(0x3f8));
            devMan.register(dev);

            dev = new Device(bus, "serial1");
            dev.setDriver(new SerialPortDriver(0x2f8));
            devMan.register(dev);

        } catch (DriverException ex) {
            throw new DeviceException(ex);
        }
View Full Code Here

    /**
     * Start the pointer device.
     */
    protected synchronized void startDevice() throws DriverException {
        final Device dev = getDevice();
        final String id = dev.getId();
        log.debug("Starting " + id);
        this.channel = getChannel();
        this.interpreter = createInterpreter();
        try {
            setRate(80);
        } catch (DeviceException ex) {
            log.error("Cannot set default rate", ex);
        }

        // start the deamon anyway, so we can register a mouse later
        startDispatcher(id);
        dev.registerAPI(PointerAPI.class, this);
        dev.registerAPI(DeviceInfoAPI.class, this);
    }
View Full Code Here

    public FireWireDriver() {
    }

    protected void startDevice() throws DriverException {
        final Device device = getDevice();
        final DeviceManager dm;
        try {
            dm = InitialNaming.lookup(DeviceManager.NAME);
            dm.rename(device, getDevicePrefix(), true);
        } catch (DeviceAlreadyRegisteredException ex) {
View Full Code Here

            throw new DriverException("Cannot find the keyboard layout manager", ex);
        } catch (KeyboardInterpreterException ex) {
            throw new DriverException();
        }

        final Device dev = getDevice();
        final String id = dev.getId();
        startDispatcher(id);
        dev.registerAPI(KeyboardAPI.class, this);
        dev.registerAPI(SystemTriggerAPI.class, this);

//        // If no inputstream has been defined, create and set one.
//        kis = null;
//        if (channel != null) {
//            kis = new KeyboardInputStream(this);
View Full Code Here

     * Null argument or zero length array plays the standard beep.
     */
    public static void play(Note[] n) {
        try {
            DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
            Device dev = dm.getDevice("speaker0");
            SpeakerAPI s = dev.getAPI(SpeakerAPI.class);
            if (n == null || n.length == 0) {
                s.beep();
            } else {
                s.playNote(n);
            }
View Full Code Here

TOP

Related Classes of org.jnode.driver.Device

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.