silvio_stefa
Joined: 16 Jun 2008 Posts: 2
|
Posted: Mon Jun 16, 2008 5:35 am Post subject: how to transfer a string from a psp to another with lua |
|
|
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. |
|