SceUsbSerial: Difference between revisions
Jump to navigation
Jump to search
Devnoname120 (talk | contribs) (Swapped Module <-> Library, see revision 1.1 under "Revision History" of "Vita SDK specifications" (https://wiki.henkaku.xyz/vita/File:Vita_SDK_specifications.pdf)) |
No edit summary |
||
(15 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Module == | == Module == | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! World !! Privilege | |||
|- | |- | ||
| 1.69-3.60 || Non-secure || Kernel | |||
| 1.69 | |||
|} | |} | ||
Line 12: | Line 10: | ||
=== Known NIDs === | === Known NIDs === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! Name !! World !! Visibility !! NID | ! Version !! Name !! World !! Visibility !! NID | ||
|- | |- | ||
| 1.69 || [[SceUsbSerial#SceUsbSerialForDriver|SceUsbSerialForDriver]] || Non-secure || Kernel || 0x8829C2F3 | | 1.69 || [[SceUsbSerial#SceUsbSerialForDriver|SceUsbSerialForDriver]] || Non-secure || Kernel || 0x8829C2F3 | ||
|- | |- | ||
| 1.69 || [[SceUsbSerial#SceUsbSerial|SceUsbSerial]] || Non-secure || User || 0x2820117D | | 2.10-3.60 || [[SceUsbSerial#SceUsbSerialForDriver|SceUsbSerialForDriver]] || Non-secure || Kernel || not present | ||
|- | |||
| 1.69-3.60 || [[SceUsbSerial#SceUsbSerial|SceUsbSerial]] || Non-secure || User || 0x2820117D | |||
|} | |} | ||
== SceUsbSerialForDriver == | == SceUsbSerialForDriver == | ||
=== | This library does not exist anymore as of FW 3.60. | ||
=== sceUsbSerialStartForDriver === | |||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
| 1.69 || 0xFEE7F4BA | |||
| 1.69 | |||
| 0xFEE7F4BA | |||
|} | |} | ||
<source lang="c">int | <source lang="c"> | ||
/** | |||
* Activate USB serial device | |||
* | |||
* @return 0 on success, < 0 on error | |||
* | |||
* @note The user is responsible for making sure no other UDC driver is active. This activates UDC as a "PS Vita" Type D device. | |||
*/ | |||
int sceUsbSerialStartForDriver(void); | |||
</source> | |||
=== | === sceUsbSerialSetupForDriver === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
| 1.69 || 0x590B8F97 | |||
| 1.69 | |||
| 0x590B8F97 | |||
|} | |} | ||
<source lang="c">int | <source lang="c"> | ||
/** | |||
* Setup USB serial device | |||
* | |||
* @return 0 on success, < 0 on error | |||
* | |||
* @param unk Unknown | |||
*/ | |||
int sceUsbSerialSetupForDriver(int unk); | |||
</source> | |||
=== | === sceUsbSerialStatusForDriver === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
| 1.69 || 0x8C426906 | |||
| 1.69 | |||
| 0x8C426906 | |||
|} | |} | ||
<source lang="c">int | <source lang="c"> | ||
/** | |||
* Get USB device status | |||
* | |||
* @return Returns 1 when serial port is open | |||
*/ | |||
int sceUsbSerialStatusForDriver(void);</source> | |||
=== | === sceUsbSerialCloseForDriver === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
| 1.69 || 0xE6B1E64F | |||
| 1.69 | |||
| 0xE6B1E64F | |||
|} | |} | ||
<source lang="c">int | <source lang="c"> | ||
/** | |||
* Close USB serial device | |||
*/ | |||
int sceUsbSerialCloseForDriver(void); | |||
</source> | |||
=== | === sceUsbSerialGetRecvBufferSizeForDriver === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
| 1.69 || 0xF531B5AE | |||
| 1.69 | |||
| 0xF531B5AE | |||
|} | |} | ||
<source lang="c">unsigned int | <source lang="c"> | ||
/** | |||
* Get receive buffer length | |||
* | |||
* @return Returns length of USB rx buffer | |||
*/ | |||
unsigned int sceUsbSerialGetRecvBufferSizeForDriver(void); | |||
</source> | |||
=== | === sceUsbSerialSendForDriver === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
| 1.69 || 0x0C2E73C0 | |||
| 1.69 | |||
| 0x0C2E73C0 | |||
|} | |} | ||
<source lang="c">unsigned int | <source lang="c"> | ||
/** | |||
* Send data | |||
* | |||
* @param[in] *buffer data to send over usb | |||
* @param[in] len int len of serial buffer data | |||
* @param unk1 Unknown | |||
* @param unk2 Unknown | |||
* @note max send length is 0x10000 | |||
*/ | |||
unsigned int sceUsbSerialSendForDriver(const void *buffer, unsigned int len, int unk1, int unk2); | |||
</source> | |||
=== | === sceUsbSerialRecvForDriver === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
| 1.69 || 0x6B5E296F | |||
| 1.69 | |||
| 0x6B5E296F | |||
|} | |} | ||
<source lang="c">unsigned int | <source lang="c"> | ||
/** | |||
* Receive Data | |||
* | |||
* @param[out] *buffer buffer for incoming data | |||
* @param[in] max_len max data length to receive | |||
* @param unk1 Unknown | |||
* @param unk2 Unknown | |||
* @note max recv length is 0x10000 | |||
*/ | |||
unsigned int sceUsbSerialRecvForDriver(void *buffer, unsigned int max_len, int unk1, int unk2); | |||
</source> | |||
== SceUsbSerial == | == SceUsbSerial == | ||
=== | === sceUsbSerialStart === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
! Version | | 1.69-3.60 || 0xE3BEC18C | ||
! NID | |} | ||
User wrapper for [[#sceUsbSerialStartForDriver]]. | |||
Checks [[SceSblACMgr#sceSblACMgrIsAllowUsbSerialForDriver]]. | |||
<source lang="c"> | |||
/** | |||
* Activate USB serial device | |||
* | |||
* @return 0 on success, < 0 on error | |||
* | |||
* @note The user is responsible for making sure no other UDC driver is active. This activates UDC as a "PS Vita" Type D device. | |||
* | |||
* @note Wrapper for kernel function sceUsbSerialStartForDriver() | |||
*/ | |||
int sceUsbSerialStart(void); | |||
</source> | |||
<source lang="c"> | |||
int ret = 0; | |||
sceUdcdDeactivateForDriver(a1, a2, a3, (*(uint32_t *)(/*data_81003000*/)) << 0x17); | |||
sceUdcdStopForDriver("USB_MTP_Driver", 0, 0); | |||
sceUdcdStopForDriver("USBDeviceControllerDriver", 0, 0); | |||
ret = sceUdcdStartForDriver("USBDeviceControllerDriver", 0, 0); | |||
if (ret != 0) | |||
return ret; | |||
ret = sceUdcdStartForDriver("USBSerDriver", 0, 0); | |||
if (ret != 0) { | |||
sceUdcdStopForDriver("USBSerDriver", 0, 0); | |||
return ret; | |||
} | |||
ret = sceUdcdActivateForDriver(0x69B); | |||
if (ret != 0) { | |||
sceUdcdStopForDriver("USBDeviceControllerDriver", 0, 0); | |||
return ret; | |||
} | |||
return ret; | |||
</source> | |||
=== sceUsbSerialSetup === | |||
{| class="wikitable" | |||
! Version !! NID | |||
|- | |- | ||
| 1.69 | | 1.69-3.60 || 0x290E08B4 | ||
| | |||
|} | |} | ||
= | User wrapper for [[#sceUsbSerialSetupForDriver]]. Must have correct permissions to call. | ||
<source lang="c"> | |||
/** | |||
* Setup USB serial device | |||
* | |||
* @return 0 on success, < 0 on error | |||
* | |||
* @param unk Unknown | |||
* | |||
* @note Wrapper for kernel function sceUsbSerialSetupForDriver() | |||
*/ | |||
int sceUsbSerialSetup(int unk); | |||
</source> | |||
=== sceUsbSerialStatus === | |||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
! Version | | 1.69-3.60 || 0xA6A2F5DE | ||
! NID | |} | ||
User wrapper for [[#sceUsbSerialStatusForDriver]]. Must have correct permissions to call. | |||
<source lang="c"> | |||
/** | |||
* Close USB serial device | |||
* | |||
* @return Returns 1 when serial port is open | |||
* | |||
* @note Wrapper for kernel function sceUsbSerialStatusForDriver() | |||
*/ | |||
int sceUsbSerialStatus(void); | |||
</source> | |||
=== sceUsbSerialClose === | |||
{| class="wikitable" | |||
! Version !! NID | |||
|- | |- | ||
| 1.69 | | 1.69-3.60 || 0xF2415853 | ||
| | |||
|} | |} | ||
=== | User wrapper for [[#sceUsbSerialCloseForDriver]]. Must have correct permissions to call. | ||
<source lang="c"> | |||
/** | |||
* Close USB serial device | |||
*/ | |||
int sceUsbSerialClose(void); | |||
</source> | |||
<source lang="c"> | |||
sceUdcdDeactivateForDriver(); | |||
sceUdcdStopForDriver("USBSerDriver", 0, 0); | |||
sceUdcdStopForDriver("USBDeviceControllerDriver", 0, 0); | |||
sceUdcdStartForDriver("USBDeviceControllerDriver", 0, 0); | |||
sceUdcdStartForDriver("USB_MTP_Driver", 0, 0); | |||
sceUdcdActivateForDriver(0x4E4); | |||
</source> | |||
=== sceUsbSerialGetRecvBufferSize === | |||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
! Version | | 1.69-3.60 || 0xE8567A87 | ||
! NID | |} | ||
User wrapper for [[#sceUsbSerialGetRecvBufferSizeForDriver]]. Must have correct permissions to call. | |||
<source lang="c"> | |||
/** | |||
* Get receive buffer length | |||
* | |||
* @return Returns length of USB rx buffer | |||
*/ | |||
unsigned int sceUsbSerialGetRecvBufferSize(void); | |||
</source> | |||
=== sceUsbSerialSend === | |||
{| class="wikitable" | |||
! Version !! NID | |||
|- | |- | ||
| 1.69 | | 1.69-3.60 || 0x89E71202 | ||
| | |||
|} | |} | ||
=== | User wrapper for [[#sceUsbSerialSendForDriver]]. Must have correct permissions to call. | ||
<source lang="c"> | |||
/** | |||
* Send data | |||
* @param[in] *buffer data to send over usb | |||
* @param len int len of serial buffer data | |||
* @param unk1 Unknown | |||
* @param unk2 Unknown | |||
* @note len max value is 0x10000 | |||
*/ | |||
unsigned int sceUsbSerialSend(const void *buffer, unsigned int len, int unk1, int unk2); | |||
</source> | |||
=== sceUsbSerialRecv === | |||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
! Version | | 1.69-3.60 || 0xF26DC8D8 | ||
! NID | |} | ||
User wrapper for [[#sceUsbSerialRecvForDriver]]. Must have correct permissions to call. | |||
<source lang="c"> | |||
/** | |||
* Receive Data | |||
* | |||
* @param[out] *buffer buffer for incoming data | |||
* @param max_len max data length to receive | |||
* @param unk1 Unknown | |||
* @param unk2 Unknown | |||
* @note max_len max value is 0x10000 | |||
*/ | |||
unsigned int sceUsbSerialRecv(void *buffer, unsigned int max_len, int unk1, int unk2); | |||
</source> | |||
=== SceUsbSerial_0ACC8A92 === | |||
{| class="wikitable" | |||
! Version !! NID | |||
|- | |- | ||
| | | 2.10-3.60 || 0x0ACC8A92 | ||
| | |||
|} | |} | ||
=== | === SceUsbSerial_2C08272C === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
! Version | | 2.10-3.60 || 0x2C08272C | ||
! NID | |} | ||
=== SceUsbSerial_405DB744 === | |||
{| class="wikitable" | |||
! Version !! NID | |||
|- | |- | ||
| | | 2.10-3.60 || 0x405DB744 | ||
| | |||
|} | |} | ||
=== | === SceUsbSerial_60D93778 === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
! Version | | 2.10-3.60 || 0x60D93778 | ||
! NID | |} | ||
=== SceUsbSerial_642F8F19 === | |||
{| class="wikitable" | |||
! Version !! NID | |||
|- | |- | ||
| | | 2.10-3.60 || 0x642F8F19 | ||
| | |||
|} | |} | ||
=== | === SceUsbSerial_923535FA === | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version !! NID | |||
|- | |- | ||
! Version | | 2.10-3.60 || 0x923535FA | ||
! NID | |} | ||
=== SceUsbSerial_A281DF87 === | |||
{| class="wikitable" | |||
! Version !! NID | |||
|- | |- | ||
| | | 2.10-3.60 || 0xA281DF87 | ||
| | |||
|} | |} | ||
== Sample Usage == | == Sample Kernel Usage == | ||
<source lang="c"> | <source lang="c"> | ||
int usb_serial_connect(void) | int usb_serial_connect(void) { | ||
{ | |||
int ret; | int ret; | ||
ret = | ret = sceUsbSerialStatusForDriver(); | ||
printf(" | printf("sceUsbSerialStatusForDriver: 0x%08X\n", ret); | ||
if (ret != 0x80244401) | if (ret != 0x80244401) { | ||
printf("already connected\n"); | printf("already connected\n"); | ||
return 0; | return 0; | ||
} | } | ||
ret = | ret = sceUsbSerialStartForDriver(); | ||
printf(" | printf("sceUsbSerialStartForDriver: 0x%08X\n", ret); | ||
ret = | ret = sceUsbSerialSetupForDriver(1); | ||
printf(" | printf("sceUsbSerialSetupForDriver: 0x%08X\n", ret); | ||
if (ret == 0x80244403) | if (ret == 0x80244403) { | ||
ret = SceUsbSerialForDriver_0x6AA4EFA4(); | ret = SceUsbSerialForDriver_0x6AA4EFA4(); | ||
printf("SceUsbSerialForDriver_0x6AA4EFA4: 0x%08X\n", ret); | printf("SceUsbSerialForDriver_0x6AA4EFA4: 0x%08X\n", ret); | ||
ret = | ret = sceUsbSerialSetupForDriver(1); | ||
printf(" | printf("sceUsbSerialSetupForDriver: 0x%08X\n", ret); | ||
} | } | ||
while ( | while (sceUsbSerialStatusForDriver() != 1); // wait for ready | ||
return 0; | return 0; | ||
} | } | ||
int usb_serial_close(void) | int usb_serial_close(void) { | ||
{ | |||
int ret; | int ret; | ||
ret = SceUsbSerialForDriver_0x6AA4EFA4(); | ret = SceUsbSerialForDriver_0x6AA4EFA4(); | ||
printf("SceUsbSerialForDriver_0x6AA4EFA4: 0x%08X\n", ret); | printf("SceUsbSerialForDriver_0x6AA4EFA4: 0x%08X\n", ret); | ||
ret = | ret = sceUsbSerialCloseForDriver(); | ||
printf(" | printf("sceUsbSerialCloseForDriver: 0x%08X\n", ret); | ||
return 0; | return 0; | ||
} | } | ||
int usb_serial_send(const void *data, unsigned int len) | int usb_serial_send(const void *data, unsigned int len) { | ||
{ | |||
int ret; | int ret; | ||
ret = | ret = sceUsbSerialSendForDriver(data, len, 0, -1); | ||
printf(" | printf("sceUsbSerialSendForDriver: 0x%08X\n"); | ||
return ret; | return ret; | ||
} | } | ||
int usb_serial_recv(void *data, unsigned int len) | int usb_serial_recv(void *data, unsigned int len) { | ||
{ | |||
int ret; | int ret; | ||
while ( | while (sceUsbSerialGetRecvBufferSizeForDriver() < len) { | ||
if (sceUsbSerialStatusForDriver() != 1) | |||
if ( | |||
return 0; | return 0; | ||
} | } | ||
ret = | ret = sceUsbSerialRecvForDriver(data, len, 0, -1); | ||
printf(" | printf("sceUsbSerialRecvForDriver: 0x%08X\n"); | ||
return ret; | return ret; | ||
} | } | ||
</source> | </source> | ||
[[Category:ARM]] | |||
[[Category:Kernel]] | |||
[[Category:Modules]] | [[Category:Modules]] | ||
[[Category: | [[Category:Library]] |
Latest revision as of 21:38, 1 May 2023
Module
Version | World | Privilege |
---|---|---|
1.69-3.60 | Non-secure | Kernel |
Libraries
Known NIDs
Version | Name | World | Visibility | NID |
---|---|---|---|---|
1.69 | SceUsbSerialForDriver | Non-secure | Kernel | 0x8829C2F3 |
2.10-3.60 | SceUsbSerialForDriver | Non-secure | Kernel | not present |
1.69-3.60 | SceUsbSerial | Non-secure | User | 0x2820117D |
SceUsbSerialForDriver
This library does not exist anymore as of FW 3.60.
sceUsbSerialStartForDriver
Version | NID |
---|---|
1.69 | 0xFEE7F4BA |
/** * Activate USB serial device * * @return 0 on success, < 0 on error * * @note The user is responsible for making sure no other UDC driver is active. This activates UDC as a "PS Vita" Type D device. */ int sceUsbSerialStartForDriver(void);
sceUsbSerialSetupForDriver
Version | NID |
---|---|
1.69 | 0x590B8F97 |
/** * Setup USB serial device * * @return 0 on success, < 0 on error * * @param unk Unknown */ int sceUsbSerialSetupForDriver(int unk);
sceUsbSerialStatusForDriver
Version | NID |
---|---|
1.69 | 0x8C426906 |
/** * Get USB device status * * @return Returns 1 when serial port is open */ int sceUsbSerialStatusForDriver(void);
sceUsbSerialCloseForDriver
Version | NID |
---|---|
1.69 | 0xE6B1E64F |
/** * Close USB serial device */ int sceUsbSerialCloseForDriver(void);
sceUsbSerialGetRecvBufferSizeForDriver
Version | NID |
---|---|
1.69 | 0xF531B5AE |
/** * Get receive buffer length * * @return Returns length of USB rx buffer */ unsigned int sceUsbSerialGetRecvBufferSizeForDriver(void);
sceUsbSerialSendForDriver
Version | NID |
---|---|
1.69 | 0x0C2E73C0 |
/** * Send data * * @param[in] *buffer data to send over usb * @param[in] len int len of serial buffer data * @param unk1 Unknown * @param unk2 Unknown * @note max send length is 0x10000 */ unsigned int sceUsbSerialSendForDriver(const void *buffer, unsigned int len, int unk1, int unk2);
sceUsbSerialRecvForDriver
Version | NID |
---|---|
1.69 | 0x6B5E296F |
/** * Receive Data * * @param[out] *buffer buffer for incoming data * @param[in] max_len max data length to receive * @param unk1 Unknown * @param unk2 Unknown * @note max recv length is 0x10000 */ unsigned int sceUsbSerialRecvForDriver(void *buffer, unsigned int max_len, int unk1, int unk2);
SceUsbSerial
sceUsbSerialStart
Version | NID |
---|---|
1.69-3.60 | 0xE3BEC18C |
User wrapper for #sceUsbSerialStartForDriver.
Checks SceSblACMgr#sceSblACMgrIsAllowUsbSerialForDriver.
/** * Activate USB serial device * * @return 0 on success, < 0 on error * * @note The user is responsible for making sure no other UDC driver is active. This activates UDC as a "PS Vita" Type D device. * * @note Wrapper for kernel function sceUsbSerialStartForDriver() */ int sceUsbSerialStart(void);
int ret = 0; sceUdcdDeactivateForDriver(a1, a2, a3, (*(uint32_t *)(/*data_81003000*/)) << 0x17); sceUdcdStopForDriver("USB_MTP_Driver", 0, 0); sceUdcdStopForDriver("USBDeviceControllerDriver", 0, 0); ret = sceUdcdStartForDriver("USBDeviceControllerDriver", 0, 0); if (ret != 0) return ret; ret = sceUdcdStartForDriver("USBSerDriver", 0, 0); if (ret != 0) { sceUdcdStopForDriver("USBSerDriver", 0, 0); return ret; } ret = sceUdcdActivateForDriver(0x69B); if (ret != 0) { sceUdcdStopForDriver("USBDeviceControllerDriver", 0, 0); return ret; } return ret;
sceUsbSerialSetup
Version | NID |
---|---|
1.69-3.60 | 0x290E08B4 |
User wrapper for #sceUsbSerialSetupForDriver. Must have correct permissions to call.
/** * Setup USB serial device * * @return 0 on success, < 0 on error * * @param unk Unknown * * @note Wrapper for kernel function sceUsbSerialSetupForDriver() */ int sceUsbSerialSetup(int unk);
sceUsbSerialStatus
Version | NID |
---|---|
1.69-3.60 | 0xA6A2F5DE |
User wrapper for #sceUsbSerialStatusForDriver. Must have correct permissions to call.
/** * Close USB serial device * * @return Returns 1 when serial port is open * * @note Wrapper for kernel function sceUsbSerialStatusForDriver() */ int sceUsbSerialStatus(void);
sceUsbSerialClose
Version | NID |
---|---|
1.69-3.60 | 0xF2415853 |
User wrapper for #sceUsbSerialCloseForDriver. Must have correct permissions to call.
/** * Close USB serial device */ int sceUsbSerialClose(void);
sceUdcdDeactivateForDriver(); sceUdcdStopForDriver("USBSerDriver", 0, 0); sceUdcdStopForDriver("USBDeviceControllerDriver", 0, 0); sceUdcdStartForDriver("USBDeviceControllerDriver", 0, 0); sceUdcdStartForDriver("USB_MTP_Driver", 0, 0); sceUdcdActivateForDriver(0x4E4);
sceUsbSerialGetRecvBufferSize
Version | NID |
---|---|
1.69-3.60 | 0xE8567A87 |
User wrapper for #sceUsbSerialGetRecvBufferSizeForDriver. Must have correct permissions to call.
/** * Get receive buffer length * * @return Returns length of USB rx buffer */ unsigned int sceUsbSerialGetRecvBufferSize(void);
sceUsbSerialSend
Version | NID |
---|---|
1.69-3.60 | 0x89E71202 |
User wrapper for #sceUsbSerialSendForDriver. Must have correct permissions to call.
/** * Send data * @param[in] *buffer data to send over usb * @param len int len of serial buffer data * @param unk1 Unknown * @param unk2 Unknown * @note len max value is 0x10000 */ unsigned int sceUsbSerialSend(const void *buffer, unsigned int len, int unk1, int unk2);
sceUsbSerialRecv
Version | NID |
---|---|
1.69-3.60 | 0xF26DC8D8 |
User wrapper for #sceUsbSerialRecvForDriver. Must have correct permissions to call.
/** * Receive Data * * @param[out] *buffer buffer for incoming data * @param max_len max data length to receive * @param unk1 Unknown * @param unk2 Unknown * @note max_len max value is 0x10000 */ unsigned int sceUsbSerialRecv(void *buffer, unsigned int max_len, int unk1, int unk2);
SceUsbSerial_0ACC8A92
Version | NID |
---|---|
2.10-3.60 | 0x0ACC8A92 |
SceUsbSerial_2C08272C
Version | NID |
---|---|
2.10-3.60 | 0x2C08272C |
SceUsbSerial_405DB744
Version | NID |
---|---|
2.10-3.60 | 0x405DB744 |
SceUsbSerial_60D93778
Version | NID |
---|---|
2.10-3.60 | 0x60D93778 |
SceUsbSerial_642F8F19
Version | NID |
---|---|
2.10-3.60 | 0x642F8F19 |
SceUsbSerial_923535FA
Version | NID |
---|---|
2.10-3.60 | 0x923535FA |
SceUsbSerial_A281DF87
Version | NID |
---|---|
2.10-3.60 | 0xA281DF87 |
Sample Kernel Usage
int usb_serial_connect(void) { int ret; ret = sceUsbSerialStatusForDriver(); printf("sceUsbSerialStatusForDriver: 0x%08X\n", ret); if (ret != 0x80244401) { printf("already connected\n"); return 0; } ret = sceUsbSerialStartForDriver(); printf("sceUsbSerialStartForDriver: 0x%08X\n", ret); ret = sceUsbSerialSetupForDriver(1); printf("sceUsbSerialSetupForDriver: 0x%08X\n", ret); if (ret == 0x80244403) { ret = SceUsbSerialForDriver_0x6AA4EFA4(); printf("SceUsbSerialForDriver_0x6AA4EFA4: 0x%08X\n", ret); ret = sceUsbSerialSetupForDriver(1); printf("sceUsbSerialSetupForDriver: 0x%08X\n", ret); } while (sceUsbSerialStatusForDriver() != 1); // wait for ready return 0; } int usb_serial_close(void) { int ret; ret = SceUsbSerialForDriver_0x6AA4EFA4(); printf("SceUsbSerialForDriver_0x6AA4EFA4: 0x%08X\n", ret); ret = sceUsbSerialCloseForDriver(); printf("sceUsbSerialCloseForDriver: 0x%08X\n", ret); return 0; } int usb_serial_send(const void *data, unsigned int len) { int ret; ret = sceUsbSerialSendForDriver(data, len, 0, -1); printf("sceUsbSerialSendForDriver: 0x%08X\n"); return ret; } int usb_serial_recv(void *data, unsigned int len) { int ret; while (sceUsbSerialGetRecvBufferSizeForDriver() < len) { if (sceUsbSerialStatusForDriver() != 1) return 0; } ret = sceUsbSerialRecvForDriver(data, len, 0, -1); printf("sceUsbSerialRecvForDriver: 0x%08X\n"); return ret; }