how to transfer a string from a psp to another with lua

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

Moderators: Shine, Insert_witty_name

Post Reply
silvio_stefa
Posts: 2
Joined: Mon Jun 16, 2008 5:06 am

how to transfer a string from a psp to another with lua

Post by silvio_stefa »

hi i'm new on this forum.
I want to make a psp program which give me the possibility to use a psp to control another one by wifi or irdata .
I've tryed a lot of time...but now i'm very nervous...

The thing wich I want to do is a program that pressed a control on the first psp send a string to the second psp which print on the screen the control pressed.

In order to do this i wrote two programs.

the ricevitor:
green = Color.new(0, 255, 0)
sfondo=Image.load("03.png")
mess="niente"
c=0


Adhoc.init()
screen:blit(0,0,sfondo)
screen.flip()
screen:print(200,110,"mess",green)

---verifica connessione ---
while c==0 do

Adhoc.connect()
c=Adhoc.getState()
screen:print(200, 100,"connessione",green)
screen.flip()


end

while true do

screen:blit(0,0,sfondo)
screen:print(200,100,mess,green)
screen.flip()

mess=0
mess=Adhoc.recv()
mess=0

pad = Controls.read()



if pad:start() then

mess="start" end

if pad:select() then
Adhoc.term()

screen:blit(100,100,el) end

if mess=="x" then
screen:blit(100,100,el) end

screen:blit(0,0,sfondo)

screen:print(200,100,mess,green)



screen.flip()


end



and the trasmettitor:




mess=0
c=0
a=0

Adhoc.init()
green = Color.new(0, 255, 0)

sfondo=Image.load("03.png")
screen:blit(0,0,sfondo)
screen.flip()
Adhoc.connect()


---verifica connessione---
while c==0 do
Adhoc.connect()
c=Adhoc.getState()
screen:print(200, 100,"connessione",green)
screen.flip()
end


while true do
a=Adhoc.getMac()
screen:blit(0,0,sfondo)

screen:print(200, 100,"premi un tasto",green)
screen:print(200, 80,"connesso!1",green)

screen:print(200, 60,a,green)

screen.flip()

pad = Controls.read()

if pad:start() then

mess="start" end

if pad:select() then
Adhoc.term()

screen:blit(100,100,el) end



if pad:up() then mess="su"

end


if pad:down() then mess= "giu"

end



if pad:r() then

mess="r"

end


if pad:l() then

mess="l"

end


if pad:cross() then
mess="x"
end

Adhoc.send(mess)
screen:blit(0,0,sfondo)
screen:print(200, 200,mess,green)
screen:print(200, 80,"connesso!1",green)
screen:print(200, 60,a,green)
screen.flip()

end






what is wrong? why this doesn't do what i want?
to run it i use lua player HM7.
where can i found a guide to the psp wifi lua function? (i didn't find one on google)

please someone help me!!!!!
sorry for my English .
thanks.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

The only info on PSP Lua Player I'm aware of is:
http://wiki.ps2dev.org/psp:lua_player:functions
silvio_stefa
Posts: 2
Joined: Mon Jun 16, 2008 5:06 am

example?

Post by silvio_stefa »

I've just seen it but i can't understand how to make a adhoc comunication between the two psp...
Do you know a place were i can find more information and example about this?
thank you
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You might try the Lua Help forum over at PSP-Programming.

http://www.psp-programming.com/forums/i ... ?board=4.0

I've only recently started looking at Lua myself, so I don't know where all the Lua people hang out. :)
Post Reply