From 11fbcf5e30e0cd09f2d6b448911d2ef62b7f29c7 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Tue, 11 Sep 2012 22:48:04 -0500 Subject: Added the feature to AC to default --with-android to $ANDROID_SDK (if set) Fixed typos in altosui/Makefile.am (had removed JCOMMON, but it's from AC) Jenkins changes: - added android sdk - will now record artifacts: altoslib/AltosLib.jar,altosui/altosui.jar,**/*.apk --- altosui/Makefile.am | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 9f75d5e3..04820294 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -6,7 +6,7 @@ man_MANS=altosui.1 altoslibdir=$(libdir)/altos -CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH=".:classes:../altoslib/*:libaltos::$(JFREECHART)/jfreechart.jar:$(FREETTS)/freetts.jar" +CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH=".:classes:../altoslib/*:libaltos:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar:$(FREETTS)/freetts.jar" bin_SCRIPTS=altosui diff --git a/configure.ac b/configure.ac index 8ce94180..8b002662 100644 --- a/configure.ac +++ b/configure.ac @@ -72,7 +72,7 @@ AC_SUBST(JVM_INCLUDE) AC_ARG_WITH(android, AS_HELP_STRING([--with-android=PATH], [Set android SDK path (default searches in a variety of places)]), - [ANDROID_SDK=$withval], [ANDROID_SDK=auto]) + [ANDROID_SDK=$withval], [ANDROID_SDK=${ANDROID_SDK:-auto}]) echo ANDROID_SDK set to $ANDROID_SDK -- cgit v1.2.3 From 1a154ce0b9fc3ea360d6bc7e17d6debb2da94438 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 11 Sep 2012 22:03:17 -0700 Subject: Include AltosLib.jar in windows install Otherwise, altosui doesn't do much. Signed-off-by: Keith Packard --- altosui/altos-windows.nsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/altosui/altos-windows.nsi b/altosui/altos-windows.nsi index 986919d4..20dd65f0 100644 --- a/altosui/altos-windows.nsi +++ b/altosui/altos-windows.nsi @@ -88,6 +88,7 @@ Section "AltosUI Application" SetOutPath $INSTDIR File "altosui-fat.jar" + File "AltosLib.jar" File "cmudict04.jar" File "cmulex.jar" File "cmu_time_awb.jar" @@ -157,6 +158,9 @@ Section "Uninstall" Delete "$INSTDIR\*.*" RMDir "$INSTDIR" + ; Remove .inf file + Delete "$WINDIR\Inf\telemetrum.inf" + ; Remove devices InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial InstDrv::DeleteOemInfFiles /NOUNLOAD @@ -165,4 +169,5 @@ Section "Uninstall" ; Remove shortcuts, if any Delete "$SMPROGRAMS\AltusMetrum.lnk" Delete "$DESKTOP\AltusMetrum.lnk" + SectionEnd -- cgit v1.2.3 From 3fa5fbdfd1ab257028f272fbc32759b39608ddaf Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 11 Sep 2012 23:04:19 -0700 Subject: Clean up Windows event handles on com port close This avoids having to wait for the receiver to timeout before we can open the same com port again. This patch also adds a bit more debugging -- it prints Windows error messages to stdout along with the file/line where the error was generated. Signed-off-by: Keith Packard --- altosui/libaltos/libaltos.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/altosui/libaltos/libaltos.c b/altosui/libaltos/libaltos.c index 515432f9..ab6ca878 100644 --- a/altosui/libaltos/libaltos.c +++ b/altosui/libaltos/libaltos.c @@ -941,7 +941,7 @@ struct altos_file { }; static void -altos_set_last_windows_error(void) +_altos_set_last_windows_error(char *file, int line) { DWORD error = GetLastError(); TCHAR message[1024]; @@ -952,9 +952,13 @@ altos_set_last_windows_error(void) message, sizeof (message) / sizeof (TCHAR), NULL); + if (error != ERROR_SUCCESS) + printf ("%s:%d %s\n", file, line, message); altos_set_last_error(error, message); } +#define altos_set_last_windows_error() _altos_set_last_windows_error(__FILE__, __LINE__) + PUBLIC struct altos_list * altos_list_start(void) { @@ -1161,6 +1165,7 @@ altos_flush(struct altos_file *file) if (!WriteFile(file->handle, data, used, &put, &file->ov_write)) { if (GetLastError() != ERROR_IO_PENDING) { altos_set_last_windows_error(); + printf ("\tflush write error\n"); return LIBALTOS_ERROR; } ret = WaitForSingleObject(file->ov_write.hEvent, INFINITE); @@ -1168,11 +1173,13 @@ altos_flush(struct altos_file *file) case WAIT_OBJECT_0: if (!GetOverlappedResult(file->handle, &file->ov_write, &put, FALSE)) { altos_set_last_windows_error(); + printf ("\tflush result error\n"); return LIBALTOS_ERROR; } break; default: altos_set_last_windows_error(); + printf ("\tflush wait error\n"); return LIBALTOS_ERROR; } } @@ -1188,7 +1195,6 @@ altos_open(struct altos_device *device) { struct altos_file *file = calloc (1, sizeof (struct altos_file)); char full_name[64]; - DCB dcbSerialParams = {0}; COMMTIMEOUTS timeouts; if (!file) @@ -1201,6 +1207,7 @@ altos_open(struct altos_device *device) FILE_FLAG_OVERLAPPED, NULL); if (file->handle == INVALID_HANDLE_VALUE) { altos_set_last_windows_error(); + printf ("cannot open %s\n", full_name); free(file); return NULL; } @@ -1214,24 +1221,6 @@ altos_open(struct altos_device *device) timeouts.WriteTotalTimeoutConstant = 0; SetCommTimeouts(file->handle, &timeouts); - dcbSerialParams.DCBlength = sizeof(dcbSerialParams); - if (!GetCommState(file->handle, &dcbSerialParams)) { - altos_set_last_windows_error(); - CloseHandle(file->handle); - free(file); - return NULL; - } - dcbSerialParams.BaudRate = CBR_9600; - dcbSerialParams.ByteSize = 8; - dcbSerialParams.StopBits = ONESTOPBIT; - dcbSerialParams.Parity = NOPARITY; - if (!SetCommState(file->handle, &dcbSerialParams)) { - altos_set_last_windows_error(); - CloseHandle(file->handle); - free(file); - return NULL; - } - return file; } @@ -1241,6 +1230,10 @@ altos_close(struct altos_file *file) if (file->handle != INVALID_HANDLE_VALUE) { CloseHandle(file->handle); file->handle = INVALID_HANDLE_VALUE; + SetEvent(file->ov_read.hEvent); + SetEvent(file->ov_write.hEvent); + CloseHandle(file->ov_read.hEvent); + CloseHandle(file->ov_write.hEvent); } } -- cgit v1.2.3