How do I use IB(Mac) to display text from opened tty port?

I'm using OSX10.9.4, XCode 5.1.1 etc, Mac Mini. 2012. 16GB. Fast processor.
I can open the serial/usb port and read the data from it with a [command line] tool...
sample code here.
What I'd like to be able to do is display the data that comes in live in a Graphical Interface, not as a command line tool. It also saves it to a file, and perhaps it's easier to read the continuously built file? Certainly for building historical data.
[code]
#ifdef DEBUG
    printf("Debug Mode on\n");
#endif
  fd = open(PORT, O_RDWR );
#ifdef DEBUG
  printf("...Serial port open - Return code : %d\n", fd);
#endif
  if (-1 == fd)
        perror(PORT); perror(msg); exit(-1);
  struct termios theTermios;
  memset(&theTermios, 0, sizeof(struct termios));
  cfmakeraw(&theTermios);
  cfsetspeed(&theTermios, 38400);
  theTermios.c_cflag = CREAD | CLOCAL; // turn on READ and ignore modem control lines
  theTermios.c_cflag |= CS8;
  theTermios.c_cc[VMIN] = 1;
  theTermios.c_cc[VTIME] = 0; // set to 10 if 1 sec timeout
  ret = ioctl(fd, TIOCSETA, &theTermios);
#ifdef DEBUG
  printf("opening /dev/cu.usbserial...\n");
#endif
  fd = open("/dev/cu.usbmodem14311", O_RDONLY);
#ifdef DEBUG
  printf("...Serial port open - Return code : %d\n", fd);
#endif
  if (fd < 0)
  printf("Erreur a l'ouverture de /dev/cu.usbserial - Code=%d\n", fd);
  exit(1);
#ifdef DEBUG
  printf("Serial port opened...\n");
#endif
    /* while (1) is an endless loop, unless errors develop */
    pFile=fopen(DATASTORE,"wt");
  while (1)
  ret = read(fd, &c, 1);
  if (ret == 1) {
        /*  put the incoming data into an array/structure */
[/code]
Thanks
Robert

you can do this with the firewall (ipfw) or ssh. id suggest googling those and also posting this in the UNIX forum here. Ive never attempted to do it but i know it can be done with either. which you use will depend on what you need to accomplish.

Similar Messages

  • How do i use my mac book with my HP 6510 e all in one series printer

    how do i use my mac book with HP photosmart 6510 e all in one series

    Hello Marilynatsea,
    Thanks for using Apple Support Communities.
    To learn more about printing in OS X on your Mac, and how to add a printer, take a look at the article linked to below.
    Mac Basics: Printing in OS X - Apple Support
    Cheers,
    Alex H.

  • How do I use a Mac Mini + Airport Express + Time Machine disk to backup another iMac

    How do I use a Mac Mini + Airport Express + Time Machine disk to backup another iMac?
    The question pretty much says it all.
    I have a Mac Mini with an attached 3TB Hard Drive used for Time Machine Backups.
    I have an Airport Extreme base station which services that machine plus several others.
    I would like to backup my new iMac and a MacBook Pro to the Mac Mini.
    What do I need to do on the mini to export that hard drive so that it can be used as a Time Machine target from the other systems?
    All systems are running 10.6.8.

    Well you would have to do backups over a network which is much slower and has highest chance of becoming corrupt. I think your best option would be to get an apple time capsule to act as a network and back if thats how you wanna do that

  • How can I use apps that I have purchased from Apps Store for Mac on my iPad2?

    how can I use apps that I have purchased from Apps Store for Mac on my iPad2?

    Thanks, varjak, it is too easy to fall into use of jargon assuming everyone understands what it means.
    One additional point in all of this, not all "iDevice" apps run on every "iDevice".  Some are customized for a specific device, or class of devices such as the iPod/iPhone with their smaller screen.  Others for just the iPads for their larger screens.  So the user needs to be sure they are getting an app that will work on their specific device.
    And to Phoneboone, you do need to purchase the app again if it is for a different class of equipment.  When you are looking at apps such as iWorks for the Mac and iWorks components for the iPad, the iPad versions are very inexpensive.  Pages is only $10 (US) which is really cheap for such a good word processor that reads and saves in the MS Word format.
    Anyway, search for what you need and just enjoy the convenience of so many options for apps.

  • How can I use AppleScript Studio to display an image

    How can I use AppleScript Studio to display an image in a dialog?

    Add an image well to your window in Interface Builder.
    You can also add an image file to the Resources group of your Xcode project and then set the image to be displayed inside the image well directly in Interface Builder. No AppleScript code is needed if the image is contained within your app bundle and can be set ahead of time like this.
    If the image is contained in your app's bundle but you need to set or change the image at run time then you can use a line of AppleScript to load it into the image well using just it's filename:
    set image of image view "yourImageView" of window "yourWindow" to load image "YourImageFile.jpg"
    If you need to load an image from an arbitrary location outside your app's bundle then use a path to the image file...
    set image of image view "yourImageView" of window "yourWindow" to load image "/path/to/YourImageFile.jpg"
    Steve

  • I need to publish a magazine in arabic and english - what should I buy - for how much to use 15 mac books for my students to use indesign?

    I need to publish a magazine in arabic and english - what should I buy - for how much to use 15 mac books for my students to use indesign?

    You can only return the machine if you're within 14 days of purchase - otherwise you're just 'stuck' with what you purchased (unless you sell it, of course).
    I always recommend that Retina owners order 16GB of RAM as the RAM is not upgradable - it's soldered onto the logic board.
    Your call - if you're with 14 days of purchase, take it back and exchange for a 16GB model. Or sell it and buy a model with 16GB. The higher amount of memory will allow you to run far more memory-hungry apps concurrently.
    Good luck,
    Clinton

  • How do I use a variation of the font family OPEN SANS in Adobe Edge Web Font?

    How do I use a variation of the font family OPEN SANS in Adobe Edge Web Font?
    ex:
    <scriptsrc="//use.edgefonts.net/open-sans-condensed:n3,i3,n7:all;open-sans:n3,i3,n4,i4,n6, i6,n7,i7,n8,i8:all.js">
    How do I use the i3 variation in css?
    My css looks like this: font: 16px 'open-sans-condensed';

    Thank you.
    But I want to use the [i3] variation font.
    <scriptsrc="//use.edgefonts.net/open-sans-condensed:n3,i3,n7:all;open-sans:n3,i3,n4,i4,n6, i6,n7,i7,n8,i8:all.js">
    Would look like?
    CSS Selector {
    font-family: open-sans-condensed:i3, sans-serif;
    font-size: 16px;

  • How can I use Automator to extract specific Data from a text file?

    I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
    How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
    Example of File Contents:
    Link Time =
    DD/MMM/YYYY
    Random
    Text
    161 179
    bytes of CODE    memory (+                68 range fill )
    16 789
    bytes of DATA    memory (+    59 absolute )
    1 875
    bytes of XDATA   memory (+ 1 855 absolute )
    90 783
    bytes of FARCODE memory
    What I would like to have as a final file:
    EXCEL COLUMN1
    Column 2
    Column3
    Column4
    Column5
    Column6
    MM/DD/YYYY
    filename1
    161179
    16789
    1875
    90783
    MM/DD/YYYY
    filename2
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    MM/DD/YYYY
    filename3
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!

    Hello
    You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
    set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
    use strict;
    use open IN => ':crlf';
    chdir $ARGV[0] or die qq($!);
    local $/ = qq(\\0);
    my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
    local $/ = qq(\\n);
    #     CSV spec
    #     - record separator is CRLF
    #     - field separator is comma
    #     - every field is quoted
    #     - text encoding is UTF-8
    local $\\ = qq(\\015\\012);    # CRLF
    local $, = qq(,);            # COMMA
    # print column header row
    my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
    print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    # print data row per each file
    while (@ff) {
        my $f = shift @ff;    # file path
        if ( ! open(IN, '<', $f) ) {
            warn qq(Failed to open $f: $!);
            next;
        $f =~ s%^.*/%%og;    # file name
        @dd = ('', $f, '', '', '', '');
        while (<IN>) {
            chomp;
            $dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
            ($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
            ($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
            ($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
            ($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
            last unless grep { /^$/ } @dd;
        close IN;
        print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    EOF
    Hope this may help,
    H

  • How do I use a song as the text message?

    How do I use a song as the text message?

    Nope same file types.  I just looked.
    This is similar to the app that I use.  But my app color is orange instead of blue.
    http://itunes.apple.com/us/app/ringtone-designer-pro-create/id383819300?mt=8 
    Under descriptions you'll see now for text tone - email alerts .. etc
    I also created some tones using itunes
    http://www.ehow.com/how_2160460_custom-iphone-ringtones-free.html

  • HT5616 How can I use my apple ID to buy from different app stores (different countries)?

    How can I use my apple ID to buy from different app stores (different countries)?

    You can only use a country's store if you are in that country and have a billing address in that country on your account - are you in the country that you want to buy content from ? If you are then you can update the billing address on your account to be your address there (if using a credit card then that will need to have been issued by a bank in that country) via the Store > View Account menu option on your computer's iTunes.

  • Hello, for a multilingual catalog project I would have to know how and with what tool I can place text from Excel or a database in text frames / tables. The basic idea is to provide the text box with an ID (eg text_eng_art_nr_987654 ) and above to ma

    Hello, for a multilingual catalog project I would have to know how and with what tool I can place text from Excel or a database in text frames / tables. The basic idea is to provide the text box with an ID (eg << text_eng_art_nr_987654>>) and above to make the connection. Does anyone have a tip. Thanks in advance !!!
    Bernd

    Data merge is really useful in many circumstances, but my first question would be about the size of the project. A really large catalog might be better handled by processing an IDML in some kind of translation memory tool.
    If all of your multilingual content is already in Excel, then it's probably best handled with a Data Merge. Note that you can't save Unicode CSV out of Excel for the merge, so for many languages you'll need to save "Unicode Text" out of Excel and tweak your import settings when you select a Data Source for encoding (Unicode) and delimiter (tab instead of comma).

  • How could i use my three external Display's as one Big?

    I'have an Mac Book Pro 15,4" and i would use My three external Display's as one!! How can i do that without using an Adapter? The external DIsplay's are Connectet by the two integrated Thunderbolt adapter and one is connected by the integrated HDMI adapter! Wich Application do i need? Or is it not Possible to use the thre external Display's as one?

    Thanks for your Help but i think that what i would to do does not work with Mac! Did you know the Game Crisis 3 i had see an Video on YouTube there ist somwone he use 6 Thunderbolt Display and have a Resulution fromm 4k That is what i want to do with my 3 External Display i know that i couldn't do this resulution with my thre Display's! but i had to say he use BootCamp and Windows 8 with Eyefinity from AMD! And i search an Application where i can do it ! My Driver is from NVidia and i don't find something by the NVida Homepage
    http://www.youtube.com/watch?feature=player_detailpage&v=WmlsePKH6AY

  • How do i use my .mac email with iCloud?

    I had a .mac account with mobile me which i switched over to iCloud when prompted. I just receently bought a brand new iMac and want to use my .mac email in the apple Mail program but it's not working. I'm assuming the "type" of email is iCloud. Any suggestions on how to get it up and running?

    Don't try to set it up in the Mail program. Go to System Preferences>iCloud and sign in with your @me.com email address. Check Mail in the checklist there, and any other data types you want to sync.  Mail will be set up automatically and both the @me.com and @mac.com versions of your address should work.

  • How can I use my 23" cinema display with a pc laptop?

    I see various questions out there about using Apple Cinema Displays and PCs, but each one has its own twist. If anybody can help with this scenario, I'd greatly appreciate it.
    I use one of the last editions of the Powerbook G4. I just bought a 23" Cinema Display and, of course, love it. It is supposed to replace an old CRT monitor in the home office, which brings me to my problem. Can I hook up a pc laptop to use with the Cinema Display (I ocassionally need the pc laptop and my wife and kid use it as well). I realize it will depend on the graphics card. Offhand I'm not sure which one it is, but the Dell is just shy of a year old and has good graphics, albeit VGA. I need a female DVI (I assume DVI-I) and a male VGA connector. Do these exist? I'm also looking for a PC Card DVI-I graphics card, but I don't know if these exist either.
    I could buy a Dell (or some other brand) monitor that has both DVI and VGA connections, but I really want to keep the Cinema Display. It's gorgeous.
    Thanks for any help.
    Regards.
    Powerbook G4 15" Mac OS X (10.4.5) 23" Cinema Display

    Phil,
    Thank you for the reply. I kind of figured this was the case. I have found two "boxes" that supposedly handle this problem. One is from Dr. Botts called Vgator and the other is from Gefen (www.gefen.com), but these solutions are very expensive -- $300 each -- and I am not certain of the quality of the picture. For that kind of money, I could buy a cheap PC monitor and just use the Cinema Display for Mac-only needs, as it was intended.
    Take care.
    Dan.

  • How can I use my Mac OS X for the next time

    Dear sir,
    Please, I need your help about Mac OS X and how can I use the OS for the next time I mean when I'm going to format my computer or to use for the another computer.
    By the way... I already installed the Mac OS X to my MacBook Pro so please I'm waiting for you advice.
    Mohammed Hussein

    Hi,
    He bought the iMac two years after mine.
    Would his Mac still be under warranty? It sounds like it is about only a year old and so may be still eligible for phone support, though that may depend on having nearby access to an Apple Tech support.
    He could get a replacement disk sent to him as well. The cost,  I don't know.
    Your disk would probably work, but you don't need to burn one; just use yours. If you are in two locations, then it would be better for Apple to mail him a replacement disk for his particular Mac.

Maybe you are looking for

  • Get bind variables of a dynamic view object

    I seem unable to retrieve the bind variables for a dynamically created view object, even though I can do the same thing for a regular view object. Here is the code: newVO = repServ.createViewObjectFromQueryStmt("newQry",strSql); VariableValueManager

  • Error at the time of Release and Save the WBS

    Dear All,       When i am going to release and save the project the below error has occurred. Error-Release not allowed as budget is not allocated to the project. Project will be exited and data changes will not be saved! But, i have budgeted the WBS

  • Illustrator cc crash on lounch (win8.1)

    illustrator cc crash on launch no error report (see picture) https://www.dropbox.com/s/dcfy1603cy4cq4s/ill_crash.png Windows 8.1 (russian language) Illustrator cc (English international) I updated windows, updated Illustrator reinstalled illustrator

  • CS5 student version

    Hello everybody, I've just bought the Adobe Master Collection CS5 for Teachers and Students. I am student a I have just created my company. I read that we can use this licence for a "commercial use". Does it mean that I can use it with my company too

  • SUBWOOFER ON dELL E310 HAS GONE OUT TO LUNCH WITH ADOBE FLASH PLAYER 10.3.181.34

    We updated our Adobe Flash Player software to version 10.3.181.34 and now out subwoofer doesn't want to work. We are running a Dell E310  PC that has Dell A425 30 watt 2.1  speakers with a subwoofer [cn-0w8037-71623-58H-2013  rev A00.] The stereo spe