Changes

Jump to navigation Jump to search
5,235 bytes added ,  21:12, 26 December 2014
no edit summary
== Library ==

=== Known NIDs ===
{| class="wikitable"
|-
! Version !! Name !! World !! Privilege !! NID
|-
| 1.69 || SceUsbSerial || Non-secure || Kernel || 0xF8D9930F
|}

== Modules ==

=== Known NIDs ===

{| class="wikitable"
|-
! Version !! Name !! World !! Visibility !! NID
|-
| 1.69 || [[SceUsbSerial#SceUsbSerialForDriver|SceUsbSerialForDriver]] || Non-secure || Kernel || 0x8829C2F3
|-
| 1.69 || [[SceUsbSerial#SceUsbSerial|SceUsbSerial]] || Non-secure || User || 0x2820117D
|}

== SceUsbSerialForDriver ==

=== Activate USB serial device ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0xFEE7F4BA
|}
The user is responsible for making sure no other UDC driver is active. This activates UDC as a <code>"PS Vita" Type D</code> device.

<source lang="c">int SceUsbSerialForDriver_0xFEE7F4BA_start(void);</source>

=== Setup USB serial device ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0x590B8F97
|}

<source lang="c">int SceUsbSerialForDriver_0x590B8F97_setup(int unk);</source>

=== Get Device Status ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0x8C426906
|}
Returns 1 when device is ready.

<source lang="c">int SceUsbSerialForDriver_0x8C426906_status(void);</source>

=== Close USB serial device ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0xE6B1E64F
|}

<source lang="c">int SceUsbSerialForDriver_0xE6B1E64F_close(void);</source>

=== Get receive buffer length ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0xF531B5AE
|}

<source lang="c">unsigned int SceUsbSerialForDriver_0xF531B5AE_get_len(void);</source>

=== Send Data ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0x0C2E73C0
|}

<source lang="c">unsigned int SceUsbSerialForDriver_0x0C2E73C0_send(const void *buffer, unsigned int len, int unk1, int unk2);</source>

=== Receive Data ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0x6B5E296F
|}

<source lang="c">unsigned int SceUsbSerialForDriver_0x6B5E296F_recv(void *buffer, unsigned int max_len, int unk1, int unk2);</source>

== SceUsbSerial ==

=== Activate USB serial device ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0xE3BEC18C
|}
User wrapper for <code>0xFEE7F4BA</code>. Must have correct permissions to call.

=== Setup USB serial device ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0x290E08B4
|}
User wrapper for <code>0x590B8F97</code>. Must have correct permissions to call.

=== Get Device Status ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0xA6A2F5DE
|}
User wrapper for <code>0x8C426906</code>. Must have correct permissions to call.

=== Close USB serial device ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0xF2415853
|}
User wrapper for <code>0xE6B1E64F</code>. Must have correct permissions to call.

=== Get receive buffer length ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0xE8567A87
|}
User wrapper for <code>0xF531B5AE</code>. Must have correct permissions to call.

=== Send Data ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0x89E71202
|}
User wrapper for <code>0x0C2E73C0</code>. Must have correct permissions to call. Max length is <code>0x10000</code>.

=== Receive Data ===
{| class="wikitable"
|-
! Version
! NID
|-
| 1.69
| 0xF26DC8D8
|}
User wrapper for <code>0x6B5E296F</code>. Must have correct permissions to call. Max length is <code>0x10000</code>.

== Sample Usage ==

<source lang="c">
int usb_serial_connect(void)
{
int ret;

ret = SceUsbSerialForDriver_0x8C426906_status();
printf("SceUsbSerialForDriver_0x8C426906_status: 0x%08X\n", ret);
if (ret != 0x80244401)
{
printf("already connected\n");
return 0;
}

ret = SceUsbSerialForDriver_0xFEE7F4BA_start();
printf("SceUsbSerialForDriver_0xFEE7F4BA_start: 0x%08X\n", ret);
ret = SceUsbSerialForDriver_0x590B8F97_setup(1);
printf("SceUsbSerialForDriver_0x590B8F97_setup: 0x%08X\n", ret);

if (ret == 0x80244403)
{
ret = SceUsbSerialForDriver_0x6AA4EFA4();
printf("SceUsbSerialForDriver_0x6AA4EFA4: 0x%08X\n", ret);
ret = SceUsbSerialForDriver_0x590B8F97_setup(1);
printf("SceUsbSerialForDriver_0x590B8F97_setup: 0x%08X\n", ret);
}

while (SceUsbSerialForDriver_0x8C426906_status() != 1); // wait for ready

return 0;
}

int usb_serial_close(void)
{
int ret;

ret = SceUsbSerialForDriver_0x6AA4EFA4();
printf("SceUsbSerialForDriver_0x6AA4EFA4: 0x%08X\n", ret);
ret = SceUsbSerialForDriver_0xE6B1E64F_close();
printf("SceUsbSerialForDriver_0xE6B1E64F_close: 0x%08X\n", ret);

return 0;
}

int usb_serial_send(const void *data, unsigned int len)
{
int ret;

ret = SceUsbSerialForDriver_0x0C2E73C0_send(data, len, 0, -1);
printf("SceUsbSerialForDriver_0x0C2E73C0_send: 0x%08X\n");

return ret;
}

int usb_serial_recv(void *data, unsigned int len)
{
int ret;

while (SceUsbSerialForDriver_0xF531B5AE_get_len() < len)
{
if (SceUsbSerialForDriver_0x8C426906_status() != 1)
{
return 0;
}
}

ret = SceUsbSerialForDriver_0x6B5E296F_recv(data, len, 0, -1);
printf("SceUsbSerialForDriver_0x6B5E296F_recv: 0x%08X\n");

return ret;
}

</source>

[[Category:Libraries]]
[[Category:Kernel]]

Navigation menu