You Are Here:

Community: Developer Discussion Boards

#1 Old Receiving Data Error in Lightblue - 2009-04-28, 20:40

Join Date: Mar 2009
Posts: 2
evolvingthought
Offline
Registered User
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
Reply With Quote

#2 Old Re: Receiving Data Error in Lightblue - 2009-04-28, 22:38

Join Date: Mar 2009
Posts: 2
evolvingthought
Offline
Registered User
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.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia