| View previous topic :: View next topic |
| Author |
Message |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Wed Aug 20, 2008 3:52 am Post subject: detect access via usb |
|
|
hello everybody!
I wanted to know how to know ( =) ) when data is tranferring over usb during an usb-pc connection.
in other words, do you remember the bar that goes to the left and to the right on the vsh when usb connection to memory stick is active? ok, how can i detect that event? how can i know that there is "something happening" at the usb port?
i think maybe is easier to look at the memory stick led, and detect when it is flashing, but how to do this?
would this work when flashes and umd are toggled via usb as well?
thanks very much! _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Aug 20, 2008 9:37 pm Post subject: |
|
|
Just run a timer thread and check the amount of data transferred at regular intervals. If its increasing then its transferring.
Unless you're trying to monitor another apps USB connection...then I dunno. |
|
| Back to top |
|
 |
homemister
Joined: 24 Mar 2008 Posts: 25
|
Posted: Wed Aug 20, 2008 9:50 pm Post subject: |
|
|
| how do u check the data being transfered from the psp? |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Wed Aug 20, 2008 9:57 pm Post subject: |
|
|
thanks, but how can i "check the amount of data transferred" _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Aug 20, 2008 10:03 pm Post subject: |
|
|
| phobox wrote: | | thanks, but how can i "check the amount of data transferred" |
I had some sample code showing how to read the bytes transferred. Can't seem to find it. Its only applicable if YOUR app started the USB. |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Wed Aug 20, 2008 10:08 pm Post subject: |
|
|
| Torch wrote: | | phobox wrote: | | thanks, but how can i "check the amount of data transferred" |
I had some sample code showing how to read the bytes transferred. Can't seem to find it. Its only applicable if YOUR app started the USB. |
yes my app DID start usb.
I wrote a working usb utility, now i want to add the possibility to know if data is tranferring over osb...
where did you get that sample code? _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Aug 20, 2008 10:09 pm Post subject: |
|
|
| phobox wrote: | | Torch wrote: | | phobox wrote: | | thanks, but how can i "check the amount of data transferred" |
I had some sample code showing how to read the bytes transferred. Can't seem to find it. Its only applicable if YOUR app started the USB. |
yes my app DID start usb.
I wrote a working usb utility, now i want to add the possibility to know if data is tranferring over osb...
where did you get that sample code? |
I dunno :S
Ask Hellcat or Cory1492. Both of their apps show the bytes transferred. |
|
| Back to top |
|
 |
cory1492
Joined: 10 Dec 2004 Posts: 216
|
Posted: Wed Aug 20, 2008 10:49 pm Post subject: |
|
|
???
I've never added bytes transfer to USB before... in fact, I was curious to see how this topic turned out. If I had to guess and start somewhere, I'd look for a function I could hook so I could monitor len/size info before dispatching to the original function.
Maybe Torch meant jas0nuk? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Aug 20, 2008 10:51 pm Post subject: |
|
|
| cory1492 wrote: | ???
I've never added bytes transfer to USB before... in fact, I was curious to see how this topic turned out. If I had to guess and start somewhere, I'd look for a function I could hook so I could monitor len/size info before dispatching to the original function.
Maybe Torch meant jas0nuk? |
Oh... Its definitely in Hellcats EPBM. |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Thu Aug 21, 2008 2:11 am Post subject: |
|
|
I guess hooking sceIoRead to msstor0: could work, but the vsh probably uses another approach, I bet they use one of these functions with unkown prototype:
| Code: |
0x16173D42 sceUSB_Stor_Ms_driver_16173D42
0x18EB011A sceUSB_Stor_Ms_driver_18EB011A
0x4B10A7F5 sceUsbstorMsRegisterEventFlag
0x56AA41EA sceUSB_Stor_Ms_driver_56AA41EA
0x762F7FDF sceUsbstorMsNotifyEventDone
0x9569F268 sceUsbstorMsSetVSHInfo
0x9C029B16 sceUSB_Stor_Ms_driver_9C029B16
0xABE9F2C7 sceUsbstorMsGetApInfo
0xFF0C3873 sceUsbstorMsUnregisterEventFlag
|
|
|
| Back to top |
|
 |
Hellcat
Joined: 24 Jan 2007 Posts: 84
|
Posted: Thu Aug 21, 2008 2:45 am Post subject: |
|
|
I remember doing this, including counting the ammount of data transfered, im my old pandora menu....
I hooked somewhere in the IoRead/IoWrite functions of the driver IIRC, set a flag to tell my other functions about a transfer in progress and counted the bytes in a global variable....
The solution I puzzled together wasn't all that nice (I'd guess there are way better ways to do it) but it worked pretty nicely :)
I'm not at home ATM, but when I am, I can see to dig out the code that did it.... |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Thu Aug 28, 2008 12:17 am Post subject: |
|
|
hellcat, news?
thanks
bye _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Hellcat
Joined: 24 Jan 2007 Posts: 84
|
Posted: Thu Aug 28, 2008 6:06 pm Post subject: |
|
|
Here's some good, old, well known xD USB code snipped, that I had modified a while back for checking USB access and counting the ammount of data.
Not too nice, but does the job.
http://pb.area-42.net/?show=22 |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Sun Sep 07, 2008 9:12 pm Post subject: |
|
|
you wrote that PspIoDrv *FindDriver(char *drvname) is a 1.50 specific function.
I think it is that because of u32 text_addr = *(mod+27);
and
u32 *(* GetDevice)(char *) = (void *)(text_addr+0x16D4);
how to obtain those values? _________________ Ciao! from Italy |
|
| Back to top |
|
 |
|