Programming :: Learning LibUSB From C Code
Oct 1, 2010
I'm trying to learn how to use USB from c code. Rather trying kernel stuff I thought I'd (after some searching ) use libusb. So I searched for documentation, unfortunately I came across two sets of documents each with it's own API?
[URL] and [URL]
For example one inits with libusb_init (libusb_context **context) the other uses void usb_init(void); I'm using libusb rather than kernel programming as I'd like to compile the code for windows as well as linux.
View 2 Replies
ADVERTISEMENT
Jul 25, 2011
Any good tutorial for libusb APIs..
View 3 Replies
View Related
May 28, 2010
tell me some sites for learning programing language Because i feel confusing for learning C programing language now I got so many questions by my studing and i want to solve them by myself too.
View 14 Replies
View Related
Aug 6, 2010
I've built a piece of hardware that communicates using usb. I was wondering could I make a libusb based program run on it's own without gcc/ libusb
View 10 Replies
View Related
Jun 21, 2011
I am trying to read raw data from usb device with libusb but I have some problems.
Code:
int main(void)
{
struct sigaction sigact;
int r = 1;
r = libusb_init(NULL);
[Code]...
View 2 Replies
View Related
Sep 2, 2010
I have decided to try out a little bit of c++ programing so I went out and bought me a book "Sams Teach your self C++ in 21 Days" Now I am at the part of the book where you write the hello world script. when I run Code: cc hello.cpp get this
[code]....
View 14 Replies
View Related
Jan 9, 2011
I have started reading book Linux Device Drivers 3rd edition. So I want to know which is the best light weight distribution to use so that learning can be more generic and also does not involve distro specific nitty-gritty details. I have already tried building kernel for Ubuntu 10.04 but it involved different commands from what is mentioned in the book. So I am not sure whether I would be able to make further in the book. Has anybody tried?
View 5 Replies
View Related
May 26, 2010
Essentially, I am reading the book "Absolute Beginner's Guide to C (Second Edition)", but the biggest problem is that it doesn't have problems nor projects to practice programming. Unfortunately, I do not have the greatest of an imagination to create my own ideas for problems to solve. Does anyone know of any sites that have good problems/projects to work on when I learn throughout the book?
View 6 Replies
View Related
Jul 25, 2010
Maybe I am posting something completely obvious and unnecessary here, but this is the best web site ever I found as reference for web programming.What makes this web site so special is that om almost all pages which explain some aspects of the language, a button "Try it yourself" takes you to a screen with two panes. In one pane the example is written, the other pane shows the output on a web page. In the first window you can actually change the code snippet, and see the result immediately in the pane on the other side. That is a great way to study why certain things occur as they do.
View 1 Replies
View Related
Mar 30, 2011
I need to rewrite the selenium java code into its equivalent php code.
View 5 Replies
View Related
Jun 6, 2011
I am working on a project with a lot of vector math and I'd like to find a way to speed it up.eading about SSE, but I've found no explanation on how to actually use it in code (was looking for some kind of hello-world example, complete with compilation instructions).Does the gcc compiler automatically make use of SSE, if you add the -sse(2,3) option on the command line? Or are their specific functions/libraries you need to call?
View 12 Replies
View Related
May 23, 2011
Is there, by chance, a fancy name to describe code that must be in a program but will never be executed? In one of my (Haskell) programs, I have some error-handling code that must be in the program to keep the compiler happy (due to the type checking). However I know that, due to the logical structure of the program, it is impossible for the code to be evaluated. I am curious if there is a technical name given to code that must exist but cannot be executed.
View 6 Replies
View Related
Jan 14, 2011
I went to compile some "oldish" glx code. The code compiles great but when I go to run it I get a crash. With X Error of failed request: BadMatch (in .....running ddd causes my whole system to lock up when I call the glx function XOpenDisplay. After a few attempts I thought I'd download a demo from the net, I choose nehe opengl tutorial 2, I compiled and ran but even on a net tutorial I get the same error
./lesson02
XF86VidModeExtension-Version 2.2
Got Doublebuffered Visual!
[code]....
View 1 Replies
View Related
Jul 20, 2011
I have the following code:
Code:
#!/bin/bash
function dx {
[Code].....
So essentially, it finds dx files, sorts them by numbers at the beginning, then performs the dx function I made (loops over all of the #-protein.dx and #-water.dx files).
It works fine when I'm running it on Ubuntu 11.04. However, when I try to run it on OSX, I get the following error:
Code:
mh320m01:DA_R02 janickij$ ./MOD_Loop_Tuber_Script.sh
find: illegal option -- t
find: illegal option -- y
[Code]....
View 9 Replies
View Related
Jan 5, 2010
I work as a linux sysadmin, and are now and then developing scripts that might be of use for others. I'd like to be able to share these, and for less trivial projects maybe create a central repository or something that others may upload updates/patches to etc.
View 10 Replies
View Related
Apr 10, 2010
I have a little test program consisting of a NASM source file and a C source file.How do I turn them into a single program?
Code:
section .data
msg db 'Hello, World!', 10
[code]....
View 14 Replies
View Related
Feb 23, 2011
whichever source code I go through I find these three lines of code written what do they actually mean and what is their function?
[code]...
View 6 Replies
View Related
Jul 15, 2010
I am running 11.2 64 bit on a Dell Vostro machine. I am unable to get piklab to connect to a PICKit 2 over USB. I have created a file /etc/udev/rules.d/26-microchip.rules which contains the line:
ATTR{idVendor}=="04d8", ATTR{idProduct}=="0033", OWNER:="root", GROUP:="users",MODE:="0660"
This gives a node /dev/bus/usb/006/002 with attributes crw-rw---- owner root group user. The device is rear/write to any member of the "users" group.In piklab the dialogue "Configure Piklab" reached through the menu Programmer->Settings... on the Preogrammer Selection the Port Selection tab displays USB Connection:Error.After much research I find that there may be problems with the libusb library under 11.2 so I try to see what is returned by lsusb. I enter the command:
sudo lsusb -v -s 006:002
this returns:
Bus 006 Device 002: ID 04d8:0033 Microchip Technology, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
[code]....
This shows that the udev mechanism appears to be finding the device and all the data is being collected but the last line looks ominous.
What does "cannot read device status, Broken pipe (32)" mean and where does it come from? Is this the cause of the USB connection error?
View 1 Replies
View Related
Jul 23, 2010
I am trying to programming on leJOS and I need to some base on prerequisite steps. If Someone know could tell me how to install libusb on Ubuntu. And how can I check currently version or update or upgrade?
View 3 Replies
View Related
Jun 1, 2011
I'm trying to install libusb. I've downloaded a file from [URL]. I've unzipped the file; the folder's on my desktop. I've tried to install this, but I'm not sure how. Under installation it says: See the file 'INSTALL'. There are a few files that start with this term: INSTALL.libusb, INSTALL.libusb.in and install-sh. The first two appear to be the same, while the latter appears to be some sort of program.
When I double click it, I get a few options, including "run". I assumed this was the correct way to install the program, but when I hit run, nothing happens. I've displayed this file, but this gives me no additional information. I've tried running it in terminal: nothing. Maybe it has installed, and I just don't know it. How would I even check if it's installed? (I'm only installing libusb because I need it for something else).
View 5 Replies
View Related
Feb 3, 2011
I am trying to get the libusb-dev package installed through Synapticslibusb-dev: Depends: libusb-0.1-4 (= 2:0.1.12-14) but 2:0.1.12-14ubuntu0.2 is to be installed E: Broken packagesI have also tried sudo apt-get install libusb-dev but the same result
View 3 Replies
View Related
Apr 14, 2011
I got Fedora core release 3
kernel 2.6.9-.667
I would like to know which command I have to use to see the libusb installed. I used this:
yum list installed | grep usb
but no output.
View 6 Replies
View Related
Jul 6, 2010
I am unable to understand libusb.
View 2 Replies
View Related
Feb 16, 2011
I want to write a c program with some shell scripts.Now For a simple C program. I am Setting a variable called val2 in bash, now I want to use bash variable val2 in C code. How do I do that?The above doesn't work (coz its spawning a different memory space and when shell script ends the variable dies with it as per my research but how do I keep them in same memory space)Also Is there any Good reference where they teach how to integrate C and Bash Together?
View 5 Replies
View Related
Mar 23, 2011
Can you find an alternative for Code: wc -l using grep?
View 1 Replies
View Related
Mar 28, 2011
Looking for code to add 5 numbers in assembly? I want to use array for input of those 5 numbers. No problem if the output is 1 digit(0....9).
View 3 Replies
View Related
May 17, 2011
I've been converting some C code to assembly for my homework; it was going well but I'm having trouble with a for loop for hours. I could not understand where is the problem and decided to ask. I'm posting the part where I'm having trouble of my C-code and assembly-code; every other part of codes act same and the variable values are same. I'm waiting this two codes to act same, but they don't.
Code:
mov ebx, [result]
mov eax, [i]
mov ecx, [ebx+eax]
mov [j], ecx
mov [ebx+eax], byte '.'
_loop:
mov ebx, [result]
mov eax, [i]
inc eax
mov cl, [ebx+eax]
cmp cl, 'Z'
je _continue
mov ebx,[result]
mov eax,[i]
inc eax
mov ecx, [ebx+eax]
mov [k], ecx
mov ebx, [result]
mov eax, [i]
inc eax
mov ecx, [j]
mov [ebx+eax], ecx
mov ecx, [k]
mov [j], ecx
inc dword [i]
jmp _loop
_continue:
Code:
j=result[i];
result[i]='.';
for(;result[i+1]!='Z';i++){
k=result[i+1];
result[i+1]=j;
j=k;
}
View 10 Replies
View Related
Apr 27, 2010
I was wondering why this code only returns me the same value ten times instead of valuate the conta+0.1 value code...
View 6 Replies
View Related
Jan 2, 2011
i want to run this code
[code]...
i have error in graphics. i have C++ 2005
View 4 Replies
View Related
Apr 15, 2009
I'm trying to call some Fortran 95 code in C, but I'm having problems with integers not having the same value in C as in Fortran, and changing values upon each run of the program. I think it has to do with the integer type, but I don't know how to fix it. I'm running Gentoo x86. Here are the files I've got:
foo.c:
Code:
#include <stdio.h>
extern int qux_();
main() {
[code]....
View 2 Replies
View Related