Quantcast

Help on visual basic 6 usb_bulk_wite

classic Classic list List threaded Threaded
37 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Help on visual basic 6 usb_bulk_wite

nicogalan
Hello there :)
I need some help please...
I am trying to use libusbvb0.dll with visual, but I need some examples please...
I know my device vid & pid.
what else do I need to know, or what else to do, to be able to send and receive data to/from usb device?
an example will be welcome :)
thanks in advance.
regards.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

Xiaofan Chen
On Sun, Oct 17, 2010 at 11:00 PM, nicogalan <[hidden email]> wrote:

>
> Hello there :)
> I need some help please...
> I am trying to use libusbvb0.dll with visual, but I need some examples
> please...
> I know my device vid & pid.
> what else do I need to know, or what else to do, to be able to send and
> receive data to/from usb device?
> an example will be welcome :)
> thanks in advance.

If possible, please do not use Nabble but rather subscribe to
the mailing list directly. Thanks.

I do not know VB6. But you can try to follow the example here.
http://libusb.6.n5.nabble.com/Visual-Basic-6-0-How-to-access-the-libusb-td10562.html

It has the simple example and I just tried the binary (test_libusb.ex)
and it seems to work.
(the download name is vb6_zip.pdf, you need to rename it as
vb6.zip and then unzip).

Take note that libusbvb0.dll is basically a wrapper of libusb0.dll
but with stdcall calling convention since VB6 does not seem
to support cdecl calling convention.

Why do you want to use VB6? It is quite old and seems not
to be supported by Microsoft any more.

If you move up to VB2005/2008/2010, probably you can use
libusbdotnet.
http://sourceforge.net/projects/libusbdotnet/



--
Xiaofan

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Libusb-win32-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

nicogalan
thanks, I saw that post, but I was not able to get it to work.
I would need a sorce example :)
I have .net 2003, 2005 and 2008 here, but exe generated, are very hard to protect, and LOCK to hardware.
anyway, code examples for .net are welcome too.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

Xiaofan Chen
On Mon, Oct 18, 2010 at 11:35 AM, nicogalan <[hidden email]> wrote:
>
> thanks, I saw that post, but I was not able to get it to work.
> I would need a source example :)

Other than that, I do not know of any published codes for VB6. You
can probably post your codes and some people in this list who know
VB6 may be able to pinpoint the problems of your code.

> I have .net 2003, 2005 and 2008 here, but exe generated, are very hard to
> protect, and LOCK to hardware.
> anyway, code examples for .net are welcome too.

You can try libusbdotnet, there are many examples inside. The examples
are written in C#, but you can probably adapt to VB.net.
http://sourceforge.net/projects/libusbdotnet/




--
Xiaofan

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Libusb-win32-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

nicogalan
This post was updated on .
In reply to this post by nicogalan
here is code....

Private Sub Form_Activate()
    UsbInit
    UsbSetDebug (255)
   
End Sub

Private Sub Command2_Click()
Dim my_handle
                      my_handle = UsbOpen(0, &HD33, &H20)
                      If my_handle = 0 Then MsgBox " No such device "
                      Text1 = my_handle
End Sub

Private Sub Command3_Click()
UsbBulkWrite my_handle, 1, 10, 512, 5000


I tried also command 3 like this
Private Sub Command3_Click()
UsbBulkWrite UsbOpen(0, &HD55, &H20), 1, 10, 512, 5000



is "buf" string to send??
thanks

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

Xiaofan Chen
On Wed, Oct 20, 2010 at 7:31 AM, nicogalan <[hidden email]> wrote:

> Private Sub Command3_Click()
> UsbBulkWrite my_handle, 1, 10, 512, 5000
>
>
> is "buf" string to send??
> thanks
>

>From libusb.bas,

Declare Function UsbBulkWrite Lib "libusbvb0.dll" _
  Alias "vb_usb_bulk_write" ( _
  ByVal dev As Long, _
  ByVal ep As Long, _
  ByRef buf As Any, _
  ByVal size As Long, _
  ByVal timeout As Long) As Long

So you are using EP 1 (OUT Endpoint 1), you are sending
"10" does not seem to be right. It should point to the buffer you
want to send. And you have to know what the device expects
to get in order to use libusb-win32.

http://sourceforge.net/apps/trac/libusb-win32/wiki/libusbwin32_documentation
usb_bulk_write()
Name
usb_bulk_write -- Write data to a bulk endpoint
Description
int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size,
int timeout);

usb_bulk_write() performs a bulk write request to the endpoint specified by ep.
Returns number of bytes written on success or < 0 on error.

--
Xiaofan

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Libusb-win32-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

nicogalan
exactly :)
I tried to send "10" to endpoint 1 as a test, but "10" never arrived to usb. I used usbmonitor to check.

am I using it right??

I will declare buf as string and try again later...
thanks :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

nicogalan
no....
no luck.....
I used buf as string but nothing....
what am I doing wrong?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

Stephen Hart-2

You need to declare a fixed length array of bytes that is long enough for
libusb-win32 to use.

You then pass a pointer to the array inside the libusb function using the
word ByVal


Const cMaxLengthNeeded =255
Dim buffer( cMaxLengthNeeded ) as byte
Dim bufferPtr as long  '// 4 byte signed integer

bufferPtr = VarPtr(buffer(0))

libusubWin32Function( ... , ByVal bufferPtr, ... )


>
> no....
> no luck.....
> I used buf as string but nothing....
> what am I doing wrong?
>
> --
> View this message in context:
> http://libusb.6.n5.nabble.com/Help-on-visual-basic-6-usb-bulk-wite-tp3216312p3231119.html
> Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America
> contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in
> marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> Libusb-win32-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Libusb-win32-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

nicogalan
thanks so much.
just one more thing...
could you please see my code above?

and how to send to device the string "hello"
could you please post an example for this?
thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

Xiaofan Chen
On Tue, Oct 26, 2010 at 5:38 AM, nicogalan <[hidden email]> wrote:
>
> thanks so much.
> just one more thing...
> could you please see my code above?
>
> and how to send to device the string "hello"
> could you please post an example for this?

Please post your updated codes.

Does your device accept "hello"? You have to know your device
in order to use libusb-win32.

What is the output of "testlibusb-win.exe" for your device?



--
Xiaofan

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Libusb-win32-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

nicogalan
I used "hello" as an example.
my device needs hexa data to be sent, I know what to send to it... I did it via serial port and now I need to do it for usb interface.

here is what testlibusb-win.exe shows:

bus-0/\\.\libusb0-0002--0x0d33-0x0022     0d33/0022
- Manufacturer : xxxxxx
- Product      : xxxxxxxxxxx
  wTotalLength:         32
  bNumInterfaces:       1
  bConfigurationValue:  1
  iConfiguration:       4
  bmAttributes:         c0h
  MaxPower:             5
    bInterfaceNumber:   0
    bAlternateSetting:  0
    bNumEndpoints:      2
    bInterfaceClass:    255
    bInterfaceSubClass: 10
    bInterfaceProtocol: 255
    iInterface:         5
      bEndpointAddress: 01h
      bmAttributes:     02h
      wMaxPacketSize:   16
      bInterval:        0
      bRefresh:         0
      bSynchAddress:    0
      bEndpointAddress: 82h
      bmAttributes:     02h
      wMaxPacketSize:   16
      bInterval:        0
      bRefresh:         0
      bSynchAddress:    0

I am using code from this post.
http://libusb.6.n5.nabble.com/Visual-Basic-6-0-How-to-access-the-libusb-td10562.html

now I have the device handle, the endpoint but I readed I need to use usb_claim_interface before usb_bulk_write

please, I would need one example, I will adapt code for my needs.

an example showing me how to send to this device any string will be great :)
thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

Stephen Hart-2
In reply to this post by Xiaofan Chen


'     I have only done Bulk Usb programming, never any interrupt stuff,
' so I haven't tested the interrupt functions.
'     The declares I used are shown below the code.


Option Explicit

' variable starts with m - module level,
' starts with p - procedure level ()function or sub
' starts with c - constant
' mabyt = _module level _array of _byte

Private Const clMaxBufferLoc = 255
Private mabytSourceFile( clMaxBufferLoc ) As Byte


'Above code must be before 1st sub or function definition



Private Sub FillBuffer( ByVal vsStringToSend As String, _
                        VyRef rbStringStored As Boolean)
Dim plStrLen As Long
Dim plCurArrayLoc As Long
Dim psSourceChar As String


plStrLen = Len(vsStringToSend)
If ( plStrLen >= clMaxBufferLoc) then
   rbStringStored =False
   Exit Sub
Endif

For plCurArrayLoc = 0 To (plStrLen - 1)
      psSourceChar = Mid(psSourceFile, (1 + plCurArrayLoc), 1)
      mabytSourceFile(plCurArrayLoc) = Asc(psSourceChar)
Next plCurArrayLoc

rbStringStored = True

End Sub



Private Sub WriteHello()
Dim psTest As String
Dim plBufferPtr As Long
Dim plBufferLen As Long
Dim plNrBytesWritten As Long
Dim pbStringStoredInBuffer As Boolean

psTest = "Hello"
Call FillBuffer(psTest, pbStringStoredInBuffer)

If pbStringStoredInBuffer Then
   plBufferLen = Len(psTest)

   ' don't send a pointer to a variable declared inside a function,
   ' only use pointers to permanent fixed size arrays
   plBufferPtr = VarPtr(mabytSourceFile(0))

   ' Note the use of ByVal to make sure nothing turns into a pointer
   plNrBytesWritten = UsbBulkWrite(ByVal mlCurDeviceHandle, _
            ByVal clDt2_USB_ENDPOINT_CommandWrite, _
            ByVal plSmallBufferStartLoc, ByVal plBufferLen, _
            ByVal clDt2_USB_CommandTimeout)
End If

End Sub


' Declares - put in a module
' For any function that Gets a string or a structure with
' different data types, just pass a pointer (long type) to an
' array of bytes that is big enough for the
' string or structure, then process it one byte at a time.

'  "libusbvb0.dll"  should be in the same directory as the program

Declare Sub UsbInit Lib "libusbvb0.dll" _
  Alias "vb_usb_init" ()

Declare Sub UsbSetDebug Lib "libusbvb0.dll" _
  Alias "vb_usb_set_debug" ( _
  ByVal level As Long)

Declare Function UsbOpen Lib "libusbvb0.dll" _
  Alias "vb_usb_open" ( _
  ByVal Index As Long, _
  ByVal vid As Long, _
  ByVal pid As Long) As Long

Declare Function UsbClose Lib "libusbvb0.dll" _
  Alias "vb_usb_close" ( _
  ByVal dev As Long) As Long

Declare Function UsbGetString Lib "libusbvb0.dll" _
  Alias "vb_usb_get_string" ( _
  ByVal dev As Long, _
  ByVal Index As Long, _
  ByVal langid As Long, _
  ByVal buf As Long, _
  ByVal size As Long) As Long

Declare Function UsbGetStringSimple Lib "libusbvb0.dll" _
  Alias "vb_usb_get_string_simple" ( _
  ByVal dev As Long, _
  ByVal Index As Long, _
  ByVal buf As Long, _
  ByVal size As Long) As Long

Declare Function UsbGetDescriptorByEndpoint Lib "libusbvb0.dll" _
  Alias "vb_usb_get_descriptor_by_endpoint" ( _
  ByVal dev As Long, _
  ByVal ep As Long, _
  ByVal dtype As Long, _
  ByVal Index As Long, _
  ByVal buf As Long, _
  ByVal size As Long) As Long

Declare Function UsbGetDescriptor Lib "libusbvb0.dll" _
  Alias "vb_usb_get_descriptor" ( _
  ByVal dev As Long, _
  ByVal dtype As Long, _
  ByVal Index As Long, _
  ByVal buf As Long, _
  ByVal size As Long) As Long

Declare Function UsbBulkWrite Lib "libusbvb0.dll" _
  Alias "vb_usb_bulk_write" ( _
  ByVal dev As Long, _
  ByVal ep As Long, _
  ByVal buf As Long, _
  ByVal size As Long, _
  ByVal timeout As Long) As Long

Declare Function UsbBulkRead Lib "libusbvb0.dll" _
  Alias "vb_usb_bulk_read" ( _
  ByVal dev As Long, _
  ByVal ep As Long, _
  ByVal buf As Long, _
  ByVal size As Long, _
  ByVal timeout As Long) As Long

Declare Function UsbInterruptWrite Lib "libusbvb0.dll" _
  Alias "vb_usb_interrupt_write" ( _
  ByVal dev As Long, _
  ByVal ep As Long, _
  ByVal buf As Long, _
  ByVal size As Long, _
  ByVal timeout As Long) As Long

Declare Function UsbInterruptRead Lib "libusbvb0.dll" _
  Alias "vb_usb_interrupt_read" ( _
  ByVal dev As Long, _
  ByVal ep As Long, _
  ByVal buf As Long, _
  ByVal size As Long, _
  ByVal timeout As Long) As Long

Declare Function UsbControlMsg Lib "libusbvb0.dll" _
  Alias "vb_usb_control_msg" ( _
  ByVal dev As Long, _
  ByVal requesttype As Long, _
  ByVal request As Long, _
  ByVal value As Long, _
  ByVal Index As Long, _
  ByVal buf As Long, _
  ByVal size As Long, _
  ByVal timeout As Long) As Long

Declare Function UsbSetConfiguration Lib "libusbvb0.dll" _
  Alias "vb_usb_set_configuration" ( _
  ByVal dev As Long, _
  ByVal configuration As Long) As Long

Declare Function UsbClaimInterface Lib "libusbvb0.dll" _
  Alias "vb_usb_claim_interface" ( _
  ByVal dev As Long, _
  ByVal interface As Long) As Long

Declare Function UsbReleaseInterface Lib "libusbvb0.dll" _
  Alias "vb_usb_release_interface" ( _
  ByVal dev As Long, _
  ByVal interface As Long) As Long

Declare Function UsbSetAltinterface Lib "libusbvb0.dll" _
  Alias "vb_usb_set_altinterface" ( _
  ByVal dev As Long, _
  ByVal alternate As Long) As Long

Declare Function UsbResetEp Lib "libusbvb0.dll" _
  Alias "vb_usb_resetep" ( _
  ByVal dev As Long, _
  ByVal ep As Long) As Long

Declare Function UsbClearHalt Lib "libusbvb0.dll" _
  Alias "vb_usb_clear_halt" ( _
  ByVal dev As Long, _
  ByVal ep As Long) As Long

Declare Function UsbReset Lib "libusbvb0.dll" _
  Alias "vb_usb_reset" ( _
  ByVal dev As Long) As Long





------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Libusb-win32-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

nicogalan
thanks!!!
wow, what a mess :D

I am willing to pay for help, I would need a working code, if not, steps to do, with code if possible.

I wrote above all info about my usb device, now I would need a code for that device, I need to send only some strings XD

thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

nicogalan
This post was updated on .
I have a code now, I received some help :)

Sub Main()
   

POST EDITED

debug (inmediate) show this after run:

Dev= 51250704
SetCfg:  0
Claim:  0
Write:  16
Read: -22
0000000000000000


so, it says it's writing, right???

usb sniffer does not detect any write, and device does not do what I want heheheh
what else could be missing?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

Xiaofan Chen
On Sun, Oct 31, 2010 at 6:14 AM, nicogalan <[hidden email]> wrote:
>
> I have a code now, I received some help :)
>
>        Debug.Print "Write: "; UsbBulkWrite(lngDev, 1, bvData(0), 16, 1000)
>        DoEvents
>        Debug.Print "Read: "; UsbBulkRead(lngDev, 1, bvRead(0), 16, 1000)

Change that to 0x81, EP 1 IN is 0x81. That explains the -22 error.

And make sure that your device wants 16 bytes of data.

> debug (inmediate) show this after run:
>
> Dev= 51250704
> SetCfg:  0
> Claim:  0
> Write:  16
> Read: -22
> 0000000000000000
>
> so, it says it's writing, right???
>



--
Xiaofan

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Libusb-win32-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

Stephen Hart-2
In reply to this post by nicogalan
On 10/30/2010 6:14 PM, nicogalan wrote:

>
> I have a code now, I received some help :)
>
> Sub Main()
>      Dim lngDev As Long
>      Dim bvData(15) As Byte
>      Dim bvRead(15) As Byte
>
>      Call UsbInit
>
>      lngDev = UsbOpen(0,&Hd33,&H11)
>
>      If lngDev>  0 Then
>          Debug.Print "Dev="; lngDev
>          Debug.Print "SetCfg: "; UsbSetConfiguration(lngDev, 1)
>          Debug.Print "Claim: "; UsbClaimInterface(lngDev, 0)
>
>
>          bvData(0) =&H10
>          bvData(1) =&H20
>          bvData(2) =&H5
>          bvData(3) =&H8
>          bvData(4) =&H4C
>          bvData(5) =&H0
>          bvData(6) =&H11
>          bvData(7) =&H3
>          bvData(8) =&HC9
>          bvData(9) =&HDB
>          bvData(10) =&H15
>          bvData(11) =&H33
>
>          Debug.Print "Write: "; UsbBulkWrite(lngDev, 1, bvData(0), 16, 1000)
>          DoEvents
>          Debug.Print "Read: "; UsbBulkRead(lngDev, 1, bvRead(0), 16, 1000)
>
>
>          Dim lngIndex As Long
>
>
>          For lngIndex = 0 To UBound(bvRead)
>              Debug.Print Hex(bvRead(lngIndex));
>          Next lngIndex
>          Debug.Print ""
>
>
>          Call UsbClose(lngDev)
>      End If
> End Sub
>
>
> debug (inmediate) show this after run:
>
> Dev= 51250704
> SetCfg:  0
> Claim:  0
> Write:  16
> Read: -22
> 0000000000000000
>
>
> so, it says it's writing, right???
>
> usb sniffer does not detect any write, and device does not do what I want
> heheheh
> what else could be missing?


=============

The return code for the Write is +16, which indicates that you wrote 16
bytes into it.

The return code for the Write is < 0, which is an error so maybe you
need a larger array to receive the data.

If you need to declare a much larger array, you should declare it
outside the "Sub".  If it is declared inside, it is declared on the
stack, which cannot allocate large arrays.  As I mentioned in the
earlier post, declare the arrays at module level.

Also, you have assigned bvData(5) =&H0, then you define later values.
The C function that receives it will ignore anything after the &h0

You should also use
  "byval VarPtr( bvRead(0) )"
instead of just
  "bvRead(0)"




------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Libusb-win32-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

nicogalan
yes!!!!!!

it's working now!!!

I did not change code I gave above.....

if I use libusb filter, then, no data is written to device :(

but if I use INF wizard, and then I install driver generated, usb can read and write normally....

sadly, this is useless for me, what can the problem be now???

using filter, code shows write ok, but it does not write.
and if I use INF wizard, then everything is fine...
I am almost done, just a few more :)
thanks for your support :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

Xiaofan Chen
On Tue, Nov 2, 2010 at 6:33 AM, nicogalan <[hidden email]> wrote:
>
> yes!!!!!!
>
> it's working now!!!
>
> I did not change code I gave above.....

THat is strange as you have OUT endpoint 0x1 and IN endpoint 0x82
and your code is not tally with that.

> if I use libusb filter, then, no data is written to device :(
>
> but if I use INF wizard, and then I install driver generated, usb can read
> and write normally....

Which version of libusb-win32 are you using? How do you install
the filter. Please use the latest version and then use the device filter
GUI wizard.

> sadly, this is useless for me, what can the problem be now???
>
> using filter, code shows write ok, but it does not write.
> and if I use INF wizard, then everything is fine...
> I am almost done, just a few more :)
> thanks for your support :)
>




--
Xiaofan

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Libusb-win32-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help on visual basic 6 usb_bulk_wite

Xiaofan Chen
In reply to this post by nicogalan
On Tue, Nov 2, 2010 at 6:33 AM, nicogalan <[hidden email]> wrote:

> if I use libusb filter, then, no data is written to device :(
>
> but if I use INF wizard, and then I install driver generated, usb can read
> and write normally....
>
> sadly, this is useless for me, what can the problem be now???
>

BTW, what is the original driver used for this device? There
is a chance that the filter may not work with certain driver.


--
Xiaofan

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Libusb-win32-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
12
Loading...