My platform is nokia n85, s60, 3rd edition.
I tried to build an application, I build a bluetooh serial port communication. When mobile phone receive a data, let's say "THT", the application will pop up a note "receive data: THT".
I use, socket module, socket.recv() to receive the data. It seems it is working.
I need to receive the data all the time. Means when the client send a data, mobile phone should pop up the note.
The problem A is I can not always run socket.recv() cause I have other functions. Problem B is when socket.recv() is always running, it halt when pys60 doesn't receive the data.
import btsocket as socket
appuifw.app.screen = "normal"
#define a bluetooth connection
if not target:
print "Discovered: %s, %s"%(address,services)
for x in choices],u'Choose port:')
print "Connecting to "+str(target)
appuifw.note(u"Other function is running", "info")
#difine exit function
# create an Active Object
app_lock = e32.Ao_lock()
# set the title of the script
appuifw.app.title = u'BLUE CONTROLL'
appuifw.app.exit_key_handler = exit_key_handler
#this section to receive the data, all the time
# problem a
data_recv = sock.recv(4)
appuifw.note(u"receive data:"+str(data_recv), "info")
#this function has no chance to run when problem a is not solved
So, my questions,
how pys60 knows when mobile receive a data?
how to receive data continuslly when other functions are running, means without run socket.recv() all the time?
many thanks in advance.