Page 4 of 4 FirstFirst 1234
Results 31 to 40 of 40
Discuss trying to use the serial port at the Free Toolchain Software (Cydia App's) - Hackint0sh.org; TheRain: so far they all worked, i have: -A Car Kit made by Dension -A ...
  1. #31
    Senior Professional Array

    Join Date
    Sep 2007
    Location
    Germany, Europe :)
    Posts
    199
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    17

    Default

    TheRain:
    so far they all worked, i have:
    -A Car Kit made by Dension
    -A Kensington FM-RDS Transmitter
    -A Logitech Boom-Boom Box

    The iPhone always complains but works :-)
    If the Acc. tries to display something on the ipod screen ( like the FM Transmiter normally shows the chosen Frequency ) the iPhone simply ignores.
    So i set up the FM Transmitter and the Car Kit with my wifes ipod and now use it on the iPhone...

    cheaptec:
    You're welcome :-)


    Greetings,

    Ender


  2. #32
    Advanced Array

    Join Date
    Oct 2007
    Posts
    47
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Hi folks, my serial controller is not quite together yet. So tomorrow or Sunday I will make a more basic PC to Iphone serial demo and explain how it works so as to not keep people waiting. I'd love to see what cool things people do with serial port access anyway, so I want to release the details soon

  3. #33
    Rookie Array

    Join Date
    Sep 2007
    Posts
    28
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    WAOUW cant wait to have a gamepad to play gba and incoming psx emu

  4. #34
    Newbie Array

    Join Date
    Nov 2007
    Posts
    7
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by TheRain View Post
    Hi folks, my serial controller is not quite together yet. So tomorrow or Sunday I will make a more basic PC to Iphone serial demo and explain how it works so as to not keep people waiting. I'd love to see what cool things people do with serial port access anyway, so I want to release the details soon
    Hello TheRain

    Waiting for your demo.
    If you want, I can test it for iPod Touch (i should be the same as with the iPhone).
    Don't hesitate to post details.

    Thank you

  5. #35
    Advanced Array

    Join Date
    Mar 2007
    Posts
    31
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by doudoo View Post
    WAOUW cant wait to have a gamepad to play gba and incoming psx emu
    ++ this is super exciting. Is there a project page for this somewhere so we can keep track and donate?


  6. #36
    iPhone DevTeam Array

    Join Date
    Aug 2007
    Location
    Always sunny Los Angeles, California
    Posts
    421
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    34

  7. #37
    Advanced Array

    Join Date
    Oct 2007
    Posts
    47
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Oh yah, sorry for the confusion- I made a separate thread here http://www.hackint0sh.org/forum/showthread.php?t=18904

  8. #38
    Newbie Array

    Join Date
    Mar 2009
    Posts
    1
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I am trying to use iPhone serial port.
    I saw that my iPhone gets input from my computer through pin 13 when I opened /dev/tty.iap in minicom.
    I was trying to access /dev/tty.iap in my app but i couldn't open it. My app could open /dev/tty/s001 and /dev/ttys002 but how do I get the input with this serial port? do I have to put some resistor in pin 21?

    I'd really appreciate your advice.

  9. #39
    Rookie Array

    Join Date
    Jul 2007
    Posts
    10
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    kakooyang,

    are you using the open toolchain or the apple sdk? i am using the serial port in my project and i am using the sdk for my application. the only way for me to open the serial port for RW operation is to jailbreak the phone and put my app manually (using ssh) into /Applications. if i leave my app within the sandbox, i cannot open the serial port for RW.

    my serial open routine looks like this:

    Code:
    #define SERIAL_PORT "/dev/tty.iap"
    
    static struct termios gOriginalTTYAttrs;
    
    int openSerialPort()
    {
       int    fileDescriptor = -1;
       struct termios  options;
       
       // Open the serial port read/write, with no controlling terminal, and don't wait for a connection.
       // The O_NONBLOCK flag also causes subsequent I/O on the device to be non-blocking.
       // See open(2) ("man 2 open") for details.
       
       fileDescriptor = open(SERIAL_PORT, O_RDWR | O_NOCTTY | O_NONBLOCK);
       if (fileDescriptor == -1)
       {
          printf("Error opening serial port %s - %s(%d).\n", SERIAL_PORT, strerror(errno), errno);
          goto error;
       }
       
       // Note that open() follows POSIX semantics: multiple open() calls to the same file will succeed
       // unless the TIOCEXCL ioctl is issued. This will prevent additional opens except by root-owned
       // processes.
       // See tty(4) ("man 4 tty") and ioctl(2) ("man 2 ioctl") for details.
       
       if (ioctl(fileDescriptor, TIOCEXCL) == -1)
       {
          printf("Error setting TIOCEXCL on %s - %s(%d).\n", SERIAL_PORT, strerror(errno), errno);
          goto error;
       }
       
       // Now that the device is open, clear the O_NONBLOCK flag so subsequent I/O will block.
       // See fcntl(2) ("man 2 fcntl") for details.
       
       if (fcntl(fileDescriptor, F_SETFL, 0) == -1)
       {
          printf("Error clearing O_NONBLOCK %s - %s(%d).\n", SERIAL_PORT, strerror(errno), errno);
          goto error;
       }
       
       // Get the current options and save them so we can restore the default settings later.
       if (tcgetattr(fileDescriptor, &gOriginalTTYAttrs) == -1)
       {
          printf("Error getting tty attributes %s - %s(%d).\n", SERIAL_PORT, strerror(errno), errno);
          goto error;
       }
       
       // The serial port attributes such as timeouts and baud rate are set by modifying the termios
       // structure and then calling tcsetattr() to cause the changes to take effect. Note that the
       // changes will not become effective without the tcsetattr() call.
       // See tcsetattr(4) ("man 4 tcsetattr") for details.
       
       options = gOriginalTTYAttrs;
       
       // Print the current input and output baud rates.
       // See tcsetattr(4) ("man 4 tcsetattr") for details.
       
       //printf("Current input baud rate is %d\n", (int) cfgetispeed(&options));
       //printf("Current output baud rate is %d\n", (int) cfgetospeed(&options));
       
       // Set raw input (non-canonical) mode, with reads blocking until either a single character
       // has been received or a one second timeout expires.
       // See tcsetattr(4) ("man 4 tcsetattr") and termios(4) ("man 4 termios") for details.
       
       cfmakeraw(&options);
       options.c_cc[VMIN] = 1;
       options.c_cc[VTIME] = 10;
       
       // The baud rate, word length, and handshake options can be set as follows:
       cfsetspeed(&options, B57600); //NOTE: iphone doesn't like rates above 57600
       options.c_cflag |= CS8; // RTS flow control of input
       
       printf("baud rate @ %d\n", (int) cfgetispeed(&options));
       
       // Cause the new options to take effect immediately.
       if (tcsetattr(fileDescriptor, TCSANOW, &options) == -1)
       {
          printf("Error setting tty attributes %s - %s(%d).\n", SERIAL_PORT, strerror(errno), errno);
          goto error;
       }
       
       // Success
       return fileDescriptor;
       
       // Failure SERIAL_PORT
    error:
       if (fileDescriptor != -1)
       {
          close(fileDescriptor);
       }
       
       return -1;
    }

  10. #40
    Newbie Array

    Join Date
    Feb 2010
    Posts
    1
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I would like to learn if this can be accomplished given these variables

    - an iPod Touch 8GB MC model
    - 3.1.x OS (or 2.2.x OS, but I don't think the 8GB MC can run 2.2.x)
    - jailbroken plus any other necessary changes (iapd hacking?)
    - resistor of X value attached on dock connector

    Having googled a great many threads on this topic, I haven't seen one that came out conclusively saying "Yes you can do it on iPod touch 2009 8GB with OS 3.1.2".

    A case of your favorite fizzy beverage to anyone who can help me get this working. I'd prefer not to have to write a soft-modem for the audio lines!


    Quote Originally Posted by iphonejoe View Post
    kakooyang,

    are you using the open toolchain or the apple sdk? i am using the serial port in my project and i am using the sdk for my application. the only way for me to open the serial port for RW operation is to jailbreak the phone and put my app manually (using ssh) into /Applications. if i leave my app within the sandbox, i cannot open the serial port for RW.

    my serial open routine looks like this:

    Code:
    #define SERIAL_PORT "/dev/tty.iap"
    
    static struct termios gOriginalTTYAttrs;
    
    int openSerialPort()
    {
       int    fileDescriptor = -1;
       struct termios  options;
       
       // Open the serial port read/write, with no controlling terminal, and don't wait for a connection.
       // The O_NONBLOCK flag also causes subsequent I/O on the device to be non-blocking.
       // See open(2) ("man 2 open") for details.
       
       fileDescriptor = open(SERIAL_PORT, O_RDWR | O_NOCTTY | O_NONBLOCK);
       if (fileDescriptor == -1)
       {
          printf("Error opening serial port %s - %s(%d).\n", SERIAL_PORT, strerror(errno), errno);
          goto error;
       }
       
       // Note that open() follows POSIX semantics: multiple open() calls to the same file will succeed
       // unless the TIOCEXCL ioctl is issued. This will prevent additional opens except by root-owned
       // processes.
       // See tty(4) ("man 4 tty") and ioctl(2) ("man 2 ioctl") for details.
       
       if (ioctl(fileDescriptor, TIOCEXCL) == -1)
       {
          printf("Error setting TIOCEXCL on %s - %s(%d).\n", SERIAL_PORT, strerror(errno), errno);
          goto error;
       }
       
       // Now that the device is open, clear the O_NONBLOCK flag so subsequent I/O will block.
       // See fcntl(2) ("man 2 fcntl") for details.
       
       if (fcntl(fileDescriptor, F_SETFL, 0) == -1)
       {
          printf("Error clearing O_NONBLOCK %s - %s(%d).\n", SERIAL_PORT, strerror(errno), errno);
          goto error;
       }
       
       // Get the current options and save them so we can restore the default settings later.
       if (tcgetattr(fileDescriptor, &gOriginalTTYAttrs) == -1)
       {
          printf("Error getting tty attributes %s - %s(%d).\n", SERIAL_PORT, strerror(errno), errno);
          goto error;
       }
       
       // The serial port attributes such as timeouts and baud rate are set by modifying the termios
       // structure and then calling tcsetattr() to cause the changes to take effect. Note that the
       // changes will not become effective without the tcsetattr() call.
       // See tcsetattr(4) ("man 4 tcsetattr") for details.
       
       options = gOriginalTTYAttrs;
       
       // Print the current input and output baud rates.
       // See tcsetattr(4) ("man 4 tcsetattr") for details.
       
       //printf("Current input baud rate is %d\n", (int) cfgetispeed(&options));
       //printf("Current output baud rate is %d\n", (int) cfgetospeed(&options));
       
       // Set raw input (non-canonical) mode, with reads blocking until either a single character
       // has been received or a one second timeout expires.
       // See tcsetattr(4) ("man 4 tcsetattr") and termios(4) ("man 4 termios") for details.
       
       cfmakeraw(&options);
       options.c_cc[VMIN] = 1;
       options.c_cc[VTIME] = 10;
       
       // The baud rate, word length, and handshake options can be set as follows:
       cfsetspeed(&options, B57600); //NOTE: iphone doesn't like rates above 57600
       options.c_cflag |= CS8; // RTS flow control of input
       
       printf("baud rate @ %d\n", (int) cfgetispeed(&options));
       
       // Cause the new options to take effect immediately.
       if (tcsetattr(fileDescriptor, TCSANOW, &options) == -1)
       {
          printf("Error setting tty attributes %s - %s(%d).\n", SERIAL_PORT, strerror(errno), errno);
          goto error;
       }
       
       // Success
       return fileDescriptor;
       
       // Failure SERIAL_PORT
    error:
       if (fileDescriptor != -1)
       {
          close(fileDescriptor);
       }
       
       return -1;
    }


 

 
Page 4 of 4 FirstFirst 1234

Similar Threads

  1. Serial Port
    By Sheerz in forum Kernel / Kext (Driver) Support
    Replies: 1
    Last Post: 03-25-2010, 12:28 AM
  2. serial port problems
    By netboy in forum Installation
    Replies: 0
    Last Post: 03-02-2010, 06:10 PM
  3. Serial Port Input Assistance
    By damagedpunk in forum iPhone Developer Exchange
    Replies: 1
    Last Post: 01-13-2010, 12:49 PM
  4. Serial Port access
    By SierraDog in forum iPod Touch 2G
    Replies: 0
    Last Post: 07-27-2009, 11:30 PM
  5. Bluetooth Serial Port Protocol?
    By burkferden in forum iOS 3.x (iPhone OS 3.x)
    Replies: 0
    Last Post: 07-27-2009, 01:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 07:21 AM.
twitter, follow us!