forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

USB question!

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
Little_Boy_Blue



Joined: 10 Dec 2006
Posts: 1

PostPosted: Sun Dec 10, 2006 10:31 am    Post subject: USB question! Reply with quote

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.
Back to top
View user's profile Send private message
youresam



Joined: 06 Nov 2005
Posts: 87

PostPosted: Fri Dec 22, 2006 12:08 pm    Post subject: Reply with quote

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},
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group