USB question!

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
Little_Boy_Blue
Posts: 1
Joined: Sun Dec 10, 2006 9:11 am

USB question!

Post by Little_Boy_Blue »

Is there anyway I can make my lua app check and see if there is a usb cable plugged in. I have the usb working I just want it to check to see if the cable is plugged in.
youresam
Posts: 87
Joined: Sun Nov 06, 2005 1:43 am

Post by youresam »

u32 usbstate;


...


static int lua_usbCableConnected(lua_State *L)
{
if (lua_gettop(L) != 0) return luaL_error(L, "wrong number of arguments");
usbstate = sceUsbGetState();
lua_pushboolean(L, (usbstate & PSP_USB_CABLE_CONNECTED));
return 1;
}



...


{"usbCableConnected", lua_usbCableConnected},
Post Reply