| Reply | « Previous Thread | Next Thread » |
|
Hi,
I've been attempting to make a simple bluetooth connection between two n95's running s60 third edition to no avail. After frustrating attempts with the basic pys60 sockets I decided to enlist the lightblue api. This works a bit better (the devices connect), but the 'server' device errors when receiving data. The error I get is: File "C;/etc." line 60 in ? conn.recv(1024) File "<string>", line 2, in recv File "c:\resource\socket.py", line 353, in recv data = self._sock.recv[n, f, cb] error:[0, 'Error'] and the code: import socket, lightblue, e32, appuifw SERVER, CLIENT = 0, 1 addr = "00:1E:3A:23:53:0D" port = 5 mode = appuifw.popup_menu([u"Receive", u"Sender"], u"Which are you?") if mode == SERVER: s = lightblue.socket() s.bind(("", port)) # bind to 0 to bind to dynamically assigned port print "waiting for client" s.listen(1) lightblue.advertise("My RFCOMM Service", s, lightblue.RFCOMM) conn, addr = s.accept() print "Connected by", addr conn.recv(1024) conn.close() elif mode == CLIENT: s = lightblue.socket() s.connect((addr, port)) s.send("hello") print "sent hello" s.close() I'd really appreciate any help in getting this resolved, or if you've had a similar problem to try and identify the reason behind it. This is the first time I've posted to the Nokia forum and I'm new to python and symbian60, go easy on me... Thanks |
| evolvingthought |
| View Public Profile |
| Find all posts by evolvingthought |
|
I found that the socket variable name was the same as another variable in another part of the code. Just underlines the importance of meaningful variable names.
|
| evolvingthought |
| View Public Profile |
| Find all posts by evolvingthought |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Problem In receiving data in mobile client sent from pc server via bluetooth | vaids | Bluetooth Technology | 3 | 2008-09-09 05:53 |
| suckho, i have encontered the same problems. Could you tell me how you resolved it? | dicson_hu | Symbian Networking & Messaging | 4 | 2005-12-09 11:56 |
| How to switch on bluetooth and receiving data from other s60 phone by an mobi app | rishvn | Mobile Java Tools & SDKs | 0 | 2005-02-25 11:09 |
| Clarifications on User Data, User Data Binary and User Data Header | saijee | General Messaging | 2 | 2004-09-15 23:47 |
| 6360 not receiving or transferrng data but ird is connected | mortgagehelper | PC Suite API and PC Connectivity SDK | 1 | 2002-08-15 13:41 |