in reply to Problem trying to use Device::USB
The problem is that call to libusb_get_descriptor() is defined as taking a void* for the buf parameter:
int libusb_get_descriptor( void *dev, unsigned char type, unsigned char index, void *buf, int s +ize )
But the typemap for that is void * T_PTR, and that translates as
T_PTR $var = INT2PTR($type,SvIV($arg)).
Ie. it is expecting the pointer to be passed as an integer in the IV slot. Hence the "argument isn't numeric".
In order to pass a buffer in the PV slot, as the perl code is doing, the type should be one of those that translates to
T_PV $var = ($type)SvPV_nolen($arg).
Eg. char * T_PV
There seem to be several of the functions that make this error.
|
|---|