LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-26-2005, 11:16 PM   #1
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
python: full string isn't making it through socket


Hey,

I'm writing a small script in Python that is communicating with a mobile phone over Bluetooth sockets. I'm just writing AT codes to the phone but the problem I'm having is if the string is too long it chops half off and naturally that doesn't work. My goal is to be able to control MPD from anywhere in my house using my phone and that works if my playlist only contains a couple of songs. Any more than that and it doesn't work, that's not much good then.

I'm no Python expert and I haven't done any network-style stuff with it before so I was wondering if there is a way I can get it to push more data through or if it's a Bluetooth limitation in which case I need to do some research on that end of things?

Any help would be appreciated!

Thanks

edit: here is the code i'm using to write to the socket if it makes any difference:
Code:
def puts(sock, data):
  try:
    sock.send("%s\r" % data)
  except:
    logger.critical("data didn't quite make it, debugging: (d: %s)" % data)
    print "critical error, dumping tracback for someone else to fix"
    print '='*60
    traceback.print_exc(file=sys.stdout)
    print '='*60
    sys.exit(0)
  
  return

Last edited by cs-cam; 11-26-2005 at 11:19 PM.
 
Old 11-26-2005, 11:20 PM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Original Poster
Rep: Reputation: 57
Also this is how much makes it through, the rest is chopped off.
Code:
AT*EASM="Playlist",1,1,15,"Anti-Flag - Tearing Everyone Down","Anti-Flag - Captain Anarchy","Anti-Flag - A New Kind of Army","Anti-Flag - That's Youth","Anti-Flag - No Apology","Anti-Flag - Got the Numbers","Anti-Flag - No Difference","Anti-Flag - I D
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
python: converting a 3 character octal string into and ASCII char llama_meme Programming 1 07-06-2010 02:00 PM
Python: find defined text string in a file, and replace the whole line Dark Carnival Programming 6 05-22-2007 06:02 AM
convert string to integer with python Kanaflloric Programming 2 05-27-2005 11:04 AM
socket programming on-line books in python or in C pranith Programming 2 11-20-2004 10:58 AM
C making an int from a string of numbers ocularbob Programming 11 02-25-2004 02:24 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration