Home | History | Annotate | Download | only in android
      1 /* Copyright (C) 2007-2008 The Android Open Source Project
      2 **
      3 ** This software is licensed under the terms of the GNU General Public
      4 ** License version 2, as published by the Free Software Foundation, and
      5 ** may be copied, distributed, and modified under those terms.
      6 **
      7 ** This program is distributed in the hope that it will be useful,
      8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
      9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     10 ** GNU General Public License for more details.
     11 */
     12 #include "android/gps.h"
     13 #include "android/utils/debug.h"
     14 #include "qemu-char.h"
     15 
     16 CharDriverState*   android_gps_cs;
     17 
     18 #define  D(...)  VERBOSE_PRINT(gps,__VA_ARGS__)
     19 
     20 void
     21 android_gps_send_nmea( const char*  sentence )
     22 {
     23     if (sentence == NULL)
     24         return;
     25 
     26     D("sending '%s'", sentence);
     27 
     28     if (android_gps_cs == NULL) {
     29         D("missing GPS channel, ignored");
     30         return;
     31     }
     32 
     33     qemu_chr_write( android_gps_cs, (const void*)sentence, strlen(sentence) );
     34     qemu_chr_write( android_gps_cs, (const void*)"\n", 1 );
     35 }
     36 
     37 
     38