blob: a66cb88c6f6208712f3b46e6952a10180f34f2e1 [file] [log] [blame]
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -08001/* 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"
David 'Digit' Turnere7216d82013-12-15 00:51:13 +010014#include "sysemu/char.h"
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080015
16CharDriverState* android_gps_cs;
17
18#define D(...) VERBOSE_PRINT(gps,__VA_ARGS__)
19
20void
21android_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