PageRenderTime 102ms CodeModel.GetById 40ms app.highlight 1ms RepoModel.GetById 59ms app.codeStats 1ms

/android-sercd/project/jni/android.h

http://android-serialport-api.googlecode.com/
C++ Header | 43 lines | 16 code | 6 blank | 21 comment | 0 complexity | 2469e0bee82a2a92a97726c8cf69339b MD5 | raw file
 1/*
 2    sercd: RFC 2217 compliant serial port redirector
 3    Copyright 2003-2008 Peter ─é┬ůstrand <astrand@cendio.se> for Cendio AB
 4    Copyright (C) 1999 - 2003 InfoTecna s.r.l.
 5    Copyright (C) 2001, 2002 Trustees of Columbia University
 6    in the City of New York
 7
 8    This program is free software; you can redistribute it and/or modify
 9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#ifndef _ANDROID_H_
24#define _ANDROID_H_
25#ifdef ANDROID
26
27#include <jni.h>
28
29#define exit(code) { \
30	char msg[64]; \
31	sprintf(msg, "Exiting at %d", __LINE__); \
32	LogMsg(LOG_ERR, msg); \
33	return code; \
34}
35
36typedef enum {
37	STATE_READY, STATE_CONNECTED, STATE_PORT_OPENED, STATE_STOPPED, STATE_CRASHED
38} ProxyState;
39
40void ChangeState(JNIEnv *env, jobject thiz, ProxyState newstate);
41
42#endif /* ANDROID */
43#endif /* _ANDROID_H_ */