CDLibrary - a driver to Dacal CD Library 2 devices
|Copyright:||2009 by Florian Boesch|
This Driver allows you to access CD Library 2 devices connected on the USB ports either via http or the filesystem
Copyright (C) 2009 Florian Boesch <firstname.lastname@example.org> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
- plug&play recognizes connected devices
- list unique device ids
- open specified slots
- retract slots
cdlibrary console is a python package installable by any of the following commands: command line:
cd cdlibrary; python setup.py install easy_install cdlibrary easy_install http://hg.codeflow.org/cdlibrary/archive/tip.tar.gz
Once you have the package installed (as root) you need to add a daemon script: command line:
sudo su - wget http://hg.codeflow.org/cdlibrary/archive/tip.tar.gz tar xzvf tip.tar.gz cp cdlibrary-*/cdlibd /etc/init.d update-rc.d -f cdlibd defaults
you can also use the code below as a start script: code:
import sys from cdlibrary import http, filesystem daemon = filesystem.daemon #daemon = http.daemon if __name__ == '__main__': command = sys.argv if command == 'start': daemon.start() elif command == 'stop': daemon.stop() elif command == 'restart': daemon.stop() daemon.start() elif command == 'debug': daemon.debug()
File System Interface
- ls /mnt/cdlibrary --> lists the device IDs as directory listing
- echo 123 > /mnt/cdlibrary/<device-id> --> opens slot 123
- echo close > /mnt/cdlibrary/<device-id> --> closes the slot of this device