Changeset ca97cad in mainline for uspace/app/test_serial/test_serial.c


Ignore:
Timestamp:
2010-05-06T11:42:55Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ab1aa871
Parents:
ba95e8f
Message:

writing to serial port using character interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/test_serial/test_serial.c

    rba95e8f rca97cad  
    4545#include <devman.h>
    4646#include <device/char.h>
     47#include <string.h>
    4748
    4849#define NAME            "test serial"
     
    104105                if (read > 0) {                 
    105106                        buf[read] = 0;
    106                         printf(buf);           
     107                        printf(buf);   
     108                        // write data back to the device to test the opposite direction of data transfer
     109                        write_dev(phone, buf, read);
    107110                } else {       
    108111                        usleep(100000);                 
    109112                }       
    110113        }
     114       
     115        char *the_end = "\n---------\nTHE END\n---------\n";
     116        write_dev(phone, the_end, str_size(the_end));
    111117       
    112118        devman_hangup_phone(DEVMAN_CLIENT);
Note: See TracChangeset for help on using the changeset viewer.