ccomx-develop Mailing List for CCOM - a lib for serial port interface
Brought to you by:
chrisan,
rasmusmyklebust
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(7) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
|
Feb
(62) |
Mar
|
Apr
|
May
(4) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(4) |
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
|
3
|
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
|
18
(4) |
19
|
20
|
21
(4) |
22
|
23
|
24
|
|
25
|
26
|
27
|
28
|
29
|
30
|
|
|
From: Christer S. <ch...@us...> - 2005-09-21 18:12:20
|
Update of /cvsroot/ccomx/ccom/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15326/docs Modified Files: ccom._tx changes._tx readme._tx Log Message: fixed bug 1297991 Index: ccom._tx =================================================================== RCS file: /cvsroot/ccomx/ccom/docs/ccom._tx,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ccom._tx 8 Nov 2004 21:16:37 -0000 1.7 --- ccom._tx 21 Sep 2005 18:12:08 -0000 1.8 *************** *** 6,10 **** @# @multiwordheaders ! @manh="version 0.9.2" "CCOM" "Manual" @document_title=CCOM Manual @rtfh=CCOM - an add on lib to CGUI for accessing the serial ports --- 6,10 ---- @# @multiwordheaders ! @manh="version 0.9.3" "CCOM" "Manual" @document_title=CCOM Manual @rtfh=CCOM - an add on lib to CGUI for accessing the serial ports *************** *** 32,36 **** <center>Homepage: <a href="http://www.idt.mdh.se/~csg/cgui/cguix">http://www.idt.mdh.se/~csg/cgui/cguix</a></center> <center><b> ! The Manual of CCOM 0.9.2 </b></center> @!text --- 32,36 ---- <center>Homepage: <a href="http://www.idt.mdh.se/~csg/cgui/cguix">http://www.idt.mdh.se/~csg/cgui/cguix</a></center> <center><b> ! The Manual of CCOM 0.9.3 </b></center> @!text Index: readme._tx =================================================================== RCS file: /cvsroot/ccomx/ccom/docs/readme._tx,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** readme._tx 18 Sep 2005 18:33:53 -0000 1.7 --- readme._tx 21 Sep 2005 18:12:09 -0000 1.8 *************** *** 72,76 **** Installation goes in some simple steps, and should be familiar since it is ! similar to the installation procedure as of Allegro and CGUI: <ul> <li> --- 72,76 ---- Installation goes in some simple steps, and should be familiar since it is ! similar to the installation procedure as of CGUI: <ul> <li> *************** *** 87,91 **** fix.bat mingw32 - to compile with Windows/MinGW32 fix.bat msvc - to compile with Windows/MSVC ! ./fix.sh unix - to compile with Linux/gcc </pre> <li> --- 87,91 ---- fix.bat mingw32 - to compile with Windows/MinGW32 fix.bat msvc - to compile with Windows/MSVC ! ./fix.sh unix - to compile with Linux/gcc </pre> <li> *************** *** 101,105 **** export ALLEGRO=/home/user/allegro-4.0.3 </pre> ! or whatever is the name of your allegro directory. <li> Specify the path to your CGUI installation by setting the environment --- 101,110 ---- export ALLEGRO=/home/user/allegro-4.0.3 </pre> ! or whatever is the name of your allegro directory.<br> ! When CCOM is built some programs in the `tools' directory of Allegro will be ! needed, so you have to install an Allegro version built from sources (or ! alternatively obtain the required tools some other way, put them in a ! directory named `tools' and let the variable ALLEGRO point out the directory ! immediately above `tools'). <li> Specify the path to your CGUI installation by setting the environment *************** *** 129,138 **** Compile the library. This is done by running "make" at the command line. <li> ! Install the files to common directories. This is done by running "make install" at the command line.<br> ! Under Linux, you may want to instead run "make install SYSTEM_DIR=<dir>", ! which will cause headers to be installed to <dir>/include and libraries to ! <dir>/lib. (default for <dir> is /usr/local), or else you need to ! run make install as root. </ul> That's it! Now you are ready to run the example program in the example directory. --- 134,153 ---- Compile the library. This is done by running "make" at the command line. <li> ! Install the CCOM files to common directories. This is done by running "make install" at the command line.<br> ! Linux/Unix specifics:<br> ! You need to be root to succeed with the installation command i.e. type the ! command<br> ! <pre> ! su -c "make install" ! </pre> ! and enter the root password when prompted for.<br> ! Alternatively, if you cannot be root you may install CCOM to some other ! location by running "make install SYSTEM_DIR=<dir>", which will cause ! headers to be installed to <dir>/include and libraries to ! <dir>/lib. Default for <dir> is /usr/local.<br> ! To be able to link your program to the CCOM files installed at some other ! location than the default you need to specifiy the paths to your compiler ! and linker. </ul> That's it! Now you are ready to run the example program in the example directory. *************** *** 156,160 **** the static versions of Allegro and CGUI. <li> ! Users of the MSys environment needs to set teh environment vaariable UNIX_TOOLS to 1 before make install is run. <li> --- 171,175 ---- the static versions of Allegro and CGUI. <li> ! Users of the MSys environment needs to set the environment vaariable UNIX_TOOLS to 1 before make install is run. <li> *************** *** 163,170 **** and add "ccom" after the existing "libc" entry (separated by a space). <li> ! To use the ! To use the debugging library, link with libccomd.a instead of libccom.a. </ul> @heading --- 178,189 ---- and add "ccom" after the existing "libc" entry (separated by a space). <li> ! To link your application with the debugging lib, link with -lccomd ! instead of -lccom. </ul> + @heading + MSys + Users of the MSys environment needs to set the environment variable + UNIX_TOOLS to 1 before make install is run. @heading Index: changes._tx =================================================================== RCS file: /cvsroot/ccomx/ccom/docs/changes._tx,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** changes._tx 8 Feb 2004 20:47:21 -0000 1.4 --- changes._tx 21 Sep 2005 18:12:09 -0000 1.5 *************** *** 38,42 **** @heading Changes ! 0.9.2: <ul> --- 38,46 ---- @heading Changes ! 0.9.3: ! <ul> ! <li> ! Fixed bug 1297991 "Confusing build instructions" ! </ul> 0.9.2: <ul> |
|
From: Christer S. <ch...@us...> - 2005-09-21 18:12:18
|
Update of /cvsroot/ccomx/ccom/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15326/misc Modified Files: dllsyms.lst makefile.all makefile.ver zipup.sh Log Message: fixed bug 1297991 Index: makefile.ver =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/makefile.ver,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** makefile.ver 8 Nov 2004 21:15:21 -0000 1.7 --- makefile.ver 21 Sep 2005 18:12:10 -0000 1.8 *************** *** 7,10 **** # Shared library versions for Unix # todo: this is unused at the moment ! shared_version = 0.9.2 shared_major_minor = 0.9 --- 7,10 ---- # Shared library versions for Unix # todo: this is unused at the moment ! shared_version = 0.9.3 shared_major_minor = 0.9 Index: makefile.all =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/makefile.all,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** makefile.all 18 Sep 2005 18:33:54 -0000 1.11 --- makefile.all 21 Sep 2005 18:12:10 -0000 1.12 *************** *** 6,10 **** # See readme.txt for more information about CCOM. # - # # Available options: # --- 6,9 ---- *************** *** 18,44 **** # docs: Build only the documentation. # clean: Remove rebuildable files. ! # compress: Compress the example executable using upx. ! # uninstall: Uninstalls the header files of CCOM and all brands of the lib that has been installed. # help: Display this help. # # Developer Targets: # ! # texts: Builds the textfile and the includefile(s) *.ht from *.t # This should actually be part of the default build but ! # for the user conveniance (it needs CGUIDIR to be set) it is pre-built. ! # depend: Regenerate dependencies. # veryclean: Remove rebuildable files, including dependencies. ! # rewhisp: Reformat all text files to unix format using whisped. ! # rewhisp-dos: Reformat all text files to dos format using whisped. ! # zipupd-big: Create developer zip with additional stuff from dos. # # Variables: # # DEBUGMODE=1 Include debug info in the library. # CCOM_FORTIFY=1 Include memory debugger. Sources are not included in the distribution # c-files are assumed to be located in src and h-files in include. ## - include misc/makefile.ver --- 17,47 ---- # docs: Build only the documentation. # clean: Remove rebuildable files. ! # compress: Compress the example executable using the executable compressing program pointed to by UPX_PROGRAM. # help: Display this help. # # Developer Targets: # ! # dat: Builds the textfile and the includefile(s) *.ht from *.t # This should actually be part of the default build but ! # for the user conveniance it is pre-built. This is needed to build a lib using code ! # checked out from cvs. This target needs the environment variable CGUIDIR to point ! # to the directory of CGUI, and ALLEGRO to point to the directory of Allegro. ! # depend: Regenerate dependencies. This is needed to build a lib using code checked out from cvs. # veryclean: Remove rebuildable files, including dependencies. ! # rewhisp: Reformat all text files to unix format using whisped. This requires the whisped program to in your path. ! # rewhisp-dos: Reformat all text files to dos format using whisped. This requires the whisped program to in your path. # # Variables: # + # ALLEGRO=<directoy-of-allegro-source> See target `dat' above. + # CGUIDIR=<directoy-of-cgui> Needed by target `dat', see above. + # + # UPX_PROGRAM=<program-to-compress-with> See target `compress' above. # DEBUGMODE=1 Include debug info in the library. # CCOM_FORTIFY=1 Include memory debugger. Sources are not included in the distribution # c-files are assumed to be located in src and h-files in include. + # ## include misc/makefile.ver *************** *** 98,102 **** docs/ccom.txt docs/ccom$(HTML_SUFFIX) docs/ccom$(INFO_SUFFIX) docs/ccom.rtf \ docs/internal.txt docs/internal$(HTML_SUFFIX) docs/internal$(INFO_SUFFIX) docs/internal.rtf \ ! readme.txt readme.html docs/readme$(INFO_SUFFIX) \ docs/changes.txt docs/changes$(HTML_SUFFIX) --- 101,105 ---- docs/ccom.txt docs/ccom$(HTML_SUFFIX) docs/ccom$(INFO_SUFFIX) docs/ccom.rtf \ docs/internal.txt docs/internal$(HTML_SUFFIX) docs/internal$(INFO_SUFFIX) docs/internal.rtf \ ! readme.txt readme$(HTML_SUFFIX) docs/readme$(INFO_SUFFIX) \ docs/changes.txt docs/changes$(HTML_SUFFIX) *************** *** 115,119 **** # -------- Compile -------- ! .PHONY: default all lib examples docs clean compress donemsg texts .PRECIOUS: docs/%$(TEXI_SUFFIX) $(OBJ_DIR)/%$(OBJ_SUFFIX) --- 118,122 ---- # -------- Compile -------- ! .PHONY: default all lib examples docs clean compress donemsg dat .PRECIOUS: docs/%$(TEXI_SUFFIX) $(OBJ_DIR)/%$(OBJ_SUFFIX) Index: dllsyms.lst =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/dllsyms.lst,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** dllsyms.lst 2 Mar 2003 17:06:10 -0000 1.1.1.1 --- dllsyms.lst 21 Sep 2005 18:12:10 -0000 1.2 *************** *** 1,11 **** ! CCPSendBuffer ! CCPSetBaud ! CCPSetBits ! CCPSetParity ! CCPSetParityEnable ! CCPSetPath ! CCPSetStopBits ! CCPSettingsDialogue ! CCPStartScanning ! CCPStopScanning ! CCPStopSending --- 1,12 ---- ! CcomLoopBackMode ! CcomSendBuffer ! CcomSetBaud ! CcomSetBits ! CcomSetParity ! CcomSetParityEnable ! CcomSetPath ! CcomSetStopBits ! CcomSettingsDialogue ! CcomStartScanning ! CcomStopScanning ! CcomStopSending Index: zipup.sh =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/zipup.sh,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** zipup.sh 18 Sep 2005 18:33:54 -0000 1.8 --- zipup.sh 21 Sep 2005 18:12:10 -0000 1.9 *************** *** 12,17 **** # note: these are patched by fixver.sh script. ! zipversion=092 ! tgzversion=0.9.2 if [ "$1" != "-q" ]; then --- 12,17 ---- # note: these are patched by fixver.sh script. ! zipversion=093 ! tgzversion=0.9.3 if [ "$1" != "-q" ]; then *************** *** 40,45 **** ./fix.sh djgpp --quick make depend ! ./fix.sh bcc32 --quick ! make depend ./fix.sh djgpp --quick fi --- 40,45 ---- ./fix.sh djgpp --quick make depend ! # ./fix.sh bcc32 --quick ! # make depend ./fix.sh djgpp --quick fi *************** *** 47,51 **** echo generate other files for the distribution... make docs "LFN=y" ! make texts fi --- 47,51 ---- echo generate other files for the distribution... make docs "LFN=y" ! make dat fi *************** *** 74,78 **** echo remove old archives... rm -f ccom/ccom$zipversion.zip ! rm -f ccom/ccom-$tgzversion.tgz echo create tar.gz archives... --- 74,78 ---- echo remove old archives... rm -f ccom/ccom$zipversion.zip ! rm -f ccom/ccom-$tgzversion.tar.gz echo create tar.gz archives... |
|
From: Christer S. <ch...@us...> - 2005-09-21 18:12:18
|
Update of /cvsroot/ccomx/ccom/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15326/include Modified Files: ccom.h Log Message: fixed bug 1297991 Index: ccom.h =================================================================== RCS file: /cvsroot/ccomx/ccom/include/ccom.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ccom.h 8 Nov 2004 21:17:48 -0000 1.8 --- ccom.h 21 Sep 2005 18:12:10 -0000 1.9 *************** *** 4,11 **** #define CCOM_VERSION_MAJOR 0 #define CCOM_VERSION_MINOR 9 ! #define CCOM_VERSION_PATCH 2 ! #define CCOM_VERSION_STRING "0.9.2" ! #define CCOM_DATE 20040611 /* yyyymmdd */ ! #define CCOM_DATE_STRING "Jun 11, 2004" #include "ccom/ccomcfg.h" --- 4,11 ---- #define CCOM_VERSION_MAJOR 0 #define CCOM_VERSION_MINOR 9 ! #define CCOM_VERSION_PATCH 3 ! #define CCOM_VERSION_STRING "0.9.3" ! #define CCOM_DATE 20050921 /* yyyymmdd */ ! #define CCOM_DATE_STRING "Sep 21, 2005" #include "ccom/ccomcfg.h" |
|
From: SourceForge.net <no...@so...> - 2005-09-21 18:08:19
|
Bugs item #1297991, was opened at 2005-09-21 18:08 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=542638&aid=1297991&group_id=75004 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Platform independent Group: MainBranch Status: Open Resolution: None Priority: 5 Submitted By: Christer Sandberg (chrisan) Assigned to: Christer Sandberg (chrisan) Summary: Confusing build instructions Initial Comment: The build instructions are incomplete, erroneous and inconsistent in readme and makefile.all. Minor bugs in zipup.sh. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=542638&aid=1297991&group_id=75004 |
|
From: Christer S. <ch...@us...> - 2005-09-18 18:34:05
|
Update of /cvsroot/ccomx/ccom/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5670/misc Modified Files: makefile.all zipup.sh Log Message: some more details fixed regarding build and docs Index: makefile.all =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/makefile.all,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** makefile.all 8 Nov 2004 21:15:21 -0000 1.10 --- makefile.all 18 Sep 2005 18:33:54 -0000 1.11 *************** *** 98,103 **** docs/ccom.txt docs/ccom$(HTML_SUFFIX) docs/ccom$(INFO_SUFFIX) docs/ccom.rtf \ docs/internal.txt docs/internal$(HTML_SUFFIX) docs/internal$(INFO_SUFFIX) docs/internal.rtf \ ! docs/readme.txt docs/readme$(INFO_SUFFIX) \ ! docs/changes.txt docs/changes$(HTML_SUFFIX) ifndef HAVE_TEXINFO --- 98,103 ---- docs/ccom.txt docs/ccom$(HTML_SUFFIX) docs/ccom$(INFO_SUFFIX) docs/ccom.rtf \ docs/internal.txt docs/internal$(HTML_SUFFIX) docs/internal$(INFO_SUFFIX) docs/internal.rtf \ ! readme.txt readme.html docs/readme$(INFO_SUFFIX) \ ! docs/changes.txt docs/changes$(HTML_SUFFIX) ifndef HAVE_TEXINFO *************** *** 165,174 **** $(LINK_OBJ_TO_LIB) ! examples/%$(EXE_SUFFIX): $(OBJ_DIR)/%$(OBJ_SUFFIX) $(LIB_NAME) $(LINK_OBJ_TO_EXE) chm-docs: docs/ccom.chm ! docs/%.txt: docs/%._tx -$(MAKEDOC_PROGRAM) -ascii $@ $< --- 165,174 ---- $(LINK_OBJ_TO_LIB) ! examples/%$(EXE_SUFFIX): $(OBJ_DIR)/%$(OBJ_SUFFIX) $(LIB_NAME) $(LINK_OBJ_TO_EXE) chm-docs: docs/ccom.chm ! %.txt: docs/%._tx -$(MAKEDOC_PROGRAM) -ascii $@ $< *************** *** 176,179 **** --- 176,182 ---- -$(MAKEDOC_PROGRAM) -ascii $@ $< + %$(HTML_SUFFIX): docs/%._tx + -$(MAKEDOC_PROGRAM) $(_TX_HTML_FLAG) $@ $< + docs/%$(HTML_SUFFIX): docs/%._tx -$(MAKEDOC_PROGRAM) $(_TX_HTML_FLAG) $@ $< Index: zipup.sh =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/zipup.sh,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** zipup.sh 21 Jun 2004 19:17:54 -0000 1.7 --- zipup.sh 18 Sep 2005 18:33:54 -0000 1.8 *************** *** 19,24 **** echo clean up... ./fix.sh djgpp --dtou ! #make clean ! make rewhisp # Dont generate dependencies if a parameter was given. --- 19,23 ---- echo clean up... ./fix.sh djgpp --dtou ! make clean # Dont generate dependencies if a parameter was given. *************** *** 65,71 **** examples/*.c examples/*.cfg \ resource/*.dat resource/ccomlabl \ ! include/*.h include/ccom/*.h \ ! misc/runner.c \ ! misc/makedoc/*.c misc/makedoc/*.h" afiles=`echo $files | sed -e"s/\([^ ][^ ]*\)/ ccom\/\1/g"` --- 64,68 ---- examples/*.c examples/*.cfg \ resource/*.dat resource/ccomlabl \ ! include/*.h include/ccom/*.h" afiles=`echo $files | sed -e"s/\([^ ][^ ]*\)/ ccom\/\1/g"` |
|
From: Christer S. <ch...@us...> - 2005-09-18 18:34:05
|
Update of /cvsroot/ccomx/ccom/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5670/docs Modified Files: readme._tx Log Message: some more details fixed regarding build and docs Index: readme._tx =================================================================== RCS file: /cvsroot/ccomx/ccom/docs/readme._tx,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** readme._tx 8 Nov 2004 21:16:37 -0000 1.6 --- readme._tx 18 Sep 2005 18:33:53 -0000 1.7 *************** *** 79,83 **** i.e. enter the command <pre> ! cd c:\cbar </pre> or whatever is the name of your ccom directory. Then choose platform by --- 79,83 ---- i.e. enter the command <pre> ! cd c:\ccom </pre> or whatever is the name of your ccom directory. Then choose platform by *************** *** 122,126 **** make mktext </pre> ! Return to the main directory of cbar, e.g.: <pre> cd c:\ccom --- 122,126 ---- make mktext </pre> ! Return to the main directory of CCOM, e.g.: <pre> cd c:\ccom |
|
From: Christer S. <ch...@us...> - 2005-09-18 17:15:56
|
Update of /cvsroot/ccomx/ccom/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21771/src Modified Files: comunix.c Log Message: removed dbug printouts Index: comunix.c =================================================================== RCS file: /cvsroot/ccomx/ccom/src/comunix.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** comunix.c 16 Feb 2004 07:20:20 -0000 1.2 --- comunix.c 18 Sep 2005 17:15:44 -0000 1.3 *************** *** 1,150 **** ! /* Module COMUNIX ! This module contains the asynchronous commounication basics for ! UNIX only. */ ! #include <allegro.h> ! #ifdef ALLEGRO_UNIX ! ! #include <cgui.h> ! #include <termios.h> ! #include <sys/types.h> ! #include <sys/stat.h> ! #include <unistd.h> ! ! #include "common.h" ! #include "comx.h" ! #include "labldata.h" ! #include "dialser.ht" ! ! #define NR_FILE_ALTERANTIVES 6 ! static int OpenPort(t_serport *port) ! { ! static char *file_names[NR_FILE_ALTERANTIVES][4]={ ! {"/dev/tts/0", "/dev/tts/1", "/dev/tts/2", "/dev/tts/3"}, ! {"/dev/ttyS0", "/dev/ttyS1", "/dev/ttyS2", "/dev/ttyS3"}, ! {"/dev/ttyf1", "/dev/ttyf2", "/dev/ttyf3", "/dev/ttyf4"}, ! {"/dev/ttya", "/dev/ttyb", "/dev/ttyc", "/dev/ttyd"}, ! {"/dev/tty1p0", "/dev/tty2p0", "/dev/tty3p0", "/dev/tty4p0"}, ! {"/dev/tty01", "/dev/tty02", "/dev/tty03", "/dev/tty04"}}; ! int i; ! ! if (port->fd > 0) ! return 1; ! if (port->fd < 0) ! return 0; ! for (i=0; i<NR_FILE_ALTERANTIVES; i++) { ! struct stat buf; ! if (stat(file_names[i][port->portno], &buf) == 0) { ! /* File exists */ ! port->fd = open(file_names[i][port->portno], O_RDWR | O_NOCTTY | O_NDELAY); ! if (port->fd > 0) { ! fcntl(port->fd, F_SETFL, FNDELAY); ! return 1; ! } else { ! static const char * const * txt; ! char s[1000]; ! int nr; ! txt = LoadCompiledTexts(ccom_labels, "dialser", &nr); ! sprintf(s, txt[L_ERROR_ACCESS_RIGHTS], port->portno+1, file_names[i][port->portno]); ! Req("", s); ! } ! } ! } ! return 0; ! } ! ! extern int _CcomReadPort(t_serport *port, unsigned char *c, unsigned char *error) ! { ! int n = 0; ! ! if (port->fd == 0) ! OpenPort(port); ! *error = 0; ! n = read(port->fd, &c, 1); ! if (n < 0) { ! n = 0; ! *error = 1; ! } ! if (n) { ! char s[100]; ! sprintf(s, "number:%2x|OK", n); ! Req("",s);} ! return n; ! } ! ! extern int _CcomWritePort(t_serport *port, int c) ! { ! int n = 0; ! ! if (port->fd == 0) ! OpenPort(port); ! n = write(port->fd, &c, 1); ! return n; ! } ! ! extern void _CcomSetBaud(t_serport *port) ! { ! struct termios options; ! int baud; ! ! tcgetattr(port->fd, &options); ! switch (port->baud_rate) { ! case 50: baud = B50; break; ! case 75: baud = B75; break; ! case 110: baud = B110; break; ! case 134: baud = B134; break; ! case 150: baud = B150; break; ! case 200: baud = B200; break; ! case 300: baud = B300; break; ! case 600: baud = B600; break; ! case 1200: baud = B1200; break; ! case 1800: baud = B1800; break; ! case 2400: baud = B2400; break; ! case 4800: baud = B4800; break; ! case 9600: baud = B9600; break; ! case 19200: baud = B19200; break; ! case 38400: baud = B38400; break; ! case 57600: baud = B57600; break; ! case 115200: baud = B115200; break; ! case 230400: baud = B230400; break; ! default: baud = B0; break; ! } ! cfsetispeed(&options, baud); ! cfsetospeed(&options, baud); ! options.c_cflag |= (CLOCAL | CREAD); ! tcsetattr(port->fd, TCSANOW, &options); ! } ! ! extern void _CcomApplySettingsToPort(t_serport *port) ! { ! struct termios options; ! ! tcgetattr(port->fd, &options); ! options.c_cflag &= ~CSIZE; ! options.c_cflag &= ~CSTOPB; ! options.c_cflag &= ~PARENB; ! options.c_cflag &= ~PARODD; ! options.c_iflag &= ~(INPCK | ISTRIP); ! switch (port->nobits) { ! case 5: options.c_cflag |= CS5; break; ! case 6: options.c_cflag |= CS6; break; ! case 7: options.c_cflag |= CS7; break; ! default: options.c_cflag |= CS8; break; ! } ! if (port->parityena) { ! options.c_cflag |= PARENB; ! options.c_iflag |= INPCK | ISTRIP; ! } ! if (port->parity==0) ! options.c_cflag |= PARODD; ! if (port->stopbits==2) ! options.c_cflag |= CSTOPB; ! options.c_cflag |= CLOCAL | CREAD; ! options.c_lflag &= ~ICANON | ECHO | ECHOE | ISIG; ! options.c_oflag &= ~OPOST; ! tcsetattr(port->fd, TCSANOW, &options); ! } ! ! extern void _CcomLoopBackMode(t_serport *port, int mode) ! { ! } ! #endif --- 1,146 ---- ! /* Module COMUNIX ! This module contains the asynchronous commounication basics for ! UNIX only. */ ! #include <allegro.h> ! #ifdef ALLEGRO_UNIX ! ! #include <cgui.h> ! #include <termios.h> ! #include <sys/types.h> ! #include <sys/stat.h> ! #include <unistd.h> ! ! #include "common.h" ! #include "comx.h" ! #include "labldata.h" ! #include "dialser.ht" ! ! #define NR_FILE_ALTERANTIVES 6 ! static int OpenPort(t_serport *port) ! { ! static char *file_names[NR_FILE_ALTERANTIVES][4]={ ! {"/dev/tts/0", "/dev/tts/1", "/dev/tts/2", "/dev/tts/3"}, ! {"/dev/ttyS0", "/dev/ttyS1", "/dev/ttyS2", "/dev/ttyS3"}, ! {"/dev/ttyf1", "/dev/ttyf2", "/dev/ttyf3", "/dev/ttyf4"}, ! {"/dev/ttya", "/dev/ttyb", "/dev/ttyc", "/dev/ttyd"}, ! {"/dev/tty1p0", "/dev/tty2p0", "/dev/tty3p0", "/dev/tty4p0"}, ! {"/dev/tty01", "/dev/tty02", "/dev/tty03", "/dev/tty04"}}; ! int i; ! ! if (port->fd > 0) ! return 1; ! if (port->fd < 0) ! return 0; ! for (i=0; i<NR_FILE_ALTERANTIVES; i++) { ! struct stat buf; ! if (stat(file_names[i][port->portno], &buf) == 0) { ! /* File exists */ ! port->fd = open(file_names[i][port->portno], O_RDWR | O_NOCTTY | O_NDELAY); ! if (port->fd > 0) { ! fcntl(port->fd, F_SETFL, FNDELAY); ! return 1; ! } else { ! static const char * const * txt; ! char s[1000]; ! int nr; ! txt = LoadCompiledTexts(ccom_labels, "dialser", &nr); ! sprintf(s, txt[L_ERROR_ACCESS_RIGHTS], port->portno+1, file_names[i][port->portno]); ! Req("", s); ! } ! } ! } ! return 0; ! } ! ! extern int _CcomReadPort(t_serport *port, unsigned char *c, unsigned char *error) ! { ! int n = 0; ! ! if (port->fd == 0) ! OpenPort(port); ! *error = 0; ! n = read(port->fd, &c, 1); ! if (n < 0) { ! n = 0; ! *error = 1; ! } ! return n; ! } ! ! extern int _CcomWritePort(t_serport *port, int c) ! { ! int n = 0; ! ! if (port->fd == 0) ! OpenPort(port); ! n = write(port->fd, &c, 1); ! return n; ! } ! ! extern void _CcomSetBaud(t_serport *port) ! { ! struct termios options; ! int baud; ! ! tcgetattr(port->fd, &options); ! switch (port->baud_rate) { ! case 50: baud = B50; break; ! case 75: baud = B75; break; ! case 110: baud = B110; break; ! case 134: baud = B134; break; ! case 150: baud = B150; break; ! case 200: baud = B200; break; ! case 300: baud = B300; break; ! case 600: baud = B600; break; ! case 1200: baud = B1200; break; ! case 1800: baud = B1800; break; ! case 2400: baud = B2400; break; ! case 4800: baud = B4800; break; ! case 9600: baud = B9600; break; ! case 19200: baud = B19200; break; ! case 38400: baud = B38400; break; ! case 57600: baud = B57600; break; ! case 115200: baud = B115200; break; ! case 230400: baud = B230400; break; ! default: baud = B0; break; ! } ! cfsetispeed(&options, baud); ! cfsetospeed(&options, baud); ! options.c_cflag |= (CLOCAL | CREAD); ! tcsetattr(port->fd, TCSANOW, &options); ! } ! ! extern void _CcomApplySettingsToPort(t_serport *port) ! { ! struct termios options; ! ! tcgetattr(port->fd, &options); ! options.c_cflag &= ~CSIZE; ! options.c_cflag &= ~CSTOPB; ! options.c_cflag &= ~PARENB; ! options.c_cflag &= ~PARODD; ! options.c_iflag &= ~(INPCK | ISTRIP); ! switch (port->nobits) { ! case 5: options.c_cflag |= CS5; break; ! case 6: options.c_cflag |= CS6; break; ! case 7: options.c_cflag |= CS7; break; ! default: options.c_cflag |= CS8; break; ! } ! if (port->parityena) { ! options.c_cflag |= PARENB; ! options.c_iflag |= INPCK | ISTRIP; ! } ! if (port->parity==0) ! options.c_cflag |= PARODD; ! if (port->stopbits==2) ! options.c_cflag |= CSTOPB; ! options.c_cflag |= CLOCAL | CREAD; ! options.c_lflag &= ~ICANON | ECHO | ECHOE | ISIG; ! options.c_oflag &= ~OPOST; ! tcsetattr(port->fd, TCSANOW, &options); ! } ! ! extern void _CcomLoopBackMode(t_serport *port, int mode) ! { ! } ! #endif |
|
From: Christer S. <ch...@us...> - 2005-09-18 17:15:55
|
Update of /cvsroot/ccomx/ccom/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21771/examples Modified Files: 1_com.c allegro.cfg Log Message: removed dbug printouts Index: 1_com.c =================================================================== RCS file: /cvsroot/ccomx/ccom/examples/1_com.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** 1_com.c 16 Feb 2004 07:20:19 -0000 1.4 --- 1_com.c 18 Sep 2005 17:15:44 -0000 1.5 *************** *** 1,133 **** ! /* This example shows how to use CCOM for accessing the serial port */ ! ! #include<allegro.h> ! #include <cgui.h> ! #include <cgui/mem.h> ! #include "ccom.h" ! #include <string.h> ! ! typedef struct t_portdata { ! char *rec, *send; ! int id, nr, scan, loopback; ! } t_portdata; ! ! static void receive(int portnr nouse, int readdata, int error nouse, void *data) ! { ! t_portdata *pd = data; ! int len = 2; ! char s[100]; ! sprintf(s, "%2x|OK", readdata); ! Req("",s); ! if (pd->rec) ! len += strlen(pd->rec); ! pd->rec = ResizeMem(char, pd->rec, len); ! pd->rec[len-2] = readdata; ! pd->rec[len-1] = 0; ! Refresh(pd->id); ! } ! ! static void scanning(void *data) ! { ! t_portdata *pd = data; ! ! if (pd->scan) ! CcomStartScanning(pd->nr, 0, receive, pd); ! else ! CcomStopScanning(pd->nr); ! } ! ! static void do_send(void *data) ! { ! t_portdata *pd = data; ! ! if (pd->send && *pd->send) ! CcomSendBuffer(pd->nr, pd->send, strlen(pd->send), NULL, NULL); ! } ! ! static void shut_down(void *data nouse) ! { ! StopProcessEvents(); ! } ! ! static void com_settings(void *data) ! { ! t_portdata *pd = data; ! CcomSettingsDialogue(pd->nr); ! } ! ! static void switch_loop_back_mode(void *data) ! { ! t_portdata *pd = data; ! CcomLoopBackMode(pd->nr, pd->loopback); ! } ! ! static void add_port_container(t_portdata *pd, int i) ! { ! int id, nrs[]={CCOM_COM1, CCOM_COM2, CCOM_COM3, CCOM_COM4}; ! char s[100]; ! ! pd->nr = nrs[i]; ! sprintf(s, "COM%d", i+1); ! StartContainer(DOWNLEFT, ADAPTIVE, s, CT_BORDER); ! AddButton(DOWNLEFT, "Port settings", com_settings, pd); ! pd->id = AddEditBox(DOWNLEFT, 300, "Received bytes:", FPTRSTR, 0, &pd->rec); ! id = AddCheck(RIGHT, "Scan port", &pd->scan); ! AddHandler(id, scanning, pd); ! AddEditBox(DOWNLEFT, 300, "Bytes to send:", FPTRSTR, 0, &pd->send); ! AddButton(RIGHT, " Send ", do_send, pd); ! id = AddCheck(DOWNLEFT, "Loop back mode", &pd->loopback); ! AddHandler(id, switch_loop_back_mode, pd); ! ! EndContainer(); ! } ! ! static void example_info(void *data nouse) ! { ! MkDialogue(ADAPTIVE, "Info window", W_FLOATING); ! AddTextBox(TOPLEFT, "This examples shows how to use CCOM._" ! "To make it meaningful you need to connect some equipment to some of" ! "the serial ports of your computer, and then set yor your computers port" ! "settings to the same values used by the connected equipment. Therefore" ! "you must know these settings._" ! "Specially you can connect two computers, one i each end of the line." ! "This requires another type of cable than the cable used for e.g. modems.", ! 400, 0, TB_FRAMESINK|TB_LINEFEED_); ! AddButton(DOWNLEFT, "Close", CloseWin, NULL); ! DisplayWin(); ! } ! ! static void show_code(void *data nouse) ! { ! int id; ! ! MkDialogue(ADAPTIVE, "Code view", W_FLOATING); ! id = AddTextBox(DOWNLEFT, "1_com.c", 670, 54, TB_TEXTFILE|TB_FRAMESINK|TB_PREFORMAT|3); ! MakeStretchable(id, NULL, NULL, 0); ! AddButton(DOWNLEFT, "Close", CloseWin, NULL); ! DisplayWin(); ! } ! ! int main(void) ! { ! static t_portdata pd[4]; ! int i; ! ! InitCguiWindowedMode(); ! //InitCgui(640, 480, 16); ! MkDialogue(ADAPTIVE, "Serial communication example", 0); ! AddButton(DOWNLEFT, "E~xit", shut_down, pd); ! AddButton(RIGHT, "Example info", example_info, NULL); ! AddButton(RIGHT, "Show code", show_code, NULL); ! /* Too many similar labels, turn off or else infinite searching */ ! AutoHotKeys(0); ! for (i=0; i<4; i++) ! add_port_container(pd + i, i); ! DisplayWin(); ! ProcessEvents(); ! for (i=0; i<4; i++) { ! Release(pd[i].rec); ! Release(pd[i].send); ! } ! return 0; ! } ! END_OF_MAIN(); --- 1,130 ---- ! /* This example shows how to use CCOM for accessing the serial port */ ! ! #include<allegro.h> ! #include <cgui.h> ! #include <cgui/mem.h> ! #include "ccom.h" ! #include <string.h> ! ! typedef struct t_portdata { ! char *rec, *send; ! int id, nr, scan, loopback; ! } t_portdata; ! ! static void receive(int portnr nouse, int readdata, int error nouse, void *data) ! { ! t_portdata *pd = data; ! int len = 2; ! if (pd->rec) ! len += strlen(pd->rec); ! pd->rec = ResizeMem(char, pd->rec, len); ! pd->rec[len-2] = readdata; ! pd->rec[len-1] = 0; ! Refresh(pd->id); ! } ! ! static void scanning(void *data) ! { ! t_portdata *pd = data; ! ! if (pd->scan) ! CcomStartScanning(pd->nr, 0, receive, pd); ! else ! CcomStopScanning(pd->nr); ! } ! ! static void do_send(void *data) ! { ! t_portdata *pd = data; ! ! if (pd->send && *pd->send) ! CcomSendBuffer(pd->nr, pd->send, strlen(pd->send), NULL, NULL); ! } ! ! static void shut_down(void *data nouse) ! { ! StopProcessEvents(); ! } ! ! static void com_settings(void *data) ! { ! t_portdata *pd = data; ! CcomSettingsDialogue(pd->nr); ! } ! ! static void switch_loop_back_mode(void *data) ! { ! t_portdata *pd = data; ! CcomLoopBackMode(pd->nr, pd->loopback); ! } ! ! static void add_port_container(t_portdata *pd, int i) ! { ! int id, nrs[]={CCOM_COM1, CCOM_COM2, CCOM_COM3, CCOM_COM4}; ! char s[100]; ! ! pd->nr = nrs[i]; ! sprintf(s, "COM%d", i+1); ! StartContainer(DOWNLEFT, ADAPTIVE, s, CT_BORDER); ! AddButton(DOWNLEFT, "Port settings", com_settings, pd); ! pd->id = AddEditBox(DOWNLEFT, 300, "Received bytes:", FPTRSTR, 0, &pd->rec); ! id = AddCheck(RIGHT, "Scan port", &pd->scan); ! AddHandler(id, scanning, pd); ! AddEditBox(DOWNLEFT, 300, "Bytes to send:", FPTRSTR, 0, &pd->send); ! AddButton(RIGHT, " Send ", do_send, pd); ! id = AddCheck(DOWNLEFT, "Loop back mode", &pd->loopback); ! AddHandler(id, switch_loop_back_mode, pd); ! ! EndContainer(); ! } ! ! static void example_info(void *data nouse) ! { ! MkDialogue(ADAPTIVE, "Info window", W_FLOATING); ! AddTextBox(TOPLEFT, "This examples shows how to use CCOM._" ! "To make it meaningful you need to connect some equipment to some of" ! "the serial ports of your computer, and then set yor your computers port" ! "settings to the same values used by the connected equipment. Therefore" ! "you must know these settings._" ! "Specially you can connect two computers, one i each end of the line." ! "This requires another type of cable than the cable used for e.g. modems.", ! 400, 0, TB_FRAMESINK|TB_LINEFEED_); ! AddButton(DOWNLEFT, "Close", CloseWin, NULL); ! DisplayWin(); ! } ! ! static void show_code(void *data nouse) ! { ! int id; ! ! MkDialogue(ADAPTIVE, "Code view", W_FLOATING); ! id = AddTextBox(DOWNLEFT, "1_com.c", 670, 54, TB_TEXTFILE|TB_FRAMESINK|TB_PREFORMAT|3); ! MakeStretchable(id, NULL, NULL, 0); ! AddButton(DOWNLEFT, "Close", CloseWin, NULL); ! DisplayWin(); ! } ! ! int main(void) ! { ! static t_portdata pd[4]; ! int i; ! ! InitCguiWindowedMode(); ! //InitCgui(640, 480, 16); ! MkDialogue(ADAPTIVE, "Serial communication example", 0); ! AddButton(DOWNLEFT, "E~xit", shut_down, pd); ! AddButton(RIGHT, "Example info", example_info, NULL); ! AddButton(RIGHT, "Show code", show_code, NULL); ! /* Too many similar labels, turn off or else infinite searching */ ! AutoHotKeys(0); ! for (i=0; i<4; i++) ! add_port_container(pd + i, i); ! DisplayWin(); ! ProcessEvents(); ! for (i=0; i<4; i++) { ! Release(pd[i].rec); ! Release(pd[i].send); ! } ! return 0; ! } ! END_OF_MAIN(); Index: allegro.cfg =================================================================== RCS file: /cvsroot/ccomx/ccom/examples/allegro.cfg,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** allegro.cfg 8 Feb 2004 20:47:21 -0000 1.4 --- allegro.cfg 18 Sep 2005 17:15:44 -0000 1.5 *************** *** 1,35 **** ! [system] ! language = en ! keyboard = us ! ! [cgui] ! language = en ! ! [cgui:screen-res] ! Width = 800 ! Height = 600 ! Colour_depth = 24 ! ! [COM2] ! Baud-rate = 9600 ! Parity = 1 ! Parity-enabled = 1 ! Stopbits = 2 ! Bits = 7 ! Interrupt-control = 0 ! IRQ-nr = 0 ! Flow-control = 0 ! Buffer-size = 0 ! Port-address = 2F8 ! ! [COM1] ! Baud-rate = 9600 ! Parity = 1 ! Parity-enabled = 1 ! Stopbits = 2 ! Bits = 7 ! Interrupt-control = 0 ! IRQ-nr = 0 ! Flow-control = 0 ! Buffer-size = 0 ! Port-address = 3F8 --- 1,35 ---- ! [system] ! language = en ! keyboard = us ! ! [cgui] ! language = en ! ! [cgui:screen-res] ! Width = 800 ! Height = 600 ! Colour_depth = 24 ! ! [COM2] ! Baud-rate = 9600 ! Parity = 1 ! Parity-enabled = 1 ! Stopbits = 2 ! Bits = 7 ! Interrupt-control = 0 ! IRQ-nr = 0 ! Flow-control = 0 ! Buffer-size = 0 ! Port-address = 2F8 ! ! [COM1] ! Baud-rate = 9600 ! Parity = 0 ! Parity-enabled = 1 ! Stopbits = 2 ! Bits = 7 ! Interrupt-control = 0 ! IRQ-nr = 0 ! Flow-control = 0 ! Buffer-size = 0 ! Port-address = 3F8 |