PageRenderTime 25ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/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
Possible License(s): GPL-2.0
  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. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. #ifndef _ANDROID_H_
  20. #define _ANDROID_H_
  21. #ifdef ANDROID
  22. #include <jni.h>
  23. #define exit(code) { \
  24. char msg[64]; \
  25. sprintf(msg, "Exiting at %d", __LINE__); \
  26. LogMsg(LOG_ERR, msg); \
  27. return code; \
  28. }
  29. typedef enum {
  30. STATE_READY, STATE_CONNECTED, STATE_PORT_OPENED, STATE_STOPPED, STATE_CRASHED
  31. } ProxyState;
  32. void ChangeState(JNIEnv *env, jobject thiz, ProxyState newstate);
  33. #endif /* ANDROID */
  34. #endif /* _ANDROID_H_ */