You can subscribe to this list here.
2008 |
Jan
(3) |
Feb
(63) |
Mar
(3) |
Apr
(22) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: <vs...@ma...> - 2008-05-06 13:43:16
|
Hello boys, Been away for a wee while but I'm back now. I cannot really go into details as to why I've not been around, it's to do with a recent job I was given by some interesting people. I've returned to doing normal project management again. I'll be interested to see what you guys have been doing whilst I've been away. Mark |
From: <ak...@us...> - 2008-04-24 11:50:32
|
Revision: 890 http://can.svn.sourceforge.net/can/?rev=890&view=rev Author: akhe Date: 2008-04-24 04:50:25 -0700 (Thu, 24 Apr 2008) Log Message: ----------- Cleaning up Removed Paths: ------------- trunk/canalworks.conf.linux.example trunk/canalworks.conf.windows.example trunk/vscp.conf.linux.example trunk/vscp.conf.windows.example trunk/vscpd.conf trunk/vscpd.startup_script_debian trunk/vscpd.startup_script_fedora trunk/vscpworks.conf Deleted: trunk/canalworks.conf.linux.example =================================================================== --- trunk/canalworks.conf.linux.example 2008-04-24 11:45:41 UTC (rev 889) +++ trunk/canalworks.conf.linux.example 2008-04-24 11:50:25 UTC (rev 890) @@ -1,42 +0,0 @@ -# -# canalworks.conf -# -# This is a sample VSCP/canal configuration file for Linux -# - - -[CANALWORKS] - -# -# Drivers you want to be able to directly open through -# canalworks should be added here. -# -# Note that forward slashes should be used!!! -# ==================================================== -# - -device2="logger,c:/canallog2,d:/winnt/system32/canallogger.dll,64,64,1" - - -# -# Delete warning -# ============== -# If you don't want the warning dialog to be displayed when you delete list -# contents you should set this value to 0 -bDisplayDeleteWarning=1 - - -# -# Colors -# - - -# -# Predefined and saved CAN messages -# - - -# -# Predefined and saved VSCP messages -# - Deleted: trunk/canalworks.conf.windows.example =================================================================== --- trunk/canalworks.conf.windows.example 2008-04-24 11:45:41 UTC (rev 889) +++ trunk/canalworks.conf.windows.example 2008-04-24 11:50:25 UTC (rev 890) @@ -1,55 +0,0 @@ -# -# canalworks.conf -# -# This is a sample VSCP/CANAL configuration file for WIN32 -# - - - - -[POSITION] -# -# Window size and location -# -sizeWidth=640 -sizeHeight=480 - -[DRIVERS] -# -# Drivers you want to be able to directly open through -# canalworks should be added here. -# -# Note that forward slashes should be used!!! -# ==================================================== -# -#device2="logger,c:/canallog2,d:/winnt/system32/canallogger.dll,64,64,1" - - -[INSTALLED] -# -# Installed devices -# - -[OPTIONS] -# -# Delete warning -# ============== -# If you don't want the warning dialog to be displayed when you delete list -# contents you should set this value to 0 -bDisplayDeleteWarning=1 - - -[COLORS] -# -# Colors -# - -[PREDEFINED_CAN] -# -# Predefined and saved CAN messages -# - -[PREDEFINED_VSCP] -# -# Predefined and saved VSCP messages -# Deleted: trunk/vscp.conf.linux.example =================================================================== --- trunk/vscp.conf.linux.example 2008-04-24 11:45:41 UTC (rev 889) +++ trunk/vscp.conf.linux.example 2008-04-24 11:50:25 UTC (rev 890) @@ -1,125 +0,0 @@ -<?xml version = "1.0" encoding = "UTF-8" ?> - -<!-- Version 0.0.1 2007-09-27 --> - -<vscpconfig> - - <general> - <udpport>9598</udpport> - <tcpport>9598</tcpport> - <loglevel>debug</loglevel> - <tcpif disable="false" /> <!-- It is possibel to disable the TCP/IP interface --> - <udpif disable="false" onlyincoming="false"/> <!-- It is possible to disable the UDP interface --> - <canaldriver disable="false"/> - <dm disable="false"/> - <vscp disable="false"/> - <guid>00:01:02:03:04:05:06:07:08:09:0A:0B:0C:0D:0E:0F</guid> - </general> - - - - <remoteuser> <!-- Holds information about one (at least) or more users --> - <user> - <name>admin</name> - <password>5ebe2294ecd0e0f08eab7690d2a6ee69</password> - <privilege>admin</privilege> - <allowfrom>127.0.0.1,192.168.1.6,192.168.1.*</allowfrom> - </user> - <user> - <name>user</name> - <password>5ebe2294ecd0e0f08eab7690d2a6ee69</password> - <privilege>admin</privilege> - <allowfrom>127.0.0.1,192.168.1.6,192.168.1.184</allowfrom> - </user> - </remoteuser> - - - - <interfaces> <!-- Holds information about interfaces on the machine the daemon is run on --> - <interface> - <ipaddress>192.168.1.184</ipaddress> - <macaddress>00:16:D4:5D:68:F6</macaddress> - <guid>01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00</guid> - </interface> - </interfaces> - - - - - <canaldriver> <!-- Information about CANAL drivers --> - - <driver> - <name>logger</name> - <parameter>/tmp/canallog</parameter> - <path>/usr/local/lib/canallogger.so</path> - <flags>1</flags> - </driver> -<!-- - <driver> - <name>communication</name> - <parameter>/dev/ttyS0</parameter> - <path>/usr/local/lib/canalcom.so</path> - <flags>1</flags> - </driver> - - <driver> - <name>xap</name> - <parameter>1681;3639</parameter> - <path>/usr/local/lib/xapdrv.so</path> - <flags>1</flags> - </driver> ---> - - </canaldriver> - - - - <persistent> <!-- persistant storage is here --> - - <variable type="1" > <!-- string --> - <name>testvariable1</name> - <value>This is a string</value> - </variable> - - <variable type="2" > <!-- boolean --> - <name>testvariable2</name> - <value>true</value> - </variable> - - <variable type="3" > <!-- integer --> - <name>testvariable3</name> - <value>1956</value> - </variable> - - <variable type="4" > <!-- long --> - <name>testvariable4</name> - <value>0xffffffff</value> - </variable> - - <variable type="5" > <!-- normalized integer --> - <name>testvariable5</name> - <value>0x0001020304050607</value> - </variable> - - <variable type="6" > <!-- VSCP Event --> - <name>testvariable6</name> - <value>class=10,type=40,data=0x12,1,2,3,4,5</value> - </variable> - - <array type="1"> - <name>testarray</name> - <value>10</value> - <value>11</value> - <value>22</value> - <value>33</value> - <value>144</value> - <value>1000</value> - <value>3</value> - <value>100</value> - <value>200</value> - <value>1111</value> - </array> - - </persistent> - -</vscpconfig> \ No newline at end of file Deleted: trunk/vscp.conf.windows.example =================================================================== --- trunk/vscp.conf.windows.example 2008-04-24 11:45:41 UTC (rev 889) +++ trunk/vscp.conf.windows.example 2008-04-24 11:50:25 UTC (rev 890) @@ -1,103 +0,0 @@ -# -# vscp.conf -# -# This is a sample VSCP/canal configuration file for Linux -# - -# -# Drivers/plugins to use -# ====================== -# Add all drivers to use here. Note that forward slashes should be used!!! - -#device1 = "communication,com1,canal_comm.dll,64,64,1" -#device2 = "simulation,sim1,canal_socket.dll,64,64,1" -device1 = "logger,/canallog.txt,/winnt/system32/canallogger.so,64,64,1" - - -# -# Pointers to installed XML Description files for CANAL drivers -# ============================================================= -# -#xmldrvdescription1="name_of_driver,c:/test.xml" - -# -# GUID -# ==== -# A custom GUID for the WEb server can be set here. If nit given the Ethernet MAC -# address of the first found card on the machine will be used. -# -# GUID0=255 -# GUID1=255 -# GUID2=255 -# GUID3=255 -# GUID4=255 -# GUID5=255 -# GUID6=255 -# GUID7=255 -# GUID8=255 -# GUID9=255 -# GUID10=255 -# GUID11=255 -# GUID12=255 -# GUID13=255 -# GUID14=255 -# GUID15=255 - -# -# UDP Port to use. -# ================ -# If not defined the default port 1681 is used. -# -# UDPPort=6666 - - -# -# TCP Port to use. -# ================ -# If not defined the default port 1681 is used. -# -#TCPPort=9999 - - -# -# Loglevel. -# ========= -# Set the loglevel where 0 is no logging other then critical stuff and -# 9 is extensive logging. -# Default is 0. -LogLevel=0 - -# -# Disable VSCP functionality. -# =========================== -# Set to true to diable VSCP functionality. That is UDP/TCP and all Level II interfaces. -# Default is false. -# -#DisableVSCP=true - -# -# Disable Control Interface. -# ========================== -# This disables the control interface. -# Default is to have the interface enabled. -#DisableControlInterface=true - -# -# Username/Password for TCP interface. -# ==================================== -# Pasword is MD5 digest. -# Defaut is both empty meaning no password is used. -tcpuser="admin" -tcppassword="5ebe2294ecd0e0f08eab7690d2a6ee69" - -# -# IP Addressed for TCP interfaces. An interface will -# be opended on each -# -# tcpipaddr0=192.168.1.8 -# tcpipaddr1=192.255.1.2 -# tcpipaddr2=192.168.1.112 -#tcpipaddr0=192.168.1.8 - - - Deleted: trunk/vscpd.conf =================================================================== --- trunk/vscpd.conf 2008-04-24 11:45:41 UTC (rev 889) +++ trunk/vscpd.conf 2008-04-24 11:50:25 UTC (rev 890) @@ -1,131 +0,0 @@ -<?xml version = "1.0" encoding = "UTF-8" ?> - -<!-- Version 0.0.1 2007-09-27 --> - -<vscpconfig> - - <general> - <udpport>9598</udpport> - <tcpport>9598</tcpport> - <loglevel>debug</loglevel> - <tcpif disable="false" /> <!-- It is possibel to disable the TCP/IP interface --> - <udpif disable="false" onlyincoming="false"/> <!-- It is possible to disable the UDP interface --> - <canaldriver disable="false"/> - <dm disable="false"/> - <vscp disable="false"/> - </general> - - - - <remoteuser> <!-- Holds information about one (at least) or more users --> - <user> - <name>admin</name> - <password>5ebe2294ecd0e0f08eab7690d2a6ee69</password> - <privilege>admin</privilege> - <allowfrom>127.0.0.1,192.168.1.6,192.168.1.184</allowfrom> - </user> - <user> - <name>user</name> - <password>5ebe2294ecd0e0f08eab7690d2a6ee69</password> - <privilege>admin</privilege> - <allowfrom>127.0.0.1,192.168.1.6,192.168.1.184</allowfrom> - </user> - </remoteuser> - - - - <interfaces> <!-- Holds information about interfaces on the machine the daemon is run on --> - <interface> - <ipaddress>192.168.1.184</ipaddress> - <macaddress>00:16:D4:5D:68:F6</macaddress> - <guid>01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00</guid> - </interface> - </interfaces> - - - - - <canaldriver> <!-- Information about CANAL drivers --> - - <driver> - <name>logger</name> - <parameter>/var/log/canallog</parameter> - <path>/usr/local/lib/canallogger.so</path> - <flags>1</flags> - </driver> - - <driver> - <name>communication</name> - <parameter>/dev/ttyS0</parameter> - <path>/usr/local/lib/canalcom.so</path> - <flags>1</flags> - </driver> - - <driver> - <name>logger</name> - <parameter>/var/log/canallog</parameter> - <path>/usr/local/lib/canallogger.so</path> - <flags>1</flags> - </driver> - - <driver> - <name>xap</name> - <parameter>1681;3639</parameter> - <path>/usr/local/lib/xapdrv.so</path> - <flags>1</flags> - </driver> - - - </canaldriver> - - - - <persistent> <!-- persistant storage is here --> - - <variable type="1" > <!-- string --> - <name>testvariable1</name> - <value>This is a string</value> - </variable> - - <variable type="2" > <!-- boolean --> - <name>testvariable2</name> - <value>true</value> - </variable> - - <variable type="3" > <!-- integer --> - <name>testvariable3</name> - <value>1956</value> - </variable> - - <variable type="4" > <!-- long --> - <name>testvariable4</name> - <value>0xffffffff</value> - </variable> - - <variable type="5" > <!-- normalized integer --> - <name>testvariable5</name> - <value>0x0001020304050607</value> - </variable> - - <variable type="6" > <!-- VSCP Event --> - <name>testvariable6</name> - <value>class=10,type=40,data=0x12,1,2,3,4,5</value> - </variable> - - <array type="1"> - <name>testarray</name> - <value>10</value> - <value>11</value> - <value>22</value> - <value>33</value> - <value>144</value> - <value>1000</value> - <value>3</value> - <value>100</value> - <value>200</value> - <value>1111</value> - </array> - - </persistent> - -</vscpconfig> \ No newline at end of file Deleted: trunk/vscpd.startup_script_debian =================================================================== --- trunk/vscpd.startup_script_debian 2008-04-24 11:45:41 UTC (rev 889) +++ trunk/vscpd.startup_script_debian 2008-04-24 11:50:25 UTC (rev 890) @@ -1,39 +0,0 @@ -#!/bin/sh -# /etc/init.d/vscp -# -# Written by Ake Hedman <ak...@eu...> - -set -e - - -DAEMON=/usr/local/bin/vscpd -NAME=vscpd - -test -x $DAEMON || exit 0 -. /lib/lsb/init-functions - -case "$1" in - start) - log_begin_msg "Starting VSCP daemon: $NAME" - [ -d /var/run/vscpd ] || mkdir -p /var/run/vscpd - start-stop-daemon --start --background -m --pidfile /var/run/vscpd/vscpd.pid --exec $DAEMON && log_end_msg 0 || log_end_msg 1 - ;; - stop) - log_begin_msg "Stopping VSCP daemon: $NAME" - start-stop-daemon --stop --pidfile /var/run/vscpd/vscpd.pid --oknodo --exec $DAEMON && log_end_msg 0 || log_end_msg 1 - ;; - restart) - $0 stop - $0 start - ;; - reload|force-reload) - log_begin_msg "Reloading $NAME configuration files" - start-stop-daemon --stop --pidfile /var/run/vscpd/vscpd.pid --signal 1 --exec $DAEMON && log_end_msg 0 || log_end_msg 1 - ;; - *) - log_success_msg "Usage: /etc/init.d/$NAME {start|stop|restart|reload}" - exit 1 - ;; -esac - -exit 0 Deleted: trunk/vscpd.startup_script_fedora =================================================================== --- trunk/vscpd.startup_script_fedora 2008-04-24 11:45:41 UTC (rev 889) +++ trunk/vscpd.startup_script_fedora 2008-04-24 11:50:25 UTC (rev 890) @@ -1,80 +0,0 @@ -#!/bin/bash -# -# vscpd This shell script takes care of starting and stopping -# standalone vscpd. -# -# chkconfig: - 60 50 -# description: Vscpd is an automation daemon, which is the program \ -# that handles controldrivers and clients. -# processname: vsftpd -# config: /etc/vscp/vscp.conf or /etc/vscp.conf - -# Source function library. -. /etc/rc.d/init.d/functions - -[ -x /usr/local/bin/vscpd ] || exit 0 - -RETVAL=0 -prog="vscpd" - -start() { - # Start daemons. - - if [ -d /etc/vscp ] ; then - for i in `ls /etc/vscp/*.conf`; do - site=`basename $i .conf` - echo -n $"Starting $prog for $site: " - /usr/local/bin/vscpd $i & - RETVAL=$? - [ $RETVAL -eq 0 ] && { - touch /var/lock/subsys/$prog - success $"$prog $site" - } - echo - done - else - RETVAL=1 - fi - return $RETVAL -} - -stop() { - # Stop daemons. - echo -n $"Shutting down $prog: " - killproc $prog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog - return $RETVAL -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/$prog ]; then - stop - start - RETVAL=$? - fi - ;; - status) - status $prog - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - exit 1 -esac - -exit $RETVAL Deleted: trunk/vscpworks.conf =================================================================== --- trunk/vscpworks.conf 2008-04-24 11:45:41 UTC (rev 889) +++ trunk/vscpworks.conf 2008-04-24 11:50:25 UTC (rev 890) @@ -1,13 +0,0 @@ -<?xml version = "1.0" encoding = "UTF-8" ?> -<vscpworksconfig> -<general> -<width>0</width> -<height>0</height> -<xpos>0</xpos> -<ypos>0</ypos> -<path2tempfile>/</path2tempfile> -<path2logfile enable="false" level="0" ></path2logfile> -</general> -<vscpinterface> -</vscpinterface> -</vscpworksconfig> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-24 11:45:46
|
Revision: 889 http://can.svn.sourceforge.net/can/?rev=889&view=rev Author: akhe Date: 2008-04-24 04:45:41 -0700 (Thu, 24 Apr 2008) Log Message: ----------- VSCP moved to m2m Removed Paths: ------------- trunk/BUILD trunk/BUILD_UNIX trunk/BUILD_WIN32.txt trunk/LPC2_CANFull_V110/ trunk/ODIN/ trunk/docs/vscp/ trunk/firmware/ trunk/src/common/Comm.cpp trunk/src/common/Comm.h trunk/src/common/MSG00001.bin trunk/src/common/NTService.cpp trunk/src/common/NTService.h trunk/src/common/com.cpp trunk/src/common/com.h trunk/src/common/com_linux.cpp trunk/src/common/com_linux.h trunk/src/common/com_win32.cpp trunk/src/common/com_win32.h trunk/src/common/configfile.cpp trunk/src/common/configfile.h trunk/src/common/crc.c trunk/src/common/crc.h trunk/src/common/dl/ trunk/src/common/dllist.c trunk/src/common/dllist.h trunk/src/common/hashtable.c trunk/src/common/hashtable.cpp trunk/src/common/hashtable.h trunk/src/common/kwxIndControlSource-0.3.0/ trunk/src/common/libwxctb-0.13/ trunk/src/common/libwxctb-0.8/ trunk/src/common/md5.cpp trunk/src/common/md5.h trunk/src/common/msglog.cpp trunk/src/common/msglog.h trunk/src/common/node.cpp trunk/src/common/node.h trunk/src/common/ntservmsg.h trunk/src/common/ntservmsg.rc trunk/src/common/pdu.cpp trunk/src/common/pdu.h trunk/src/common/rscalc.c trunk/src/common/stdafx.h trunk/src/common/wxMySQL/ trunk/src/devtest/ trunk/src/vscp/ Deleted: trunk/BUILD =================================================================== --- trunk/BUILD 2008-04-20 20:51:25 UTC (rev 888) +++ trunk/BUILD 2008-04-24 11:45:41 UTC (rev 889) @@ -1,11 +0,0 @@ -Run "./configure" and then "make all" - -If you get "permission denied" when you run configure add exceution rights to it. - -wxWidgets should be installed before build. Use ANSI and DEBUg build for best results. - -automake/autoconf -================= -Check http://howto.ewtoo.org/show.cgi?howto=autoconf.txt - -Special build instructions is in BUILD_UNIX and BUILD_WIN32.txt Deleted: trunk/BUILD_UNIX =================================================================== --- trunk/BUILD_UNIX 2008-04-20 20:51:25 UTC (rev 888) +++ trunk/BUILD_UNIX 2008-04-24 11:45:41 UTC (rev 889) @@ -1,159 +0,0 @@ -To build VSCP and friends type - -".configure --enable-unicode" - -followed by - -"make" - -and "make install" as root user. - -You can use ./configure --help to get help about available switches. Use --enable-debug to use the debug -version of wxWidgets and use --enable-unicode to use the unicode version. The use of the unicode version -is recommended. - - -To compile the package you need the wxWidgets libraries (GTK2). The toolkit can be found at -http://www.wxwidgets.org. At the moment use the graphical version of the library (not base) even if you -only will use the nongraphic components. - -If you want the VSCP Works application to compile the wxWidgets library has to be configured with the ---enable-richtext otherwise it will not compile. - -Configuration files should be located in /etc/vscp and there are samples of configuration files here in the root. -The names should be vscpd.conf for the daemon and vscpworks.conf for VSCP works. The daemon can be started with -a path to a configuration file in anoter location using the -c switch. - - -Have Fun! -/Ake <ak...@do...> - - - -Common Problems and notes -========================= - - - -vscpworks does not compile -========================== -Check that you configured the wxWidgets package with --enable-richtext. If you issue "wx-config --libs" you should see the richtext library. - - - - -Problems with missing libcrypto -=============================== - -Compile complains that it can't find openssl/md5.h - -Solution: On Ubuntu at least install libssl-dev. libcurl2-opemssl-dev also works on debian etch. - - - -Complains ‘class wxXmlNode’ has no member named ‘GetNodeContent’ -================================================================ -You need wxWidgets 2.8.0 or newer. - - - ---------------------------------------------------------------------- - -Compile errors when issuing Make. This can be due to many things. One cause is that the wxBase version of the -wxWidgets library is used instead of the full library (wxGTK2 library). You can check if this is the cause of -the failure by looking in src/canal/cancmd/Makefile. The -Makefile should have a CXXFLAGS entry that looks something like below. if it have --I/usr/local/lib/wx/include/base... the base library of the wxWidgets toolkit is installed and you should -install the full version instead. - -CXXFLAGS = -g -O2 -I/usr/local/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA - - -Use "wx-config" to check wxWidgets configurations - - -Debian etch -=========== -make sure libopenssl-debv and libgtk2.0-dev is installed. Fet wxWidgets-1.8.7 or later from the wxWidgets site -and configure with - -./configure --enable-unicode - -Unsure if --enable-richtext really is needed. If you get compiants about it add the switch. - -Make the library with "make" and install it with "make install" if it compiled OK. - -tiff, gif, and librarues are needed for wxWidgets to compile install them. You can seach the package names with - -apt-cache search libxxx | grep libxx | less - -Remember to add the path to /usr/local/lib to /etc/ld.so.conf.d/i486-linux-gnu.conf and then issue "ldconfig" -after installing the libs. - -After this just build and install VSCP & Friends. - - -Fedora Core 4 -============= -libwx_gtk2_xrc-2.6.so.0 is missing when you try to start cw. This means that the path to it cant be found. Add the path to /etc/ld.conf.d (new entry with /usr/local/lib) and the problem will be resolved. - -Known configuration that compiles out of the box on Fedora Core 4 is 2.6, ansi, debug. Release build should also work. - -The wx libraries was built with the following swithes - -./configure --enable-debug --disable-unicode - -"wx-config" gives the following output - -wx-config --prefix -/usr/local - -wx-config --exec-prefix -/usr/local - -wx-config --release -2.6 - -wx-config --list - - Default config is gtk2-ansi-debug-2.6 - - Default config will be used for output - - Alternate matches: - base-ansi-debug-2.6 - base-ansi-release-2.6 - gtk2-ansi-release-2.6 - -wx-config --version -2.6.3 - -wx-config --basename -wx_gtk2d - -wx-config --cc -gcc - -wx-config --cppflags --I/usr/local/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA - -wx-config --cxxflags --I/usr/local/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA - -wx-config --libs --L/usr/local/lib -pthread -L/usr/X11R6/lib -lwx_gtk2d_xrc-2.6 -lwx_gtk2d_qa-2.6 -lwx_gtk2d_html-2.6 -lwx_gtk2d_adv-2.6 -lwx_gtk2d_core-2.6 -lwx_based_xml-2.6 -lwx_based_net-2.6 -lwx_based-2.6 - -wx-config --cxx -g++ - -wx-config --ld -g++ -shared -fPIC -o - -wx-config --linkdeps - - - - - - - Deleted: trunk/BUILD_WIN32.txt =================================================================== --- trunk/BUILD_WIN32.txt 2008-04-20 20:51:25 UTC (rev 888) +++ trunk/BUILD_WIN32.txt 2008-04-24 11:45:41 UTC (rev 889) @@ -1,36 +0,0 @@ -How Set up development environment VSCP under WIN32 -=================================================== - -1.) All files are placed relative to a drive "J" which contains the root VSCP folder. This - driver can be created with the "subst" command as "subst J: path_to_VSCP_root". There is - a batch file "setenv_vscp.bat" in the root folder that do this for a system where the files is placed in the - folder "development" of the root folder. - -2.) Install and build wxWidgets 2.6.0 or higher. 2.8.0 Recommended but others will probably - do to - -3.) Make an environment variable WXWIN that points to the wxWidgets installation directory. - (e.g. c:\wxWidgets-2.6.0). - -4.) Add the wxwin include directory to the list of include files under - tools->options->directories ($WXWIN)\include (c:\wxWidgets-2.6.0\include). - -5.) To build the APOX driver the include path (tools->options->directories) needs to point - to the FTD2DXX directory which contains FTD2XX.h This driver is available from ftdi - (http://www.ftdichip.com/). Also the library path needs to point to this directory to - find FTD2XX.LIB. - -6.) To build ccsdrv include must point to directory which contains can.h and LIB must point - to directory that contains can.lib and candbg.lib (tools->options->directories). - -7.) To build ixxatvcidrv you need to add the ixxat include directory and also add the ixxat - lib directory to LIB( Xat11Reg.lib vci11un6.lib ) (tools->options->directories). - -8.) lircdrv: expat is needed you build the lircdrv as well as winlirc. Set include in - tools->options->directories to point to expat.h in <expat install dir>/source/lib and - LIB to expat lib <expat install dir>/StaticLibs. Expat is available here - http://sourceforge.net/projects/expat/ and winlirc is here http://sourceforge.net/projects/winlirc/ - -9.) To build the vector driver (vectordrv) the INCLUDE and LIB paths must point to - to the vector directories LIB and INCLUDE. - \ No newline at end of file Deleted: trunk/src/common/Comm.cpp =================================================================== --- trunk/src/common/Comm.cpp 2008-04-20 20:51:25 UTC (rev 888) +++ trunk/src/common/Comm.cpp 2008-04-24 11:45:41 UTC (rev 889) @@ -1,314 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// COMComm.cpp: -// -// Copyright (C) 2000-2008 Ake Hedman, eurosource, <ak...@eu...> -// -// This software is placed into -// the public domain and may be used for any purpose. However, this -// notice must not be changed or removed and no warranty is either -// expressed or implied by its publication or distribution. -// -// $RCSfile: Comm.cpp,v $ -// $Date: 2005/08/30 11:00:13 $ -// $Author: akhe $ -// $Revision: 1.3 $ -/////////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "Comm.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// Constructor -// - -CComm::CComm() -{ - m_hCommPort = NULL; -} - -///////////////////////////////////////////////////////////////////////////// -// Destructor -// - -CComm::~CComm() -{ - if ( NULL != m_hCommPort ) { - CloseHandle( m_hCommPort ); - } -} - - -///////////////////////////////////////////////////////////////////////////// -// init -// - -bool CComm::init( unsigned char nComPort, - DWORD nBaudRate, - unsigned char nDatabits, - unsigned char nParity, - unsigned char nStopbits, - unsigned char nHandshake ) -{ - char szComPort[10]; - COMMTIMEOUTS ct; - DCB dcbCommPort; // ONESTOPBIT - - // Check com-port data - if ( nComPort!= 0 ) { - sprintf( szComPort, "COM%d", nComPort ); - } - else { - return false; - } - - if ( INVALID_HANDLE_VALUE == - ( m_hCommPort = CreateFile( szComPort, - GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL ) ) ) { - return false; - } - - memset( &ct, 0, sizeof( ct ) ); - - // Set timeouts - ct.ReadIntervalTimeout = 200; - ct.ReadTotalTimeoutMultiplier = 0; - ct.ReadTotalTimeoutConstant = 200; - ct.WriteTotalTimeoutMultiplier = 0; - ct.WriteTotalTimeoutConstant = 200; - SetCommTimeouts( m_hCommPort, &ct ); - - // Comm state - if ( !GetCommState( m_hCommPort, &dcbCommPort ) ) { - CloseHandle( m_hCommPort ); - return false; - } - - dcbCommPort.DCBlength = sizeof( DCB ); - dcbCommPort.BaudRate = nBaudRate; - if ( nParity != NOPARITY ) { - dcbCommPort.fParity = true; - } - else { - dcbCommPort.fParity = false; - } - - dcbCommPort.Parity = nParity; - dcbCommPort.fDtrControl = DTR_CONTROL_ENABLE; - dcbCommPort.fDsrSensitivity = DTR_CONTROL_DISABLE; - dcbCommPort.ByteSize = nDatabits; - dcbCommPort.StopBits = nStopbits; - - if ( HANDSHAKE_HARDWARE == nHandshake ) { - - // Software flow control - dcbCommPort.fOutX = FALSE; - dcbCommPort.fInX = FALSE; - - // Hardware flow control - dcbCommPort.fOutxCtsFlow = TRUE; - dcbCommPort.fOutxDsrFlow = TRUE; - - } - else if ( HANDSHAKE_SOFTWARE == nHandshake ) { - - // Software flow control - dcbCommPort.fOutX = TRUE; - dcbCommPort.fInX = TRUE; - - // Hardware flow control - dcbCommPort.fOutxCtsFlow = FALSE; - dcbCommPort.fOutxDsrFlow = FALSE; - - } - else { // HANDSHAKE_NONE - - // Software flow control - dcbCommPort.fOutX = FALSE; - dcbCommPort.fInX = FALSE; - - // Hardware flow control - dcbCommPort.fOutxCtsFlow = FALSE; - dcbCommPort.fOutxDsrFlow = FALSE; - } - - if ( !SetCommState( m_hCommPort, &dcbCommPort ) ) { - CloseHandle( m_hCommPort ); - return false; - } - - //COMMPROP prop; - //GetCommProperties( m_hCommPort, &prop ); - - return true; -} - - -///////////////////////////////////////////////////////////////////////////// -// readChar -// - -char CComm::readChar( int* cnt ) -{ - char c = 0; - DWORD dwCount; - - int result = 0; - - result = ReadFile( m_hCommPort, &c, 1, &dwCount, NULL ); - if (result == 0) { - int err = GetLastError(); - } - - *cnt = dwCount; - return c; -} - - -///////////////////////////////////////////////////////////////////////////// -// write -// - -void CComm::write( char* String, bool bCRLF, bool bNoLF ) -{ - DWORD dwCount; - char c; - - //for (int i = 0;i < ((signed)strlen(String)); i++) { - WriteFile( m_hCommPort, String, strlen( String ), &dwCount, NULL ); - //} - - if ( bCRLF ) { - c = 13; - WriteFile( m_hCommPort, &c, 1, &dwCount, NULL ); - - if ( !bNoLF ) { - c = 10; - WriteFile( m_hCommPort, &c, 1, &dwCount, NULL ); - } - } -} - - -///////////////////////////////////////////////////////////////////////////// -// write -// - -BOOL CComm::writebuf( unsigned char * p, unsigned short cnt ) -{ - DWORD dwCount; - return WriteFile( m_hCommPort, p, cnt, &dwCount, NULL ); -} - - -///////////////////////////////////////////////////////////////////////////// -// writeChar -// - -void CComm::writeChar( unsigned char b ) -{ - DWORD dwCount; - - WriteFile( m_hCommPort, &b, 1, &dwCount, NULL ); -} - - - -///////////////////////////////////////////////////////////////////////////// -// close -// - -void CComm::close() -{ - CloseHandle( m_hCommPort ); - m_hCommPort = NULL; -} - - -///////////////////////////////////////////////////////////////////////////// -// drainInput -// - -void CComm::drainInput() -{ - int cnt; - unsigned char c; - - do { - c = readChar( &cnt ); - - } while ( cnt ); -} - - -///////////////////////////////////////////////////////////////////////////// -// sendCommand -// - -bool CComm::sendCommand( char * pCmd, char *pResponse, unsigned long timeout ) -{ - bool rv = false; - DWORD tstart; - int cnt; - char buf[256]; - unsigned short pos = 0; - - memset( buf, 0, sizeof( buf ) ); - - drainInput(); - write( pCmd, true, true ); - tstart = GetTickCount(); - while ( ( GetTickCount() - tstart ) < timeout ) { - buf[ pos ] = readChar ( &cnt ); - if ( cnt ) { - if ( NULL != strstr( buf, pResponse ) ) return true; - pos++; - if ( pos > sizeof( buf ) ) break; - } - } - - return rv; -} - -///////////////////////////////////////////////////////////////////////////// -// readBuf -// - -unsigned short CComm::readBuf( char *pBuf, - unsigned short size, - short cntRead, - unsigned long timeout ) -{ - char *p = pBuf; - DWORD tstart; - int cnt; - unsigned short pos = 0; - - memset( pBuf, 0, size ); - tstart = GetTickCount(); - while ( ( GetTickCount() - tstart ) < timeout ) { - p[ pos ] = readChar ( &cnt ); - if ( cnt ) { - if ( ( -1 == cntRead ) && ( 0x0d == p[ pos ] ) ) return true; - pos++; - if ( pos > size ) break; - } - } - - return pos; -} \ No newline at end of file Deleted: trunk/src/common/Comm.h =================================================================== --- trunk/src/common/Comm.h 2008-04-20 20:51:25 UTC (rev 888) +++ trunk/src/common/Comm.h 2008-04-24 11:45:41 UTC (rev 889) @@ -1,190 +0,0 @@ -/*! - * \file Comm.h - * \brief interface for the Linux comm class. - * \author Ake Hedman, eurosource, - * \author ak...@us... - * \date 2002-2005 - * -*/ - -/////////////////////////////////////////////////////////////////////////////// -// Comm.h -// -// -// This file is part is part of CANAL (CAN Abstraction Layer) -// http://can.sourceforge.net) -// -// Copyright (C) 2000-2008 Ake Hedman, eurosource, <ak...@eu...> -// -// This software is placed into -// the public domain and may be used for any purpose. However, this -// notice must not be changed or removed and no warranty is either -// expressed or implied by its publication or distribution. -// -// $RCSfile: Comm.h,v $ -// $Date: 2005/08/30 11:00:13 $ -// $Author: akhe $ -// $Revision: 1.3 $ -/////////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_COMCOMM_H__E2F5A961_FF34_437B_91E1_8D7DEA1E94C9__INCLUDED_) -#define AFX_COMCOMM_H__E2F5A961_FF34_437B_91E1_8D7DEA1E94C9__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define HANDSHAKE_NONE 0 -#define HANDSHAKE_HARDWARE 1 -#define HANDSHAKE_SOFTWARE 2 - -/*! - * \class CCommParams - * \brief This class hat encapsulate communication parameters - * \brief for a serial communication port. - * \author Ake Hedman, eurosource, ak...@eu... - * \version 1 - * \date 2002-2005 - */ - -class CCommParams -{ - -public: - - /// The port number to use - unsigned char m_nPort; - - /// The baudrate to use - DWORD m_nBaudRate; - - /// # of stopbits to use - unsigned char m_nDatabits; - - /// Patity to use - unsigned char m_nParity; - - /// # of stopbits to use - unsigned char m_nStopbits; - -}; - -/*! \class CComm - * \brief A class that handles serial port communication. - * \author Ake Hedman, eurosource, ak...@eu... - * \version 1 - * \date 2002-2005 - */ - - -class CComm -{ - -public: - - /// Constructor - CComm(); - - /// Destructor - virtual ~CComm(); - - /*! - Initialise the serial communication port - - \param nComPort Index for communication port (default to COM1). - \param nBaudRate Baudrate for the selected port (defaults to 9600). - \param nDatabits Number of databits ( defeaults to 8 ). - \param nParity Parity (defaults to no parity ). - \param nStopbits Number of stopbits (defaults to one stopbit). - \return True on success. - */ - bool init( unsigned char nComPort=1, - DWORD nBaudRate = CBR_9600, - unsigned char nDatabits = 8, - unsigned char nParity= NOPARITY, - unsigned char nStopbits=ONESTOPBIT, - unsigned char nHandshake = HANDSHAKE_NONE ); - - /*! - Read a byte from the port (if one is available). - - \param cnt pointer to variable holding number of characters read. - \return Character read from comm port depending on param - */ - char readChar( int* cnt ); - - /*! - Read a number of bytes from the port (if available) within a - certain time. - - \param Pointer to buffer that receives data. - \param Size for buffer. - \param cntRead nr of character we want or if a negative number return - when CR is found. - \return Number of characters read or zero on timeout. - */ - unsigned short readBuf( char *p, - unsigned short size, - short cntRead = -1, - unsigned long timeout = 500 ); - - /*! - Write a string of charcters to the communication port. - - @param str String to send. - @param bCRLF If true a CRLF will be sent after the string has been sent. - @param bNoLF If true only CR is sent instead of CRLF. - */ - void write( char *str, bool bCRLF = false, bool bNoLF = false ); - - /*! - Write a buffer to the channel - - \param p Pointer to buffer that holds data that should be written. - \param cnt Number of bytes to send. - \return If the function succeeds, the return value is nonzero. - \return If the function fails, the return value is zero. - */ - BOOL writebuf( unsigned char * p, unsigned short cnt ); - - /*! - Send a byte to the communication port. - - \param b byte to send. - */ - void writeChar( unsigned char b ); - - /*! - Drain the input queue - */ - void drainInput( void ); - - /*! - Close the communication channel. - */ - void close( void ); - - /*! - sendCmd - - */ - bool sendCommand( char * pCmd, char *pResponse, unsigned long timeout = 500 ); - - /*! - Get the handle to the communication port. - - \return handle to an open communication port or NULL if - \return the port is't open. - */ - HANDLE getHandle( void ) { return m_hCommPort; }; - -private : - - /*! - Handle to the communication port - */ - HANDLE m_hCommPort; - -}; - -#endif // !defined(AFX_COMCOMM_H__E2F5A961_FF34_437B_91E1_8D7DEA1E94C9__INCLUDED_) Deleted: trunk/src/common/MSG00001.bin =================================================================== (Binary files differ) Deleted: trunk/src/common/NTService.cpp =================================================================== --- trunk/src/common/NTService.cpp 2008-04-20 20:51:25 UTC (rev 888) +++ trunk/src/common/NTService.cpp 2008-04-24 11:45:41 UTC (rev 889) @@ -1,683 +0,0 @@ -// NTService.cpp -// -// Implementation of CNTService - -#ifdef __GNUG__ - //#pragma implementation -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -#ifdef __WXMSW__ - #include "wx/ownerdrw.h" -#endif - - -//#include "stdafx.h" -//#include <windows.h> -//#include <stdio.h> -#include "NTService.h" - -// -// Global variables. -// - -HANDLE ghStopEvent; -HANDLE ghThreads[ MAX_THREADS ]; - -// static variables -CNTService* CNTService::m_pThis = NULL; - - -/////////////////////////////////////////////////////////////////////////////// -// CNTService -// - -CNTService::CNTService( const char * szServiceName ) -{ - // copy the address of the current object so we can access it from - // the static member callback functions. - // WARNING: This limits the application to only one CNTService object. - m_pThis = this; - - // Set the default service name and version - strncpy( m_szServiceName, szServiceName, sizeof( m_szServiceName ) - 1 ); - m_iMajorVersion = 0; - m_iMinorVersion = 1; - m_hEventSource = NULL; - - // No threads running yet - for (int i=0; i<MAX_THREADS; i++ ) { - ghThreads[ i ] = NULL; - } - - // set up the initial service status - m_hServiceStatus = NULL; - m_Status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; - m_Status.dwCurrentState = SERVICE_STOPPED; - m_Status.dwControlsAccepted = SERVICE_ACCEPT_STOP; - m_Status.dwWin32ExitCode = 0; - m_Status.dwServiceSpecificExitCode = 0; - m_Status.dwCheckPoint = 0; - m_Status.dwWaitHint = 0; - m_bIsRunning = false; - - // Create the event to signal the service to stop. - ghStopEvent = CreateEvent( NULL, true, false, NULL ); -} - -/////////////////////////////////////////////////////////////////////////////// -// ~CNTService -// - - -CNTService::~CNTService() -{ - DebugMsg("CNTService::~CNTService()"); - if ( m_hEventSource ) { - ::DeregisterEventSource( m_hEventSource ); - } -} - -/////////////////////////////////////////////////////////////////////////////// -// ParseStandardArgs -// - - -BOOL CNTService::ParseStandardArgs(int argc, char* argv[]) -{ - // See if we have any command line args we recognise - if ( argc <= 1 ) { - return false; - } - - // * * * -v Check version * * * - if ( _stricmp(argv[1], "-v") == 0 ) { - // Spit out version info - printf("%s Version %d.%d\n", - m_szServiceName, m_iMajorVersion, m_iMinorVersion); - printf("The service is %s installed\n", - IsInstalled() ? "currently" : "not"); - return true; // say we processed the argument - - } - // * * * -i Install * * * - else if (_stricmp(argv[1], "-i") == 0) { - // Request to install. - if ( IsInstalled() ) { - printf("%s is already installed\n", m_szServiceName); - } - else { - // Try and install the copy that's running - if ( Install() ) { - printf("%s installed\n", m_szServiceName); - } - else { - printf("%s failed to install. Error %d\n", m_szServiceName, GetLastError()); - } - } - - return true; // say we processed the argument - - } - // * * * -u Uninstall * * * - else if ( _stricmp(argv[1], "-u" ) == 0) { - - // Request to uninstall. - if ( !IsInstalled() ) { - printf("%s is not installed\n", m_szServiceName); - } - else { - // Try and remove the copy that's installed - if ( Uninstall() ) { - // Get the executable file path - char szFilePath[_MAX_PATH]; - ::GetModuleFileName(NULL, szFilePath, sizeof(szFilePath)); - printf("%s removed. (You must delete the file (%s) yourself.)\n", - m_szServiceName, szFilePath); - } - else { - printf("Could not remove %s. Error %d\n", m_szServiceName, GetLastError()); - } - } - - return true; // say we processed the argument - } - // * * * -? Show available commands * * * - else if ( _stricmp(argv[1], "-?") == 0 ) { - showHelp(); - return true; - } - // * * * -? Show available commands * * * - else if ( _stricmp(argv[1], "-h") == 0 ) { - showHelp(); - return true; - } - - // Don't recognise the args - return false; -} - -/////////////////////////////////////////////////////////////////////////////// -// showHelp -// -// - -void CNTService::showHelp( void ) -{ - printf("\nCanalService - (C) 2001-2005 eurosource\n"); - printf("=======================================\n\n"); - printf("Command line switches.\n"); - printf("----------------------\n"); - printf("\"no switch\"\tStart the service.\n"); - printf(" -i\t\tInstall the service.\n"); - printf(" -u\t\tUninstall the service.\n"); - printf(" -v\t\tDisplay service information.\n"); - printf(" -?\t\tDisplay this help information.\n"); - printf(" -h\t\tDisplay this help information.\n\n\n"); -} - - -/////////////////////////////////////////////////////////////////////////////// -// Install/uninstall routines -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// IsInstalled -// - -BOOL CNTService::IsInstalled() -{ - BOOL bResult = FALSE; - - // Open the Service Control Manager - SC_HANDLE hSCM = ::OpenSCManager( NULL, // local machine - NULL, // ServicesActive database - SC_MANAGER_ALL_ACCESS); // full access - if ( hSCM ) { - // Try to open the service - SC_HANDLE hService = ::OpenService( hSCM, - m_szServiceName, - SERVICE_QUERY_CONFIG); - if ( hService ) { - bResult = TRUE; - ::CloseServiceHandle( hService ); - } - - ::CloseServiceHandle( hSCM ); - } - - return bResult; -} - -/////////////////////////////////////////////////////////////////////////////// -// Install -// -// - -BOOL CNTService::Install() -{ - // Open the Service Control Manager - SC_HANDLE hSCM = ::OpenSCManager( NULL, // local machine - NULL, // ServicesActive database - SC_MANAGER_ALL_ACCESS); // full access - if ( !hSCM ) { - return FALSE; - } - - // Get the executable file path - char szFilePath[_MAX_PATH]; - ::GetModuleFileName(NULL, szFilePath, sizeof(szFilePath)); - - // Create the service - SC_HANDLE hService = ::CreateService( hSCM, - m_szServiceName, - m_szServiceName, - SERVICE_ALL_ACCESS, - SERVICE_WIN32_OWN_PROCESS, - SERVICE_DEMAND_START, // start condition - SERVICE_ERROR_NORMAL, - szFilePath, - NULL, - NULL, - NULL, - NULL, - NULL ); - if ( !hService ) { - ::CloseServiceHandle(hSCM); - return FALSE; - } - - // make registry entries to support logging messages - // Add the source name as a subkey under the Application - // key in the EventLog service portion of the registry. - char szKey[256]; - HKEY hKey = NULL; - strcpy( szKey, "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\" ); - strcat( szKey, m_szServiceName ); - if ( ::RegCreateKey(HKEY_LOCAL_MACHINE, szKey, &hKey) != ERROR_SUCCESS ) { - ::CloseServiceHandle( hService ); - ::CloseServiceHandle( hSCM ); - return FALSE; - } - - // Add the Event ID message-file name to the 'EventMessageFile' subkey. - ::RegSetValueEx( hKey, - "EventMessageFile", - 0, - REG_EXPAND_SZ, - (CONST BYTE*)szFilePath, - strlen(szFilePath) + 1 ); - - // Set the supported types flags. - DWORD dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE; - ::RegSetValueEx( hKey, - "TypesSupported", - 0, - REG_DWORD, - (CONST BYTE*)&dwData, - sizeof(DWORD) ); - ::RegCloseKey(hKey); - - LogEvent( EVENTLOG_INFORMATION_TYPE, EVMSG_INSTALLED, m_szServiceName ); - - // tidy up - ::CloseServiceHandle( hService ); - ::CloseServiceHandle( hSCM ); - - return TRUE; -} - -/////////////////////////////////////////////////////////////////////////////// -// Uninstall -// -// - -BOOL CNTService::Uninstall() -{ - // Open the Service Control Manager - SC_HANDLE hSCM = ::OpenSCManager( NULL, // local machine - NULL, // ServicesActive database - SC_MANAGER_ALL_ACCESS ); // full access - if (!hSCM) return FALSE; - - BOOL bResult = FALSE; - SC_HANDLE hService = ::OpenService( hSCM, - m_szServiceName, - DELETE ); - if ( hService ) { - if ( ::DeleteService( hService ) ) { - LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_REMOVED, m_szServiceName); - bResult = TRUE; - } - else { - LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_NOTREMOVED, m_szServiceName); - } - ::CloseServiceHandle(hService); - } - - ::CloseServiceHandle(hSCM); - return bResult; -} - -/////////////////////////////////////////////////////////////////////////////// -// Logging functions -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// LogEvent -// -// This function makes an entry into the application event log -// - -void CNTService::LogEvent(WORD wType, DWORD dwID, - const char* pszS1, - const char* pszS2, - const char* pszS3) -{ - const char* ps[3]; - ps[0] = pszS1; - ps[1] = pszS2; - ps[2] = pszS3; - - int iStr = 0; - for ( int i = 0; i < 3; i++ ) { - if ( ps[i] != NULL ) { - iStr++; - } - } - - // Check the event source has been registered and if - // not then register it now - if ( !m_hEventSource ) { - m_hEventSource = ::RegisterEventSource( NULL, // local machine - m_szServiceName); // source name - } - - if ( m_hEventSource ) { - ::ReportEvent(m_hEventSource, - wType, - 0, - dwID, - NULL, // sid - iStr, - 0, - ps, - NULL); - } -} - -/////////////////////////////////////////////////////////////////////////////// -// StartService -// -// Service startup and registration -// - -BOOL CNTService::StartService() -{ - SERVICE_TABLE_ENTRY st[] = - { - { m_szServiceName, ServiceMain }, - { NULL, NULL } - }; - - DebugMsg("Calling StartServiceCtrlDispatcher()"); - BOOL b = ::StartServiceCtrlDispatcher( st ); - DebugMsg("Returned from StartServiceCtrlDispatcher()"); - - return b; -} - -/////////////////////////////////////////////////////////////////////////////// -// ServiceMain -// -// static member function (callback) -// - -void CNTService::ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv) -{ - // Get a pointer to the C++ object - CNTService* pService = m_pThis; - - pService->DebugMsg("Entering CNTService::ServiceMain()"); - - // Register the control request handler - pService->m_Status.dwCurrentState = SERVICE_START_PENDING; - pService->m_hServiceStatus = RegisterServiceCtrlHandler(pService->m_szServiceName, - Handler); - if ( pService->m_hServiceStatus == NULL ) { - pService->LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_CTRLHANDLERNOTINSTALLED); - return; - } - - // Start the initialisation - if ( pService->Initialize() ) { - // Do the real work. - // When the Run function returns, the service has stopped. - pService->m_bIsRunning = true; - pService->m_Status.dwWin32ExitCode = 0; - pService->m_Status.dwCheckPoint = 0; - pService->m_Status.dwWaitHint = 0; - pService->Run(); - } - - - // Now wait for threads to exit. - DWORD dwWaitRes; - if ( ( dwWaitRes = WaitForMultipleObjects( MAX_THREADS, ghThreads, TRUE, 3000 ) ) - == WAIT_OBJECT_0 ) { - // This is OK! Nothing more to do..... - ; - } - else if ( ( dwWaitRes == WAIT_FAILED ) || ( dwWaitRes == WAIT_ABANDONED ) ) { - // We failed to kill the threads we have to - // abort anyway but we tell the world that we do so.... - pService->DebugMsg("Failed to terminate all threads in CNTService::ServiceMain()"); - } - - // close the event handle and the thread handle - CloseHandle( ghStopEvent ); - for (int i=0; i<MAX_THREADS; i++ ) { - if ( ghThreads[i] ) { - CloseHandle( ghThreads[i] ); - } - } - - // Tell the service manager we are stopped - pService->SetStatus( SERVICE_STOPPED ); - - pService->DebugMsg("Leaving CNTService::ServiceMain()"); -} - -/////////////////////////////////////////////////////////////////////////////// -// status functions -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// SetStatus -// -// - -void CNTService::SetStatus(DWORD dwState) -{ - DebugMsg("CNTService::SetStatus(%lu, %lu)", m_hServiceStatus, dwState); - m_Status.dwCurrentState = dwState; - ::SetServiceStatus(m_hServiceStatus, &m_Status); -} - -/////////////////////////////////////////////////////////////////////////////// -// Initialize -// -// Service initialization -// - -BOOL CNTService::Initialize() -{ - DebugMsg("Entering CNTService::Initialize()"); - - // Start the initialization - SetStatus(SERVICE_START_PENDING); - - // Perform the actual initialization - BOOL bResult = OnInit(); - - // Set final state - m_Status.dwWin32ExitCode = GetLastError(); - m_Status.dwCheckPoint = 0; - m_Status.dwWaitHint = 0; - if ( !bResult ) { - LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_FAILEDINIT); - SetStatus(SERVICE_STOPPED); - return FALSE; - } - - LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_STARTED); - SetStatus(SERVICE_RUNNING); - - DebugMsg("Leaving CNTService::Initialize()"); - return TRUE; -} - -/////////////////////////////////////////////////////////////////////////////// -// Run -// -// main function to do the real work of the service -// -// This function performs the main work of the service. -// When this function returns the service has stopped. -// - -void CNTService::Run() -{ - DebugMsg("Entering CNTService::Run()"); - - while ( m_bIsRunning ) { - DebugMsg("Sleeping..."); - Sleep(5000); - } - - // nothing more to do - DebugMsg("Leaving CNTService::Run()"); -} - -/////////////////////////////////////////////////////////////////////////////// -// Handler -// -// Control request handlers -// -// static member function (callback) to handle commands from the -// service control manager -// - -void CNTService::Handler( DWORD dwOpcode ) -{ - // Get a pointer to the object - CNTService* pService = m_pThis; - - pService->DebugMsg("CNTService::Handler(%lu)", dwOpcode); - - switch ( dwOpcode ) { - - case SERVICE_CONTROL_STOP: // 1 - pService->SetStatus(SERVICE_STOP_PENDING); - pService->OnStop(); - pService->m_bIsRunning = false; - pService->LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_STOPPED); - break; - - case SERVICE_CONTROL_PAUSE: // 2 - pService->OnPause(); - break; - - case SERVICE_CONTROL_CONTINUE: // 3 - pService->OnContinue(); - break; - - case SERVICE_CONTROL_INTERROGATE: // 4 - pService->OnInterrogate(); - break; - - case SERVICE_CONTROL_SHUTDOWN: // 5 - pService->OnShutdown(); - break; - - default: - if ( dwOpcode >= SERVICE_CONTROL_USER ) { - if (!pService->OnUserControl( dwOpcode ) ) { - pService->LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_BADREQUEST); - } - } - else { - pService->LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_BADREQUEST); - } - break; - } - - // Report current status - pService->DebugMsg("Updating status (%lu, %lu)", - pService->m_hServiceStatus, - pService->m_Status.dwCurrentState); - ::SetServiceStatus(pService->m_hServiceStatus, &pService->m_Status); -} - -/////////////////////////////////////////////////////////////////////////////// -// OnInit -// - -BOOL CNTService::OnInit() -{ - DebugMsg("CNTService::OnInit()"); - return TRUE; -} - -/////////////////////////////////////////////////////////////////////////////// -// OnStop -// - -void CNTService::OnStop() -{ - DebugMsg("CNTService::OnStop()"); -} - -/////////////////////////////////////////////////////////////////////////////// -// OnInterrogate -// - -void CNTService::OnInterrogate() -{ - DebugMsg("CNTService::OnInterrogate()"); -} - -/////////////////////////////////////////////////////////////////////////////// -// OnPause -// -// - -void CNTService::OnPause() -{ - DebugMsg("CNTService::OnPause()"); -} - -/////////////////////////////////////////////////////////////////////////////// -// OnContinue -// -// - -void CNTService::OnContinue() -{ - DebugMsg("CNTService::OnContinue()"); -} - -/////////////////////////////////////////////////////////////////////////////// -// OnShutdown -// -// - -void CNTService::OnShutdown() -{ - DebugMsg("CNTService::OnShutdown()"); -} - -/////////////////////////////////////////////////////////////////////////////// -// OnUserControl -// -// - -BOOL CNTService::OnUserControl( DWORD dwOpcode ) -{ - DebugMsg("CNTService::OnUserControl(%8.8lXH)", dwOpcode); - return FALSE; // say not handled -} - - -/////////////////////////////////////////////////////////////////////////////// -// Debugging support -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// DebugMsg -// -// - -void CNTService::DebugMsg(const char* pszFormat, ...) -{ - char buf[1024]; - sprintf( buf, "[%s](%lu): ", m_szServiceName, GetCurrentThreadId() ); - va_list arglist; - va_start( arglist, pszFormat ); - vsprintf( &buf[strlen(buf)], pszFormat, arglist ); - va_end( arglist ); - strcat( buf, "\n" ); - OutputDebugString( buf ); -} - Deleted: trunk/src/common/NTService.h =================================================================== --- trunk/src/common/NTService.h 2008-04-20 20:51:25 UTC (rev 888) +++ trunk/src/common/NTService.h 2008-04-24 11:45:41 UTC (rev 889) @@ -1,216 +0,0 @@ -// ntservice.h -// -// Definitions for CNTService -// - -#ifndef _NTSERVICE_H_ -#define _NTSERVICE_H_ - -#include "ntservmsg.h" // Event message ids - -/// Service code for user codes -#define SERVICE_CONTROL_USER 128 - -/// Mamimum number of concurrent threads -#define MAX_THREADS 256 - -/** - Windows NT Service Base class - - Derive from this base class to implement a Windows NT - userspace service. The model can use many (MAX_THREADS) separate threads - of excecution. An active thread must have its handle in the hThreads - list. A dead/killed thread should have NULL for its handle in the same - list. - - Put initialization code in OnInit. - The application loop is placed in Run. - -*/ - -class CNTService -{ - -public: - - /// Constructor - CNTService(const char* szServiceName); - - /// Destructor - virtual ~CNTService(); - - /** - Parse command line argument. - - @param argc number of arguments. - @param argv vector with string arguments. - - @return Returns TRUE if it found an arg it recognised, FALSE if not - Note: processing some arguments causes output to stdout to - be generated. - */ - BOOL ParseStandardArgs(int argc, char* argv[]); - - /** - Show help message. - - Gives information about valid command line switches. - */ - void showHelp( void ); - - /** - Check if service is installed. - - @return TRUE if successfull false otherwise. - */ - BOOL IsInstalled(); - - /** - Install service. - - @return TRUE if successfull false otherwise.. - */ - BOOL Install(); - - /** - Uninstall service - - @return TRUE if successfull false otherwise.. - */ - BOOL Uninstall(); - - /** - Log event to NT application message log. - - @param wType - @param dwID - @param pszS1 - @param pszS2 - @param pszS3 - */ - void LogEvent(WORD wType, DWORD dwID, - const char* pszS1 = NULL, - const char* pszS2 = NULL, - const char* pszS3 = NULL); - - /** - Start the service. - - @return TRUE if successfull false otherwise.. - */ - BOOL StartService(); - - /** - Set status for service. - */ - void SetStatus(DWORD dwState); - - /** - Initialize service - - @return TRUE if successfull false otherwise.. - */ - BOOL Initialize(); - - /** - Execution loop for service in its active state. - */ - virtual void Run( void ); - - /** - Called when the service is first initialized. - - @return TRUE if successfull false otherwise. - */ - virtual BOOL OnInit( void ); - - /** - Called when the service control manager wants to stop the service. - - */ - virtual void OnStop(void ); - - /** - Called when the service is interrogated. - - */ - virtual void OnInterrogate( void ); - - /** - Called when the service is paused. - - */ - virtual void OnPause( void ); - - /** - Called when the service is continued. - - */ - virtual void OnContinue( void ); - - /** - Called when the service is shut down. - - */ - virtual void OnShutdown( void ); - - /** - Called when the service gets a user control message. - - @return TRUE if successfull false otherwise. - - */ - virtual BOOL OnUserControl( DWORD dwOpcode ); - - /** - Send debug message. - - */ - void DebugMsg(const char* pszFormat, ...); - - - /**@name static member functions */ - //@{ - /// ServiceMain entry. - static void WINAPI ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv); - - /// Handler entry. - static void WINAPI Handler(DWORD dwOpcode); - //@} - -public: - // data members - - /// Name of service. - char m_szServiceName[64]; - - /// Major version number. - int m_iMajorVersion; - - /// Minor version number. - int m_iMinorVersion; - - /// Handle to service status. - SERVICE_STATUS_HANDLE m_hServiceStatus; - - /// The current service status value. - SERVICE_STATUS m_Status; - - /// State variable - True if service is running. - bool m_bIsRunning; - - /**@name static member functions */ - //@{ static data - - /// nasty hack to get object ptr - static CNTService* m_pThis; - //@} - -private: - - /// Handle to event source - HANDLE m_hEventSource; - -}; - -#endif // _NTSERVICE_H_ Deleted: trunk/src/common/com.cpp =================================================================== --- trunk/src/common/com.cpp 2008-04-20 20:51:25 UTC (rev 888) +++ trunk/src/common/com.cpp 2008-04-24 11:45:41 UTC (rev 889) @@ -1,638 +0,0 @@ -/*! - * \file com.cpp - * \brief implementation file for the Linux comm class. - * \author Ake Hedman, CC Systems AB, - * \author ak...@us... - * \date 2002-2003 - * - * -// Copyright (C) 2000-2008 Ake Hedman, eurosource, <ak...@eu...> -// -// This software is placed into -// the public domain and may be used for any purpose. However, this -// notice must not be changed or removed and no warranty is either -// expressed or implied by its publication or distribution. - * - * HISTORY - * ======= - * 020629 - * Handling error returs from readChar in drainInput. - * - */ - -#define _POSIX -#include <stdio.h> -#include <unistd.h> -#include <pthread.h> -#include <time.h> -#include "com.h" - - -/////////////////////////////////////////////////////////////////////////////// -// Constructor - -Comm::Comm( void ) -{ - pthread_mutex_init( &m_mutex, NULL ); - m_fd = 0; -} - -/////////////////////////////////////////////////////////////////////////////// -// Destructor - -Comm::~Comm( void ) -{ - close(); - pthread_mutex_destroy( &m_mutex ); -} - - -/////////////////////////////////////////////////////////////////////////////// -// open - -bool Comm::open( char *szDevice ) -{ - // Not allowed to open if already open - if ( m_fd != 0 ) return false; - - if ( NULL != szDevice ) { - if ( -1 == ( m_fd = ::open( szDevice, O_RDWR | O_NONBLOCK ) ) ) { - return false; - } - } - else { - if ( -1 == ( m_fd = ::open( m_szDevice, O_RDWR | O_NONBLOCK ) ) ) { - return false; - } - } - flock( m_fd, LOCK_EX ); - return true; -} - - -/////////////////////////////////////////////////////////////////////////////// -// comm_gets -// -// Get string (max is maximum chars to read) from COM port. -// - -int Comm::comm_gets( char *Buffer, int max ) -{ - unsigned char c; - int x=0; - Buffer = NULL; - do { - read( m_fd, &c, 1 ); - Buffer[ x++ ] = c; - } while( isCharReady() && ( x<max ) ); - Buffer[x-1]=0; - return x; -} - -/////////////////////////////////////////////////////////////////////////////// -// comm_gets -// -// Get a string of characters with timeout -// - -int Comm::comm_gets( char *Buffer, int nChars, long timeout ) -{ - fd_set filedescr; - struct timeval tval; - int cnt; - int us_to = 0; - int s_to = 0; - - if ( timeout > 1000000 ) { - s_to = ( timeout/1000000 ); - - if ( s_to > 60 ) s_to = 60; // max one minute - us_to = timeout - ( long )s_to*1000000L; - } - else { - us_to = timeout; - } - - // loop to wait until each byte is available and read it - for ( cnt = 0; cnt < nChars; cnt++ ) { - // set a descriptor to wait for a character available - FD_ZERO( &filedescr ); - FD_SET( m_fd, &filedescr ); - - // set timeout - tval.tv_sec = s_to; - tval.tv_usec = us_to; - - // if byte available read or return bytes read - if ( select( m_fd+1, &filedescr, NULL, NULL, &tval ) != 0 ) { - if ( read( m_fd, &Buffer[cnt], 1 ) != 1 ) { - return cnt; - } - } - else { - return cnt; - } - } - - // success, so return desired length - return nChars; -} - -/////////////////////////////////////////////////////////////////////////////// -// comm_puts -// -// Put characters on COM port. -// - -int Comm::comm_puts(char *Buffer, bool bDrain ) -{ - int rv = write( m_fd, Buffer, strlen( Buffer ) ); - - if ( bDrain ) { - Drain(); - } - - return rv; -} - -/////////////////////////////////////////////////////////////////////////////// -// comm_puts -// -// Send an array of characters - -int Comm::comm_puts( char *Buffer, int len, bool bDrain ) -{ - int rv = write( m_fd, Buffer, len ); - - if ( bDrain ) { - Drain(); - } - - return rv; -} - - -/////////////////////////////////////////////////////////////////////////////// -// comm_getc -// -// Get Character from COM port. -// - -unsigned char Comm::comm_getc(void) -{ - unsigned char c = 0; - read( m_fd, &c, 1 ); - return c; -} - -/////////////////////////////////////////////////////////////////////////////// -// readChar -// -// Get Character from COM port. -// - -char Comm::readChar( int *cnt ) -{ - unsigned char c = 0; - - *cnt = read( m_fd, &c, 1 ); - return c; -} - -/////////////////////////////////////////////////////////////////////////////// -// comm_putc -// -// Put Character on COM port. -// - -void Comm::comm_putc(unsigned char c, bool bDrain ) -{ - write( m_fd, &c, 1 ); - //printf("Char=%2X\n", c ); - - if ( bDrain ) { - Drain(); - } -} - -/////////////////////////////////////////////////////////////////////////////// -// setHWFlow -// -// Set hardware flow control. -// - -void Comm::setHWFlow( int on ) -{ - struct termios tty; - - tcgetattr(m_fd, &tty); - if (on) { - tty.c_cflag |= CRTSCTS; - } - else { - tty.c_cflag &= ~CRTSCTS; - } - - tcsetattr(m_fd, TCSANOW, &tty); -} - -/////////////////////////////////////////////////////////////////////////////// -// ToggleDTR -// -// Toggle DTR. -// - -void Comm::ToggleDTR( int delay ) -{ - int f; - f = TIOCM_DTR; - ioctl( m_fd, TIOCMBIC, &f ); - if ( 0 < delay ) { - sleep( delay ); - } - ioctl( m_fd, TIOCMBIS, &f ); -} - -/////////////////////////////////////////////////////////////////////////////// -// SendBreak -// -// Send break. -// - -void Comm::SendBreak( void ) -{ - tcsendbreak(m_fd, 0); -} - - -/////////////////////////////////////////////////////////////////////////////// -// getDCD -// -// Get carrier status. -// - -int Comm::getDCD( void ) - -{ - int mcs; - - ioctl(m_fd, TIOCMGET, &mcs); - return(mcs & TIOCM_CAR ? 1 : 0); -} - -/////////////////////////////////////////////////////////////////////////////// -// Flush -// -// Flush output que. -// - -void Comm::Flush( void ) -{ - ioctl( m_fd, TCFLSH, 2); -} - -/////////////////////////////////////////////////////////////////////////////// -// Drain -// -// Drain output que. -// - -void Comm::Drain( void ) -{ - tcdrain( m_fd ); -} - -/////////////////////////////////////////////////////////////////////////////// -// FlushInQue -// - -void Comm::FlushInQue( void ) -{ - while( isCharReady() ) { - comm_getc(); - } -} - -/////////////////////////////////////////////////////////////////////////////// -// isCharReady -// -// Check if there are available characters. -// - -int Comm::isCharReady( void ) -{ - long i = -1; - - (void) ioctl( m_fd, FIONREAD, &i ); - return( (int)i ); -} - -/////////////////////////////////////////////////////////////////////////////// -// getMaxBaud -// -// Get maximum baudrate. -// - -int Comm::getMaxBaud( void ) -{ -#ifdef B115200 - return(1152); -#elif defined(B57600) - return(576); -#elif defined(B38400) - return(384); -#elif defined(EXTB) - return(384); -#elif defined(B19200) - return(192); -#elif defined(EXTA) - return(192); -#else - return(96); -#endif -} - -/////////////////////////////////////////////////////////////////////////////// -// DtrOn -// -// Turn on DTR. -// - -void Comm::DtrOn() -{ - int f; - f = TIOCM_DTR; - ioctl( m_fd, TIOCMBIS, &f ); -} - -/////////////////////////////////////////////////////////////////////////////// -// DtrOff -// -// Turn off DTR. -// - -void Comm::DtrOff() -{ - int f; - f = TIOCM_DTR; - ioctl( m_fd, TIOCMBIC, &f ); -} - -/////////////////////////////////////////////////////////////////////////////// -// RtsOn -// -// Turn on RTS. -// - -void Comm::RtsOn() -{ - int f; - f = TIOCM_RTS; - ioctl( m_fd, TIOCMBIS, &f ); -} - -/////////////////////////////////////////////////////////////////////////////// -// RtsOff -// -// Turn off RTS. -// - -void Comm::RtsOff() -{ - int f; - f = TIOCM_RTS; - ioctl( m_fd, TIOCMBIC, &f ); -} - -/////////////////////////////////////////////////////////////////////////////// -// isTransmitterEmpty -// -// get_lsr_info - get line status register info -// -// Let user call ioctl() to get info when the UART physically -// is emptied. On bus types like RS485, the transmitter must -// release the bus after transmitting. This must be done when -// the transmit shift register is empty, not be done when the -// transmit holding register is empty. This functionality -// allows an RS485 driver to be written in user space. -// TIOCSER_TEMT -// -// These are the definitions for the Line Status Register -// -//#define UART_LSR_TEMT 0x40 Transmitter empty -//#define UART_LSR_THRE 0x20 Transmit-hold-register empty - -int Comm::isTransmitterEmpty() -{ - int rv; - ioctl( m_fd, TIOCSERGETLSR, &rv ); - return rv; -} - -/////////////////////////////////////////////////////////////////////////////// -// setParam -// -// Set port parameters. -// - -void Comm::setParam( char *baud, - char *parity, - char *bits, - int HWFlow, - int SWFlow ) -{ - int spd = -1; - int newbaud; - int bit = bits[0]; - struct termios tty; - - tcgetattr(m_fd, &tty); - - // We generate mark and space parity ourself. - if ( bit == '7' && ( parity[0] == 'M' || parity[0] == 'S' ) ) { - bit = '8'; - } - - // Check if 'baudr' is really a number - if ( ( newbaud = ( atol(baud) / 100)) == 0 && baud[0] != '0') { - newbaud = -1; - } - - switch( newbaud ) { - case 0: -#ifdef B0 - spd = B0; - break; -#else - spd = 0; - break; -#endif - case 3: - spd = B300; - break; - - case 6: - spd = B600; - break; - - case 12: - spd = B1200; - break; - case 24: - spd = B2400; - break; - case 48: - spd = B4800; - break; - case 96: - spd = B9600; - break; -#ifdef B19200 - case 192: - spd = B19200; - break; -#else /* B19200 */ -# ifdef EXTA - case 192: - spd = EXTA; - break; -# else /* EXTA */ - case 192: - spd = B9600; - break; -# endif /* EXTA */ -#endif /* B19200 */ -#ifdef B38400 - case 384: - spd = B38400; - break; -#else /* B38400 */ -# ifdef EXTB - case 384: - spd = EXTB; - break; -# else /* EXTB */ - case 384: - spd = B9600; - break; -# endif /* EXTB */ -#endif /* B38400 */ -#ifdef B57600 - case 576: - spd = B57600; - break; -#endif -#ifdef B115200 - case 1152: - spd = B115200; - break; -#endif - } // Switch - - - if (spd != -1) { - cfsetospeed( &tty, (speed_t)spd ); - cfsetispeed( &tty, (speed_t)spd ); - } - - switch (bit) { - case '5': - tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS5; - break; - - case '6': - tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS6; - break; - - case '7': - tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS7; - break; - - case '8': - default: - tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8; - break; - } - - // Set into raw, no echo mode - tty.c_iflag = IGNBRK; - tty.c_lflag = 0; - tty.c_oflag = 0; - tty.c_cflag |= CLOCAL | CREAD; -#ifdef _DCDFLOW - tty.c_cflag &= ~CRTSCTS; -#endif - tty.c_cc[VMIN] = 1; - tty.c_cc[VTIME] = 5; - - if ( SWFlow ) { - tty.c_iflag |= IXON | IXOFF; - - } - else { - tty.c_iflag &= ~(IXON|IXOFF|IXANY); - } - - tty.c_cflag &= ~(PARENB | PARODD); - if (parity[0] == 'E') { - tty.c_cflag |= PARENB; - } - else if (parity[0] == 'O') { - tty.c_cflag |= PARODD; - } - - tcsetattr( m_fd, TCSANOW, &tty ); - RtsOn(); - -#ifndef _DCDFLOW - setHWFlow( HWFlow ); -#endif -} - -/////////////////////////////////////////////////////////////////////////////// -// msGettick -//-------------------------------------------------------------------------- -// Get the current millisecond tick count. Does not have to represent -// an actual time, it just needs to be an incrementing timer. -// - -long Comm::msGettick(void) -{ - struct timezone tmzone; - struct timeval tmval; - long ms; - - gettimeofday(&tmval,&tmzone); - ms = (tmval.tv_sec & 0xFFFF) * 1000 + tmval.tv_usec / 1000; - return ms; -} - -/////////////////////////////////////////////////////////////////////////////// -// msDelay -//-------------------------------------------------------------------------- -// Description: -// Delay for at least 'len' ms -// - -void Comm::msDelay(int len) -{ - struct timespec s; // Set aside memory space on the stack - - s.tv_sec = len / 1000; - s.tv_nsec = (len - (s.tv_sec * 1000)) * 1000000; - nanosleep(&s, NULL); -} - -/////////////////////////////////////////////////////////////////////////////// -// drainInput - -void Comm::drainInput( void ) -{ - int cnt; - char c; - - do { - c = readChar( &cnt ); - } while (cnt && ( -1 != cnt) ); -} - Deleted: trunk/src/common/com.h =================================================================== --- trunk/src/common/com.h 2008-04-20 20:51:25 UTC (rev 888) +++ trunk/src/common/com.h 2008-04-24 11:45:41 UTC (rev 889) @@ -1,309 +0,0 @@ -/*! - * \file com.h - * \brief interface for the Linux comm class. - * \author Ake Hedman, CC Systems AB, - * \author ak...@us... - * \date 2002-2003 - * -// Copyright (C) 2000-2008 Ake Hedman, eurosource, <ak...@eu...> -// -// This software is placed into -// the public domain and may be used for any purpose. However, this -// notice must not be changed or removed and no warranty is either -// expressed or implied by its publication or distribution. - * - * This class wraps and extends Minicom. - * see ftp://ftp.sunsite.unc.edu/pub/Linux/apps/serialcomm/dialout - * - * Some changes by ak...@br... ( www.brattberg.com ) done for the - * M.U.M.I.N. protocol. - * - * - Sorry no more sysdep. Works only on Linux systems ( maybe on others ). - * - */ - -// $RCSfile: com.h,v $ -// $Date: 2005/08/30 11:00:13 $ -// $Author: akhe $ -// $Revision: 1.3 $ - -#ifndef H_COM_H -#define H_COM_H - -#include <termios.h> -#include <stdio.h> -#include <setjmp.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/file.h> -#include <sys/ioctl.h> -#include <fcntl.h> -#include <string.h> - -/*! \class CComm - * \brief A class that handles serial port communication. - * \author Mickael Ericsson - * \version 1 - * \date 2002-2003 - */ - -class Comm -{ - -public: - - // Constructors - - /// Constructor - Comm( void ); - - /*! - Constructor - \param Device Open the named device - */ - Comm(char *Device) { m_fd = 0; open( Device ); } - - /*! - Constructor - \param fd Open a device from a descriptor - */ - Comm(int fd) { m_f... [truncated message content] |
From: <ak...@us...> - 2008-04-20 20:51:46
|
Revision: 888 http://can.svn.sourceforge.net/can/?rev=888&view=rev Author: akhe Date: 2008-04-20 13:51:25 -0700 (Sun, 20 Apr 2008) Log Message: ----------- Added some missing files, Added Paths: ----------- trunk/src/vscp/drivers/rs485/README trunk/src/vscp/samples/vscpbutton/configuration.cpp trunk/src/vscp/samples/vscpbutton/configuration.h trunk/src/vscp/samples/vscpbutton/configuration_symbols.h trunk/src/vscp/samples/vscpbutton/vscpbutton.cpp trunk/src/vscp/samples/vscpbutton/vscpbutton.h trunk/src/vscp/samples/vscpbutton/vscpbutton_symbols.h Added: trunk/src/vscp/drivers/rs485/README =================================================================== --- trunk/src/vscp/drivers/rs485/README (rev 0) +++ trunk/src/vscp/drivers/rs485/README 2008-04-20 20:51:25 UTC (rev 888) @@ -0,0 +1 @@ +Prototype for a RS-485 driver. Added: trunk/src/vscp/samples/vscpbutton/configuration.cpp =================================================================== --- trunk/src/vscp/samples/vscpbutton/configuration.cpp (rev 0) +++ trunk/src/vscp/samples/vscpbutton/configuration.cpp 2008-04-20 20:51:25 UTC (rev 888) @@ -0,0 +1,431 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configuration.cpp +// Purpose: +// Author: Ake Hedman +// Modified by: +// Created: Sat 15 Dec 2007 16:52:56 CET +// RCS-ID: +// Copyright: Copyright (C) 2007 D of Scandinavia +// Licence: +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +////@begin includes +#include "wx/bookctrl.h" +////@end includes + +#include "configuration.h" + +////@begin XPM images +////@end XPM images + + +/*! + * Configuration type definition + */ + +IMPLEMENT_DYNAMIC_CLASS( Configuration, wxPropertySheetDialog ) + + +/*! + * Configuration event table definition + */ + +BEGIN_EVENT_TABLE( Configuration, wxPropertySheetDialog ) + +////@begin Configuration event table entries +////@end Configuration event table entries + +END_EVENT_TABLE() + + +/*! + * Configuration constructors + */ + +Configuration::Configuration() +{ + Init(); +} + +Configuration::Configuration( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +{ + Init(); + Create(parent, id, caption, pos, size, style); +} + + +/*! + * Configuration creator + */ + +bool Configuration::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +{ +////@begin Configuration creation + SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS); + wxPropertySheetDialog::Create( parent, id, caption, pos, size, style ); + + SetSheetStyle(wxPROPSHEET_DEFAULT); + CreateButtons(wxOK|wxCANCEL|wxHELP); + CreateControls(); + LayoutDialog(); + Centre(); +////@end Configuration creation + return true; +} + + +/*! + * Configuration destructor + */ + +Configuration::~Configuration() +{ +////@begin Configuration destruction +////@end Configuration destruction +} + + +/*! + * Member initialisation + */ + +void Configuration::Init() +{ +////@begin Configuration member initialisation + m_RemoteServerDescription = NULL; + m_RemoteServerURL = NULL; + m_RemoteServerPort = NULL; + m_RemoteServerUsername = NULL; + m_RemoteServerPassword = NULL; + m_strVscpClass = NULL; + m_strVscpType = NULL; + m_wxChoicePriority = NULL; + m_strGUID15 = NULL; + m_wxStrGUID14 = NULL; + m_wxStrGUID13 = NULL; + m_wxStrGUID12 = NULL; + m_wxStrGUID11 = NULL; + m_wxStrGUID10 = NULL; + m_wxStrGUID9 = NULL; + m_wxStrGUID8 = NULL; + m_wxStrGUID7 = NULL; + m_wxStrGUID6 = NULL; + m_wxStrGUID5 = NULL; + m_wxStrGUID4 = NULL; + m_wxStrGUID3 = NULL; + m_wxStrGUID2 = NULL; + m_wxStrGUID1 = NULL; + m_wxStrGUID0 = NULL; + m_strVscpData = NULL; + m_strNote = NULL; +////@end Configuration member initialisation +} + + +/*! + * Control creation for Configuration + */ + +void Configuration::CreateControls() +{ +////@begin Configuration content construction + Configuration* itemPropertySheetDialog1 = this; + + wxPanel* itemPanel2 = new wxPanel; + itemPanel2->Create( GetBookCtrl(), ID_PANEL_HOST_SETTINGS, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); + itemPanel2->SetSizer(itemBoxSizer3); + + wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer3->Add(itemBoxSizer5, 0, wxALIGN_RIGHT|wxALL, 1); + wxStaticText* itemStaticText6 = new wxStaticText; + itemStaticText6->Create( itemPanel2, wxID_STATIC, _("Description:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_RemoteServerDescription = new wxTextCtrl; + m_RemoteServerDescription->Create( itemPanel2, ID_TEXTCTRL18, _T(""), wxDefaultPosition, wxSize(400, -1), 0 ); + itemBoxSizer5->Add(m_RemoteServerDescription, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer3->Add(itemBoxSizer8, 0, wxALIGN_RIGHT|wxALL, 1); + wxStaticText* itemStaticText9 = new wxStaticText; + itemStaticText9->Create( itemPanel2, wxID_STATIC, _("Server URL:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer8->Add(itemStaticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_RemoteServerURL = new wxTextCtrl; + m_RemoteServerURL->Create( itemPanel2, ID_TEXTCTRL19, _("localhost"), wxDefaultPosition, wxSize(400, -1), 0 ); + itemBoxSizer8->Add(m_RemoteServerURL, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer3->Add(itemBoxSizer11, 0, wxALIGN_RIGHT|wxALL, 1); + wxStaticText* itemStaticText12 = new wxStaticText; + itemStaticText12->Create( itemPanel2, wxID_STATIC, _("Server port:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer11->Add(itemStaticText12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_RemoteServerPort = new wxTextCtrl; + m_RemoteServerPort->Create( itemPanel2, ID_TEXTCTRL20, _("9598"), wxDefaultPosition, wxSize(50, -1), 0 ); + itemBoxSizer11->Add(m_RemoteServerPort, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + itemBoxSizer11->Add(348, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer3->Add(itemBoxSizer15, 0, wxALIGN_RIGHT|wxALL, 1); + wxStaticText* itemStaticText16 = new wxStaticText; + itemStaticText16->Create( itemPanel2, wxID_STATIC, _("Username:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer15->Add(itemStaticText16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_RemoteServerUsername = new wxTextCtrl; + m_RemoteServerUsername->Create( itemPanel2, ID_TEXTCTRL21, _T(""), wxDefaultPosition, wxSize(200, -1), 0 ); + itemBoxSizer15->Add(m_RemoteServerUsername, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + itemBoxSizer15->Add(200, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer3->Add(itemBoxSizer19, 0, wxALIGN_RIGHT|wxALL, 1); + wxStaticText* itemStaticText20 = new wxStaticText; + itemStaticText20->Create( itemPanel2, wxID_STATIC, _("Password:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer19->Add(itemStaticText20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_RemoteServerPassword = new wxTextCtrl; + m_RemoteServerPassword->Create( itemPanel2, ID_TEXTCTRL22, _T(""), wxDefaultPosition, wxSize(200, -1), wxTE_PASSWORD ); + itemBoxSizer19->Add(m_RemoteServerPassword, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + itemBoxSizer19->Add(200, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer3->Add(itemBoxSizer23, 0, wxALIGN_RIGHT|wxALL, 5); + + wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer3->Add(itemBoxSizer24, 0, wxALIGN_RIGHT|wxALL, 5); + wxButton* itemButton25 = new wxButton; + itemButton25->Create( itemPanel2, ID_BUTTON, _("Test connection"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer24->Add(itemButton25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + itemBoxSizer24->Add(285, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + GetBookCtrl()->AddPage(itemPanel2, _("Host")); + + wxPanel* itemPanel27 = new wxPanel; + itemPanel27->Create( GetBookCtrl(), ID_PANEL_EVENT_SETTINGS, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL); + itemPanel27->SetSizer(itemBoxSizer28); + + wxBoxSizer* itemBoxSizer29 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer28->Add(itemBoxSizer29, 0, wxALIGN_TOP|wxALL, 5); + itemBoxSizer29->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxBoxSizer* itemBoxSizer31 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer28->Add(itemBoxSizer31, 0, wxALIGN_TOP|wxALL, 5); + wxFlexGridSizer* itemFlexGridSizer32 = new wxFlexGridSizer(2, 2, 0, 0); + itemBoxSizer31->Add(itemFlexGridSizer32, 1, wxALIGN_TOP|wxALL, 1); + wxStaticText* itemStaticText33 = new wxStaticText; + itemStaticText33->Create( itemPanel27, wxID_STATIC, _("Class :"), wxDefaultPosition, wxDefaultSize, 0 ); + itemStaticText33->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); + itemFlexGridSizer32->Add(itemStaticText33, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 1); + + wxArrayString m_strVscpClassStrings; + m_strVscpClass = new wxComboBox; + m_strVscpClass->Create( itemPanel27, ID_COMBOBOX, _T(""), wxDefaultPosition, wxSize(200, -1), m_strVscpClassStrings, wxCB_DROPDOWN ); + itemFlexGridSizer32->Add(m_strVscpClass, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 1); + + wxStaticText* itemStaticText35 = new wxStaticText; + itemStaticText35->Create( itemPanel27, wxID_STATIC, _("Type :"), wxDefaultPosition, wxDefaultSize, 0 ); + itemStaticText35->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); + itemFlexGridSizer32->Add(itemStaticText35, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 1); + + wxArrayString m_strVscpTypeStrings; + m_strVscpType = new wxComboBox; + m_strVscpType->Create( itemPanel27, ID_COMBOBOX1, _T(""), wxDefaultPosition, wxSize(200, -1), m_strVscpTypeStrings, wxCB_DROPDOWN ); + itemFlexGridSizer32->Add(m_strVscpType, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 1); + + wxStaticText* itemStaticText37 = new wxStaticText; + itemStaticText37->Create( itemPanel27, wxID_STATIC, _("Priority :"), wxDefaultPosition, wxDefaultSize, 0 ); + itemStaticText37->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); + itemFlexGridSizer32->Add(itemStaticText37, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 1); + + wxArrayString m_wxChoicePriorityStrings; + m_wxChoicePriorityStrings.Add(_("0 - Highest")); + m_wxChoicePriorityStrings.Add(_("1 - Even higher")); + m_wxChoicePriorityStrings.Add(_("2 - Higher")); + m_wxChoicePriorityStrings.Add(_("3 - Normal high")); + m_wxChoicePriorityStrings.Add(_("4 - Normal low")); + m_wxChoicePriorityStrings.Add(_("5 - Lower")); + m_wxChoicePriorityStrings.Add(_("6 - Even lower")); + m_wxChoicePriorityStrings.Add(_("7 - Lowest")); + m_wxChoicePriority = new wxChoice; + m_wxChoicePriority->Create( itemPanel27, ID_CHOICE, wxDefaultPosition, wxSize(120, -1), m_wxChoicePriorityStrings, 0 ); + m_wxChoicePriority->SetStringSelection(_("0")); + itemFlexGridSizer32->Add(m_wxChoicePriority, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 1); + + itemFlexGridSizer32->Add(5, 5, 0, wxALIGN_LEFT|wxALIGN_TOP|wxRIGHT|wxTOP|wxBOTTOM, 2); + + itemFlexGridSizer32->Add(5, 5, 0, wxALIGN_LEFT|wxALIGN_TOP|wxRIGHT|wxTOP|wxBOTTOM, 2); + + itemFlexGridSizer32->Add(5, 5, 0, wxALIGN_LEFT|wxALIGN_TOP|wxRIGHT|wxTOP|wxBOTTOM, 2); + + wxStaticText* itemStaticText42 = new wxStaticText; + itemStaticText42->Create( itemPanel27, wxID_STATIC, _("GUID"), wxDefaultPosition, wxDefaultSize, 0 ); + itemStaticText42->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); + itemFlexGridSizer32->Add(itemStaticText42, 1, wxALIGN_LEFT|wxALIGN_TOP|wxALL|wxADJUST_MINSIZE, 0); + + wxStaticText* itemStaticText43 = new wxStaticText; + itemStaticText43->Create( itemPanel27, wxID_STATIC, _("15 - 8 :"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); + itemStaticText43->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); + itemFlexGridSizer32->Add(itemStaticText43, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 1); + + wxBoxSizer* itemBoxSizer44 = new wxBoxSizer(wxHORIZONTAL); + itemFlexGridSizer32->Add(itemBoxSizer44, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 1); + m_strGUID15 = new wxTextCtrl; + m_strGUID15->Create( itemPanel27, ID_TEXTCTRL, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer44->Add(m_strGUID15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID14 = new wxTextCtrl; + m_wxStrGUID14->Create( itemPanel27, ID_TEXTCTRL1, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer44->Add(m_wxStrGUID14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID13 = new wxTextCtrl; + m_wxStrGUID13->Create( itemPanel27, ID_TEXTCTRL2, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer44->Add(m_wxStrGUID13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID12 = new wxTextCtrl; + m_wxStrGUID12->Create( itemPanel27, ID_TEXTCTRL3, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer44->Add(m_wxStrGUID12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID11 = new wxTextCtrl; + m_wxStrGUID11->Create( itemPanel27, ID_TEXTCTRL4, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer44->Add(m_wxStrGUID11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID10 = new wxTextCtrl; + m_wxStrGUID10->Create( itemPanel27, ID_TEXTCTRL5, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer44->Add(m_wxStrGUID10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID9 = new wxTextCtrl; + m_wxStrGUID9->Create( itemPanel27, ID_TEXTCTRL6, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer44->Add(m_wxStrGUID9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID8 = new wxTextCtrl; + m_wxStrGUID8->Create( itemPanel27, ID_TEXTCTRL7, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer44->Add(m_wxStrGUID8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + wxStaticText* itemStaticText53 = new wxStaticText; + itemStaticText53->Create( itemPanel27, wxID_STATIC, _("7 - 0 :"), wxDefaultPosition, wxDefaultSize, 0 ); + itemStaticText53->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); + itemFlexGridSizer32->Add(itemStaticText53, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 1); + + wxBoxSizer* itemBoxSizer54 = new wxBoxSizer(wxHORIZONTAL); + itemFlexGridSizer32->Add(itemBoxSizer54, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1); + m_wxStrGUID7 = new wxTextCtrl; + m_wxStrGUID7->Create( itemPanel27, ID_TEXTCTRL8, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer54->Add(m_wxStrGUID7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID6 = new wxTextCtrl; + m_wxStrGUID6->Create( itemPanel27, ID_TEXTCTRL9, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer54->Add(m_wxStrGUID6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID5 = new wxTextCtrl; + m_wxStrGUID5->Create( itemPanel27, ID_TEXTCTRL10, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer54->Add(m_wxStrGUID5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID4 = new wxTextCtrl; + m_wxStrGUID4->Create( itemPanel27, ID_TEXTCTRL11, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer54->Add(m_wxStrGUID4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID3 = new wxTextCtrl; + m_wxStrGUID3->Create( itemPanel27, ID_TEXTCTRL12, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer54->Add(m_wxStrGUID3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID2 = new wxTextCtrl; + m_wxStrGUID2->Create( itemPanel27, ID_TEXTCTRL13, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer54->Add(m_wxStrGUID2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID1 = new wxTextCtrl; + m_wxStrGUID1->Create( itemPanel27, ID_TEXTCTRL14, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer54->Add(m_wxStrGUID1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + m_wxStrGUID0 = new wxTextCtrl; + m_wxStrGUID0->Create( itemPanel27, ID_TEXTCTRL15, _("0"), wxDefaultPosition, wxSize(40, -1), wxTE_RIGHT ); + itemBoxSizer54->Add(m_wxStrGUID0, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); + + wxStaticText* itemStaticText63 = new wxStaticText; + itemStaticText63->Create( itemPanel27, wxID_STATIC, _("Data :"), wxDefaultPosition, wxDefaultSize, 0 ); + itemStaticText63->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); + itemFlexGridSizer32->Add(itemStaticText63, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 1); + + m_strVscpData = new wxTextCtrl; + m_strVscpData->Create( itemPanel27, ID_TEXTCTRL16, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); + if (Configuration::ShowToolTips()) + m_strVscpData->SetToolTip(_("You enter data for the event as a comma separated list. You can arrange the data on lines. Hexadecimal values should be preceded with '0x'.")); + itemFlexGridSizer32->Add(m_strVscpData, 2, wxGROW|wxALIGN_TOP|wxALL, 1); + + itemFlexGridSizer32->Add(5, 5, 0, wxALIGN_LEFT|wxALIGN_TOP|wxRIGHT|wxTOP|wxBOTTOM, 2); + + itemFlexGridSizer32->Add(5, 5, 0, wxALIGN_LEFT|wxALIGN_TOP|wxRIGHT|wxTOP|wxBOTTOM, 2); + + wxStaticText* itemStaticText67 = new wxStaticText; + itemStaticText67->Create( itemPanel27, wxID_STATIC, _("Note :"), wxDefaultPosition, wxDefaultSize, 0 ); + itemStaticText67->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); + itemFlexGridSizer32->Add(itemStaticText67, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 1); + + m_strNote = new wxTextCtrl; + m_strNote->Create( itemPanel27, ID_TEXTCTRL17, _T(""), wxDefaultPosition, wxSize(-1, 50), 0 ); + itemFlexGridSizer32->Add(m_strNote, 2, wxGROW|wxALIGN_TOP|wxALL, 1); + + wxBoxSizer* itemBoxSizer69 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer28->Add(itemBoxSizer69, 0, wxALIGN_BOTTOM|wxALL, 1); + wxBoxSizer* itemBoxSizer70 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer69->Add(itemBoxSizer70, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + GetBookCtrl()->AddPage(itemPanel27, _("Event")); + +////@end Configuration content construction +} + + +/*! + * Should we show tooltips? + */ + +bool Configuration::ShowToolTips() +{ + return true; +} + +/*! + * Get bitmap resources + */ + +wxBitmap Configuration::GetBitmapResource( const wxString& name ) +{ + // Bitmap retrieval +////@begin Configuration bitmap retrieval + wxUnusedVar(name); + return wxNullBitmap; +////@end Configuration bitmap retrieval +} + +/*! + * Get icon resources + */ + +wxIcon Configuration::GetIconResource( const wxString& name ) +{ + // Icon retrieval +////@begin Configuration icon retrieval + wxUnusedVar(name); + return wxNullIcon; +////@end Configuration icon retrieval +} Added: trunk/src/vscp/samples/vscpbutton/configuration.h =================================================================== --- trunk/src/vscp/samples/vscpbutton/configuration.h (rev 0) +++ trunk/src/vscp/samples/vscpbutton/configuration.h 2008-04-20 20:51:25 UTC (rev 888) @@ -0,0 +1,148 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configuration.h +// Purpose: +// Author: Ake Hedman +// Modified by: +// Created: Sat 15 Dec 2007 16:52:56 CET +// RCS-ID: +// Copyright: Copyright (C) 2007 D of Scandinavia +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifndef _CONFIGURATION_H_ +#define _CONFIGURATION_H_ + + +/*! + * Includes + */ + +////@begin includes +#include "configuration_symbols.h" +#include "wx/propdlg.h" +////@end includes + +/*! + * Forward declarations + */ + +////@begin forward declarations +////@end forward declarations + +/*! + * Control identifiers + */ + +////@begin control identifiers +#define ID_CONFIGURATION 10002 +#define ID_PANEL_HOST_SETTINGS 10003 +#define ID_TEXTCTRL18 10018 +#define ID_TEXTCTRL19 10019 +#define ID_TEXTCTRL20 10020 +#define ID_TEXTCTRL21 10024 +#define ID_TEXTCTRL22 10025 +#define ID_BUTTON 10026 +#define ID_PANEL_EVENT_SETTINGS 10001 +#define ID_COMBOBOX 10000 +#define ID_COMBOBOX1 10004 +#define ID_CHOICE 10005 +#define ID_TEXTCTRL 10006 +#define ID_TEXTCTRL1 10007 +#define ID_TEXTCTRL2 10008 +#define ID_TEXTCTRL3 10009 +#define ID_TEXTCTRL4 10010 +#define ID_TEXTCTRL5 10011 +#define ID_TEXTCTRL6 10012 +#define ID_TEXTCTRL7 10013 +#define ID_TEXTCTRL8 10014 +#define ID_TEXTCTRL9 10015 +#define ID_TEXTCTRL10 10016 +#define ID_TEXTCTRL11 10017 +#define ID_TEXTCTRL12 10021 +#define ID_TEXTCTRL13 10022 +#define ID_TEXTCTRL14 10023 +#define ID_TEXTCTRL15 10032 +#define ID_TEXTCTRL16 10035 +#define ID_TEXTCTRL17 10036 +#define SYMBOL_CONFIGURATION_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX +#define SYMBOL_CONFIGURATION_TITLE _("Configuration") +#define SYMBOL_CONFIGURATION_IDNAME ID_CONFIGURATION +#define SYMBOL_CONFIGURATION_SIZE wxSize(400, 300) +#define SYMBOL_CONFIGURATION_POSITION wxDefaultPosition +////@end control identifiers + + +/*! + * Configuration class declaration + */ + +class Configuration: public wxPropertySheetDialog +{ + DECLARE_DYNAMIC_CLASS( Configuration ) + DECLARE_EVENT_TABLE() + +public: + /// Constructors + Configuration(); + Configuration( wxWindow* parent, wxWindowID id = SYMBOL_CONFIGURATION_IDNAME, const wxString& caption = SYMBOL_CONFIGURATION_TITLE, const wxPoint& pos = SYMBOL_CONFIGURATION_POSITION, const wxSize& size = SYMBOL_CONFIGURATION_SIZE, long style = SYMBOL_CONFIGURATION_STYLE ); + + /// Creation + bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CONFIGURATION_IDNAME, const wxString& caption = SYMBOL_CONFIGURATION_TITLE, const wxPoint& pos = SYMBOL_CONFIGURATION_POSITION, const wxSize& size = SYMBOL_CONFIGURATION_SIZE, long style = SYMBOL_CONFIGURATION_STYLE ); + + /// Destructor + ~Configuration(); + + /// Initialises member variables + void Init(); + + /// Creates the controls and sizers + void CreateControls(); + +////@begin Configuration event handler declarations + +////@end Configuration event handler declarations + +////@begin Configuration member function declarations + + /// Retrieves bitmap resources + wxBitmap GetBitmapResource( const wxString& name ); + + /// Retrieves icon resources + wxIcon GetIconResource( const wxString& name ); +////@end Configuration member function declarations + + /// Should we show tooltips? + static bool ShowToolTips(); + +////@begin Configuration member variables + wxTextCtrl* m_RemoteServerDescription; + wxTextCtrl* m_RemoteServerURL; + wxTextCtrl* m_RemoteServerPort; + wxTextCtrl* m_RemoteServerUsername; + wxTextCtrl* m_RemoteServerPassword; + wxComboBox* m_strVscpClass; + wxComboBox* m_strVscpType; + wxChoice* m_wxChoicePriority; + wxTextCtrl* m_strGUID15; + wxTextCtrl* m_wxStrGUID14; + wxTextCtrl* m_wxStrGUID13; + wxTextCtrl* m_wxStrGUID12; + wxTextCtrl* m_wxStrGUID11; + wxTextCtrl* m_wxStrGUID10; + wxTextCtrl* m_wxStrGUID9; + wxTextCtrl* m_wxStrGUID8; + wxTextCtrl* m_wxStrGUID7; + wxTextCtrl* m_wxStrGUID6; + wxTextCtrl* m_wxStrGUID5; + wxTextCtrl* m_wxStrGUID4; + wxTextCtrl* m_wxStrGUID3; + wxTextCtrl* m_wxStrGUID2; + wxTextCtrl* m_wxStrGUID1; + wxTextCtrl* m_wxStrGUID0; + wxTextCtrl* m_strVscpData; + wxTextCtrl* m_strNote; +////@end Configuration member variables +}; + +#endif + // _CONFIGURATION_H_ Added: trunk/src/vscp/samples/vscpbutton/configuration_symbols.h =================================================================== --- trunk/src/vscp/samples/vscpbutton/configuration_symbols.h (rev 0) +++ trunk/src/vscp/samples/vscpbutton/configuration_symbols.h 2008-04-20 20:51:25 UTC (rev 888) @@ -0,0 +1,40 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configuration_symbols.h +// Purpose: Symbols file +// Author: Ake Hedman +// Modified by: +// Created: Sat 15 Dec 2007 17:02:50 CET +// RCS-ID: +// Copyright: Copyright (C) 2007 D of Scandinavia +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#define ID_CONFIGURATION_SYMBOL_0 _("Description:") +#define ID_CONFIGURATION_SYMBOL_1 _("Server URL:") +#define ID_CONFIGURATION_SYMBOL_2 _("localhost") +#define ID_CONFIGURATION_SYMBOL_3 _("Server port:") +#define ID_CONFIGURATION_SYMBOL_4 _("9598") +#define ID_CONFIGURATION_SYMBOL_5 _("Username:") +#define ID_CONFIGURATION_SYMBOL_6 _("Password:") +#define ID_CONFIGURATION_SYMBOL_7 _("Test connection") +#define ID_CONFIGURATION_SYMBOL_8 _("Host") +#define ID_CONFIGURATION_SYMBOL_9 _("Class :") +#define ID_CONFIGURATION_SYMBOL_10 _("Type :") +#define ID_CONFIGURATION_SYMBOL_11 _("Priority :") +#define ID_CONFIGURATION_SYMBOL_12 _("0 - Highest") +#define ID_CONFIGURATION_SYMBOL_13 _("1 - Even higher") +#define ID_CONFIGURATION_SYMBOL_14 _("2 - Higher") +#define ID_CONFIGURATION_SYMBOL_15 _("3 - Normal high") +#define ID_CONFIGURATION_SYMBOL_16 _("4 - Normal low") +#define ID_CONFIGURATION_SYMBOL_17 _("5 - Lower") +#define ID_CONFIGURATION_SYMBOL_18 _("6 - Even lower") +#define ID_CONFIGURATION_SYMBOL_19 _("7 - Lowest") +#define ID_CONFIGURATION_SYMBOL_20 _("0") +#define ID_CONFIGURATION_SYMBOL_21 _("GUID") +#define ID_CONFIGURATION_SYMBOL_22 _("15 - 8 :") +#define ID_CONFIGURATION_SYMBOL_23 _("7 - 0 :") +#define ID_CONFIGURATION_SYMBOL_24 _("Data :") +#define ID_CONFIGURATION_SYMBOL_25 _("You enter data for the event as a comma separated list. You can arrange the data on lines. Hexadecimal values should be preceded with '0x'.") +#define ID_CONFIGURATION_SYMBOL_26 _("Note :") +#define ID_CONFIGURATION_SYMBOL_27 _("Event") +#define ID_CONFIGURATION_SYMBOL_28 _("Configuration") Added: trunk/src/vscp/samples/vscpbutton/vscpbutton.cpp =================================================================== --- trunk/src/vscp/samples/vscpbutton/vscpbutton.cpp (rev 0) +++ trunk/src/vscp/samples/vscpbutton/vscpbutton.cpp 2008-04-20 20:51:25 UTC (rev 888) @@ -0,0 +1,171 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: vscpbutton.cpp +// Purpose: +// Author: Ake Hedman +// Modified by: +// Created: Sat 15 Dec 2007 16:00:05 CET +// RCS-ID: +// Copyright: Copyright (C) 2007 D of Scandinavia +// Licence: +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +////@begin includes +////@end includes + +#include "vscpbutton.h" + +////@begin XPM images +////@end XPM images + + +/*! + * VSCPButton type definition + */ + +IMPLEMENT_DYNAMIC_CLASS( VSCPButton, wxDialog ) + + +/*! + * VSCPButton event table definition + */ + +BEGIN_EVENT_TABLE( VSCPButton, wxDialog ) + +////@begin VSCPButton event table entries +////@end VSCPButton event table entries + +END_EVENT_TABLE() + + +/*! + * VSCPButton constructors + */ + +VSCPButton::VSCPButton() +{ + Init(); +} + +VSCPButton::VSCPButton( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +{ + Init(); + Create(parent, id, caption, pos, size, style); +} + + +/*! + * VSCPButton creator + */ + +bool VSCPButton::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +{ +////@begin VSCPButton creation + SetExtraStyle(wxWS_EX_BLOCK_EVENTS); + wxDialog::Create( parent, id, caption, pos, size, style ); + + CreateControls(); + if (GetSizer()) + { + GetSizer()->SetSizeHints(this); + } + Centre(); +////@end VSCPButton creation + return true; +} + + +/*! + * VSCPButton destructor + */ + +VSCPButton::~VSCPButton() +{ +////@begin VSCPButton destruction +////@end VSCPButton destruction +} + + +/*! + * Member initialisation + */ + +void VSCPButton::Init() +{ +////@begin VSCPButton member initialisation +////@end VSCPButton member initialisation +} + + +/*! + * Control creation for VSCPButton + */ + +void VSCPButton::CreateControls() +{ +////@begin VSCPButton content construction + VSCPButton* itemDialog1 = this; + + wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); + itemDialog1->SetSizer(itemBoxSizer2); + + wxToolBar* itemToolBar3 = new wxToolBar; + itemToolBar3->Create( itemDialog1, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL ); + wxBitmap itemtool4Bitmap(wxNullBitmap); + wxBitmap itemtool4BitmapDisabled; + itemToolBar3->AddTool(ID_TOOL, _T(""), itemtool4Bitmap, itemtool4BitmapDisabled, wxITEM_NORMAL, _T(""), wxEmptyString); + itemToolBar3->Realize(); + itemBoxSizer2->Add(itemToolBar3, 0, wxALIGN_LEFT|wxALL, 5); + + wxBitmapButton* itemBitmapButton5 = new wxBitmapButton; + itemBitmapButton5->Create( itemDialog1, ID_TOGGLEBUTTON1, wxNullBitmap, wxDefaultPosition, wxSize(200, 100), wxBU_AUTODRAW ); + itemBoxSizer2->Add(itemBitmapButton5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + +////@end VSCPButton content construction +} + + +/*! + * Should we show tooltips? + */ + +bool VSCPButton::ShowToolTips() +{ + return true; +} + +/*! + * Get bitmap resources + */ + +wxBitmap VSCPButton::GetBitmapResource( const wxString& name ) +{ + // Bitmap retrieval +////@begin VSCPButton bitmap retrieval + wxUnusedVar(name); + return wxNullBitmap; +////@end VSCPButton bitmap retrieval +} + +/*! + * Get icon resources + */ + +wxIcon VSCPButton::GetIconResource( const wxString& name ) +{ + // Icon retrieval +////@begin VSCPButton icon retrieval + wxUnusedVar(name); + return wxNullIcon; +////@end VSCPButton icon retrieval +} Added: trunk/src/vscp/samples/vscpbutton/vscpbutton.h =================================================================== --- trunk/src/vscp/samples/vscpbutton/vscpbutton.h (rev 0) +++ trunk/src/vscp/samples/vscpbutton/vscpbutton.h 2008-04-20 20:51:25 UTC (rev 888) @@ -0,0 +1,96 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: vscpbutton.h +// Purpose: +// Author: Ake Hedman +// Modified by: +// Created: Sat 15 Dec 2007 16:00:06 CET +// RCS-ID: +// Copyright: Copyright (C) 2007 D of Scandinavia +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifndef _VSCPBUTTON_H_ +#define _VSCPBUTTON_H_ + + +/*! + * Includes + */ + +////@begin includes +#include "vscpbutton_symbols.h" +#include "wx/toolbar.h" +////@end includes + +/*! + * Forward declarations + */ + +////@begin forward declarations +////@end forward declarations + +/*! + * Control identifiers + */ + +////@begin control identifiers +#define ID_VSCPBUTTON 10000 +#define ID_TOOLBAR 10004 +#define ID_TOOL 10005 +#define ID_TOGGLEBUTTON1 10001 +#define SYMBOL_VSCPBUTTON_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL +#define SYMBOL_VSCPBUTTON_TITLE _("VSCP Button") +#define SYMBOL_VSCPBUTTON_IDNAME ID_VSCPBUTTON +#define SYMBOL_VSCPBUTTON_SIZE wxSize(400, 300) +#define SYMBOL_VSCPBUTTON_POSITION wxDefaultPosition +////@end control identifiers + + +/*! + * VSCPButton class declaration + */ + +class VSCPButton: public wxDialog +{ + DECLARE_DYNAMIC_CLASS( VSCPButton ) + DECLARE_EVENT_TABLE() + +public: + /// Constructors + VSCPButton(); + VSCPButton( wxWindow* parent, wxWindowID id = SYMBOL_VSCPBUTTON_IDNAME, const wxString& caption = SYMBOL_VSCPBUTTON_TITLE, const wxPoint& pos = SYMBOL_VSCPBUTTON_POSITION, const wxSize& size = SYMBOL_VSCPBUTTON_SIZE, long style = SYMBOL_VSCPBUTTON_STYLE ); + + /// Creation + bool Create( wxWindow* parent, wxWindowID id = SYMBOL_VSCPBUTTON_IDNAME, const wxString& caption = SYMBOL_VSCPBUTTON_TITLE, const wxPoint& pos = SYMBOL_VSCPBUTTON_POSITION, const wxSize& size = SYMBOL_VSCPBUTTON_SIZE, long style = SYMBOL_VSCPBUTTON_STYLE ); + + /// Destructor + ~VSCPButton(); + + /// Initialises member variables + void Init(); + + /// Creates the controls and sizers + void CreateControls(); + +////@begin VSCPButton event handler declarations + +////@end VSCPButton event handler declarations + +////@begin VSCPButton member function declarations + + /// Retrieves bitmap resources + wxBitmap GetBitmapResource( const wxString& name ); + + /// Retrieves icon resources + wxIcon GetIconResource( const wxString& name ); +////@end VSCPButton member function declarations + + /// Should we show tooltips? + static bool ShowToolTips(); + +////@begin VSCPButton member variables +////@end VSCPButton member variables +}; + +#endif + // _VSCPBUTTON_H_ Added: trunk/src/vscp/samples/vscpbutton/vscpbutton_symbols.h =================================================================== --- trunk/src/vscp/samples/vscpbutton/vscpbutton_symbols.h (rev 0) +++ trunk/src/vscp/samples/vscpbutton/vscpbutton_symbols.h 2008-04-20 20:51:25 UTC (rev 888) @@ -0,0 +1,12 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: vscpbutton_symbols.h +// Purpose: Symbols file +// Author: Ake Hedman +// Modified by: +// Created: Sat 15 Dec 2007 16:58:02 CET +// RCS-ID: +// Copyright: Copyright (C) 2007 D of Scandinavia +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#define ID_VSCPBUTTON_SYMBOL_0 _("VSCP Button") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-20 20:45:58
|
Revision: 887 http://can.svn.sourceforge.net/can/?rev=887&view=rev Author: akhe Date: 2008-04-20 13:45:55 -0700 (Sun, 20 Apr 2008) Log Message: ----------- Added MDF Editor dialog Modified Paths: -------------- trunk/src/vscp/common/mdf.cpp trunk/src/vscp/common/mdf.h trunk/src/vscp/vscpworks/frmmain.cpp trunk/src/vscp/vscpworks/frmmain.h trunk/src/vscp/vscpworks/frmmain_symbols.h trunk/src/vscp/vscpworks/readmsfurl.cpp trunk/src/vscp/vscpworks/readmsfurl.h trunk/src/vscp/vscpworks/readmsfurl_symbols.h trunk/src/vscp/vscpworks/vscpworks.dsp trunk/src/vscp/vscpworks/vscpworks.pjd Added Paths: ----------- trunk/src/vscp/vscpworks/mdfeditor.cpp trunk/src/vscp/vscpworks/mdfeditor.h trunk/src/vscp/vscpworks/mdfeditor_symbols.h Modified: trunk/src/vscp/common/mdf.cpp =================================================================== --- trunk/src/vscp/common/mdf.cpp 2008-04-18 08:08:45 UTC (rev 886) +++ trunk/src/vscp/common/mdf.cpp 2008-04-20 20:45:55 UTC (rev 887) @@ -342,7 +342,7 @@ // parseMDF // -bool CMDF::parseMDF( wxString& path ) +bool CMDF::parseMDF( wxString& path, wxString& lang ) { bool rv = true; wxXmlDocument doc; @@ -611,6 +611,16 @@ pAbstraction->m_strDescription = child4->GetNodeContent(); } } + else if ( child4->GetName() == wxT("help") ) { + wxString str; + str = child4->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pAbstraction->m_strHelp = child4->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pAbstraction->m_strHelp = child4->GetNodeContent(); + } + } else if ( child4->GetName() == wxT("access") ) { pAbstraction->m_nAccess = MDF_ACCESS_READ; wxString strAccessRights = child4->GetNodeContent(); @@ -661,6 +671,16 @@ pValueItem->m_strDescription = child6->GetNodeContent(); } } + else if ( child6->GetName() == wxT("help") ) { + wxString str; + str = child6->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pValueItem->m_strHelp = child6->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pValueItem->m_strHelp = child6->GetNodeContent(); + } + } child6 = child6->GetNext(); @@ -723,6 +743,16 @@ pRegister->m_strDescription = child4->GetNodeContent(); } } + else if ( child4->GetName() == wxT("help") ) { + wxString str; + str = child4->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pRegister->m_strHelp = child4->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pRegister->m_strHelp = child4->GetNodeContent(); + } + } else if ( child4->GetName() == wxT("bitfield") ) { wxXmlNode *child5 = child4->GetChildren(); @@ -761,6 +791,16 @@ pBit->m_strDescription = child6->GetNodeContent(); } } + else if ( child6->GetName() == wxT("help") ) { + wxString str; + str = child6->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pBit->m_strHelp = child6->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pBit->m_strHelp = child6->GetNodeContent(); + } + } else if ( child6->GetName() == wxT("access") ) { pBit->m_nAccess = MDF_ACCESS_READ; @@ -824,6 +864,16 @@ pValueItem->m_strDescription = child6->GetNodeContent(); } } + else if ( child6->GetName() == wxT("help") ) { + wxString str; + str = child6->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pValueItem->m_strHelp = child6->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pValueItem->m_strHelp = child6->GetNodeContent(); + } + } child6 = child6->GetNext(); @@ -896,6 +946,16 @@ pAction->m_strDescription = child4->GetNodeContent(); } } + else if ( child4->GetName() == wxT("help") ) { + wxString str; + str = child4->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pAction->m_strHelp = child4->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pAction->m_strHelp = child4->GetNodeContent(); + } + } } } @@ -942,6 +1002,16 @@ pEvent->m_strDescription = child4->GetNodeContent(); } } + else if ( child4->GetName() == wxT("help") ) { + wxString str; + str = child4->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pEvent->m_strHelp = child4->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pEvent->m_strHelp = child4->GetNodeContent(); + } + } else if ( child4->GetName() == wxT("data") ) { CMDF_EventData *pEventData = new CMDF_EventData; @@ -950,7 +1020,7 @@ pEventData->m_nOffset = child4->GetPropVal ( wxT ( "offset" ), 0 ); - wxXmlNode *child5 = child5->GetChildren(); + wxXmlNode *child5 = child4->GetChildren(); while (child5) { if ( child4->GetName() == wxT("name") ) { @@ -973,9 +1043,19 @@ pEventData->m_strDescription = child5->GetNodeContent(); } } + else if ( child4->GetName() == wxT("help") ) { + wxString str; + str = child5->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pEventData->m_strHelp = child5->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pEventData->m_strHelp = child5->GetNodeContent(); + } + } else if ( child5->GetName() == wxT("valuelist") ) { - wxXmlNode *child6 = child6->GetChildren(); + wxXmlNode *child6 = child5->GetChildren(); while (child6) { if ( child6->GetName() == wxT("item") ) { @@ -1009,6 +1089,16 @@ pValueItem->m_strDescription = child7->GetNodeContent(); } } + else if ( child7->GetName() == wxT("help") ) { + wxString str; + str = child7->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pValueItem->m_strHelp = child7->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pValueItem->m_strHelp = child7->GetNodeContent(); + } + } child7 = child7->GetNext(); @@ -1059,6 +1149,16 @@ pBit->m_strDescription = child7->GetNodeContent(); } } + else if ( child7->GetName() == wxT("help") ) { + wxString str; + str = child7->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pBit->m_strHelp = child7->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pBit->m_strHelp = child7->GetNodeContent(); + } + } else if ( child7->GetName() == wxT("access") ) { pBit->m_nAccess = MDF_ACCESS_READ; @@ -1147,6 +1247,16 @@ pBit->m_strDescription = child5->GetNodeContent(); } } + else if ( child5->GetName() == wxT("help") ) { + wxString str; + str = child5->GetPropVal ( wxT ( "lang" ), _("en") ); + if ( str == m_strLocale ) { + pBit->m_strHelp = child5->GetNodeContent(); + } + else if ( ( _("en") == str ) ) { + pBit->m_strHelp = child5->GetNodeContent(); + } + } else if ( child5->GetName() == wxT("access") ) { pBit->m_nAccess = MDF_ACCESS_READ; Modified: trunk/src/vscp/common/mdf.h =================================================================== --- trunk/src/vscp/common/mdf.h 2008-04-18 08:08:45 UTC (rev 886) +++ trunk/src/vscp/common/mdf.h 2008-04-20 20:45:55 UTC (rev 887) @@ -83,7 +83,8 @@ wxString m_strName; wxString m_strDescription; - wxString m_strValue; // The abstraction tells the type + wxString m_strHelp; // Item help text or url + wxString m_strValue; // The abstraction tells the type }; @@ -104,6 +105,7 @@ wxString m_strName; wxString m_strDescription; + wxString m_strHelp; // Item help text or url wxString m_strID; // Abstract variable id (unique // inside of MDF @@ -150,6 +152,7 @@ wxString m_strName; wxString m_strDescription; + wxString m_strHelp; // Item help text or url uint8_t m_nPos; // position in bit field 0-7 (from the left) uint8_t m_nWidth; // 1 for one bit 2-8 for bit-field @@ -180,7 +183,8 @@ wxString m_strName; wxString m_strDescription; - + wxString m_strHelp; // Item help text or url + uint16_t m_nPage; uint16_t m_nOffset; uint16_t m_nWidth; // Defaults to 1 @@ -216,6 +220,7 @@ wxString m_strName; wxString m_strDescription; + wxString m_strHelp; // Item help text or url uint16_t m_nOffset; uint8_t m_width; @@ -244,6 +249,7 @@ wxString m_strName; wxString m_strDescription; + wxString m_strHelp; // Item help text or url uint16_t m_nCode; @@ -295,6 +301,7 @@ wxString m_strName; wxString m_strDescription; + wxString m_strHelp; // Item help text or url uint16_t m_nOffset; @@ -322,6 +329,7 @@ wxString m_strName; wxString m_strDescription; + wxString m_strHelp; // Item help text or url uint16_t m_nClass; uint16_t m_nType; @@ -355,6 +363,7 @@ wxString m_strItem; wxString m_strDescription; + wxString m_strHelp; // Item help text or url }; WX_DECLARE_LIST( CMDF_Item, MDF_ITEM_LIST ); @@ -467,7 +476,7 @@ @param path Path to downloaded MDF @return true if the parsing went well. */ - bool parseMDF( wxString& path ); + bool parseMDF( wxString& path, wxString& lang ); wxString m_strLocale; // ISO code for requested language Modified: trunk/src/vscp/vscpworks/frmmain.cpp =================================================================== --- trunk/src/vscp/vscpworks/frmmain.cpp 2008-04-18 08:08:45 UTC (rev 886) +++ trunk/src/vscp/vscpworks/frmmain.cpp 2008-04-20 20:45:55 UTC (rev 887) @@ -69,6 +69,7 @@ #include "frmvscpsession.h" #include "frmdeviceconfig.h" #include "dlgconfiguration.h" +#include "mdfeditor.h" extern appConfiguration g_Config; @@ -171,6 +172,8 @@ EVT_MENU( ID_MENUITEM_CONFIGURATION, frmMain::OnMenuitemConfigurationClick ) + EVT_MENU( ID_MENUITEM_MDF_EDITOR, frmMain::OnMenuitemMdfEditorClick ) + EVT_MENU( ID_MENUITEM33, frmMain::OnMenuitemHelpClick ) EVT_MENU( ID_MENUITEM34, frmMain::OnMenuitemFaqClick ) @@ -181,7 +184,7 @@ EVT_MENU( ID_MENUITEM_CREDITS, frmMain::OnMenuitemCrediitsClick ) - EVT_MENU( ID_MENUITEM38, frmMain::OnMenuitemVSCPSiteClick ) + EVT_MENU( ID_MENUITEM_VSCP_SITE, frmMain::OnMenuitemVSCPSiteClick ) EVT_MENU( ID_MENUITEM39, frmMain::OnMenuitem39Click ) @@ -270,35 +273,37 @@ menuBar->Append(itemMenu3, _("File")); wxMenu* itemMenu11 = new wxMenu; itemMenu11->Append(ID_MENUITEM_CONFIGURATION, _("Configuration..."), _T(""), wxITEM_NORMAL); + itemMenu11->AppendSeparator(); + itemMenu11->Append(ID_MENUITEM_MDF_EDITOR, _("MDF Editor"), _T(""), wxITEM_NORMAL); menuBar->Append(itemMenu11, _("Tools")); - wxMenu* itemMenu13 = new wxMenu; - itemMenu13->Append(ID_MENUITEM33, _("VSCP-Works Help"), _T(""), wxITEM_RADIO); - itemMenu13->Append(ID_MENUITEM34, _("Frequently Asked Questions"), _T(""), wxITEM_NORMAL); - itemMenu13->Append(ID_MENUITEM35, _("Keyboard shortcuts"), _T(""), wxITEM_NORMAL); - itemMenu13->AppendSeparator(); - itemMenu13->Append(ID_MENUITEM_THANKS, _("Thanks..."), _T(""), wxITEM_NORMAL); - itemMenu13->Append(ID_MENUITEM_CREDITS, _("Credits..."), _T(""), wxITEM_NORMAL); - itemMenu13->AppendSeparator(); - itemMenu13->Append(ID_MENUITEM38, _("Go to VSCP site"), _T(""), wxITEM_NORMAL); - itemMenu13->AppendSeparator(); - itemMenu13->Append(ID_MENUITEM39, _("About"), _T(""), wxITEM_NORMAL); - menuBar->Append(itemMenu13, _("Help")); + wxMenu* itemMenu15 = new wxMenu; + itemMenu15->Append(ID_MENUITEM33, _("VSCP-Works Help"), _T(""), wxITEM_RADIO); + itemMenu15->Append(ID_MENUITEM34, _("Frequently Asked Questions"), _T(""), wxITEM_NORMAL); + itemMenu15->Append(ID_MENUITEM35, _("Keyboard shortcuts"), _T(""), wxITEM_NORMAL); + itemMenu15->AppendSeparator(); + itemMenu15->Append(ID_MENUITEM_THANKS, _("Thanks..."), _T(""), wxITEM_NORMAL); + itemMenu15->Append(ID_MENUITEM_CREDITS, _("Credits..."), _T(""), wxITEM_NORMAL); + itemMenu15->AppendSeparator(); + itemMenu15->Append(ID_MENUITEM_VSCP_SITE, _("Go to VSCP site"), _T(""), wxITEM_NORMAL); + itemMenu15->AppendSeparator(); + itemMenu15->Append(ID_MENUITEM39, _("About"), _T(""), wxITEM_NORMAL); + menuBar->Append(itemMenu15, _("Help")); itemFrame1->SetMenuBar(menuBar); - wxStatusBar* itemStatusBar24 = new wxStatusBar; - itemStatusBar24->Create( itemFrame1, ID_STATUSBAR, wxST_SIZEGRIP|wxNO_BORDER ); - itemStatusBar24->SetFieldsCount(2); - itemFrame1->SetStatusBar(itemStatusBar24); + wxStatusBar* itemStatusBar26 = new wxStatusBar; + itemStatusBar26->Create( itemFrame1, ID_STATUSBAR, wxST_SIZEGRIP|wxNO_BORDER ); + itemStatusBar26->SetFieldsCount(2); + itemFrame1->SetStatusBar(itemStatusBar26); - wxToolBar* itemToolBar25 = CreateToolBar( wxTB_FLAT|wxTB_HORIZONTAL|wxTB_NODIVIDER, ID_TOOLBAR ); - wxBitmap itemtool26Bitmap(itemFrame1->GetBitmapResource(wxT("open.xpm"))); - wxBitmap itemtool26BitmapDisabled; - itemToolBar25->AddTool(ID_TOOL, _T(""), itemtool26Bitmap, itemtool26BitmapDisabled, wxITEM_NORMAL, _T(""), wxEmptyString); - itemToolBar25->Realize(); - itemFrame1->SetToolBar(itemToolBar25); + wxToolBar* itemToolBar27 = CreateToolBar( wxTB_FLAT|wxTB_HORIZONTAL|wxTB_NODIVIDER, ID_TOOLBAR ); + wxBitmap itemtool28Bitmap(itemFrame1->GetBitmapResource(wxT("open.xpm"))); + wxBitmap itemtool28BitmapDisabled; + itemToolBar27->AddTool(ID_TOOL, _T(""), itemtool28Bitmap, itemtool28BitmapDisabled, wxITEM_NORMAL, _T(""), wxEmptyString); + itemToolBar27->Realize(); + itemFrame1->SetToolBar(itemToolBar27); - wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxVERTICAL); - itemFrame1->SetSizer(itemBoxSizer27); + wxBoxSizer* itemBoxSizer29 = new wxBoxSizer(wxVERTICAL); + itemFrame1->SetSizer(itemBoxSizer29); ////@end frmMain content construction @@ -682,3 +687,19 @@ ////@end wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENUITEM8 in frmMain. } + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENUITEM_MDF_EDITOR +// + +void frmMain::OnMenuitemMdfEditorClick( wxCommandEvent& event ) +{ + MDFEditor dlg( this ); + + if ( wxID_OK == dlg.ShowModal() ) { + //dlg.getDialogData(); + } + event.Skip(); + +} + Modified: trunk/src/vscp/vscpworks/frmmain.h =================================================================== --- trunk/src/vscp/vscpworks/frmmain.h 2008-04-18 08:08:45 UTC (rev 886) +++ trunk/src/vscp/vscpworks/frmmain.h 2008-04-20 20:45:55 UTC (rev 887) @@ -136,6 +136,9 @@ /// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENUITEM_CONFIGURATION void OnMenuitemConfigurationClick( wxCommandEvent& event ); + /// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENUITEM_MDF_EDITOR + void OnMenuitemMdfEditorClick( wxCommandEvent& event ); + /// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENUITEM33 void OnMenuitemHelpClick( wxCommandEvent& event ); @@ -151,7 +154,7 @@ /// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENUITEM_CREDITS void OnMenuitemCrediitsClick( wxCommandEvent& event ); - /// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENUITEM38 + /// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENUITEM_VSCP_SITE void OnMenuitemVSCPSiteClick( wxCommandEvent& event ); /// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENUITEM39 @@ -181,12 +184,13 @@ ID_MENUITEM_SCAN = 12001, ID_MENU_VSCPWORKS_EXIT = 12005, ID_MENUITEM_CONFIGURATION = 12011, + ID_MENUITEM_MDF_EDITOR = 12006, ID_MENUITEM33 = 12018, ID_MENUITEM34 = 12019, ID_MENUITEM35 = 12020, ID_MENUITEM_THANKS = 12021, ID_MENUITEM_CREDITS = 12022, - ID_MENUITEM38 = 12023, + ID_MENUITEM_VSCP_SITE = 12023, ID_MENUITEM39 = 12024, ID_STATUSBAR = 12025, ID_TOOLBAR = 12026, Modified: trunk/src/vscp/vscpworks/frmmain_symbols.h =================================================================== --- trunk/src/vscp/vscpworks/frmmain_symbols.h 2008-04-18 08:08:45 UTC (rev 886) +++ trunk/src/vscp/vscpworks/frmmain_symbols.h 2008-04-20 20:45:55 UTC (rev 887) @@ -3,7 +3,7 @@ // Purpose: Symbols file // Author: Ake Hedman // Modified by: -// Created: Tue 08 Jan 2008 17:16:46 CET +// Created: Sun 20 Apr 2008 22:35:23 CEST // RCS-ID: // Copyright: (C) 2007 Ake Hedman, D Of Scandinavia, <ak...@do...> // Licence: @@ -47,13 +47,14 @@ #define ID_FRMMAIN_SYMBOL_4 _("Exit") #define ID_FRMMAIN_SYMBOL_5 _("File") #define ID_FRMMAIN_SYMBOL_6 _("Configuration...") -#define ID_FRMMAIN_SYMBOL_7 _("Tools") -#define ID_FRMMAIN_SYMBOL_8 _("VSCP-Works Help") -#define ID_FRMMAIN_SYMBOL_9 _("Frequently Asked Questions") -#define ID_FRMMAIN_SYMBOL_10 _("Keyboard shortcuts") -#define ID_FRMMAIN_SYMBOL_11 _("Thanks...") -#define ID_FRMMAIN_SYMBOL_12 _("Credits...") -#define ID_FRMMAIN_SYMBOL_13 _("Go to VSCP site") -#define ID_FRMMAIN_SYMBOL_14 _("About") -#define ID_FRMMAIN_SYMBOL_15 _("Help") -#define ID_FRMMAIN_SYMBOL_16 _("VSCP-Works") +#define ID_FRMMAIN_SYMBOL_7 _("MDF Editor") +#define ID_FRMMAIN_SYMBOL_8 _("Tools") +#define ID_FRMMAIN_SYMBOL_9 _("VSCP-Works Help") +#define ID_FRMMAIN_SYMBOL_10 _("Frequently Asked Questions") +#define ID_FRMMAIN_SYMBOL_11 _("Keyboard shortcuts") +#define ID_FRMMAIN_SYMBOL_12 _("Thanks...") +#define ID_FRMMAIN_SYMBOL_13 _("Credits...") +#define ID_FRMMAIN_SYMBOL_14 _("Go to VSCP site") +#define ID_FRMMAIN_SYMBOL_15 _("About") +#define ID_FRMMAIN_SYMBOL_16 _("Help") +#define ID_FRMMAIN_SYMBOL_17 _("VSCP-Works") Added: trunk/src/vscp/vscpworks/mdfeditor.cpp =================================================================== --- trunk/src/vscp/vscpworks/mdfeditor.cpp (rev 0) +++ trunk/src/vscp/vscpworks/mdfeditor.cpp 2008-04-20 20:45:55 UTC (rev 887) @@ -0,0 +1,414 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: mdfeditor.cpp +// Purpose: +// Author: Ake Hedman +// Modified by: +// Created: Sun 20 Apr 2008 22:00:39 CEST +// RCS-ID: +// Copyright: (C) 2007 Ake Hedman, D Of Scandinavia, <ak...@do...> +// Licence: +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version +// 2 of the License, or (at your option) any later version. +// +// This file is part of the VSCP (http://can.sourceforge.net) +// +// Copyright (C) 2000-2007 Ake Hedman, D Of Scandinavia, <ak...@do...> +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this file see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for VSCP & Friends may be arranged by contacting +// D of Scandinavia at in...@do..., http://www.dofscandinavia.com +///////////////////////////////////////////////////////////////////////////// + +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) +#pragma implementation "mdfeditor.h" +#endif + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +////@begin includes +#include "wx/bookctrl.h" +////@end includes + +#include "mdfeditor.h" + +////@begin XPM images +////@end XPM images + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// MDFEditor type definition +// + +IMPLEMENT_DYNAMIC_CLASS( MDFEditor, wxDialog ) + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// MDFEditor event table definition +// + +BEGIN_EVENT_TABLE( MDFEditor, wxDialog ) + +////@begin MDFEditor event table entries +////@end MDFEditor event table entries + +END_EVENT_TABLE() + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// MDFEditor constructors +// + +MDFEditor::MDFEditor() +{ + Init(); +} + +MDFEditor::MDFEditor( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +{ + Init(); + Create(parent, id, caption, pos, size, style); +} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// MDFEditor creator +// + +bool MDFEditor::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +{ +////@begin MDFEditor creation + SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS); + wxPropertySheetDialog::Create( parent, id, caption, pos, size, style ); + + SetSheetStyle(wxPROPSHEET_DEFAULT); + CreateButtons(wxOK|wxCANCEL|wxHELP); + CreateControls(); + LayoutDialog(); + Centre(); +////@end MDFEditor creation + return true; +} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// MDFEditor destructor +// + +MDFEditor::~MDFEditor() +{ +////@begin MDFEditor destruction +////@end MDFEditor destruction +} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Member initialisation +// + +void MDFEditor::Init() +{ +////@begin MDFEditor member initialisation +////@end MDFEditor member initialisation +} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Control creation for MDFEditor +// + +void MDFEditor::CreateControls() +{ +////@begin MDFEditor content construction + MDFEditor* itemPropertySheetDialog1 = this; + + wxPanel* itemPanel2 = new wxPanel; + itemPanel2->Create( GetBookCtrl(), ID_PANEL_MDF_GENERAL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); + itemPanel2->SetSizer(itemBoxSizer3); + + wxGrid* itemGrid4 = new wxGrid( itemPanel2, ID_GRID1, wxDefaultPosition, wxSize(600, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); + itemGrid4->SetDefaultColSize(50); + itemGrid4->SetDefaultRowSize(25); + itemGrid4->SetColLabelSize(25); + itemGrid4->SetRowLabelSize(50); + itemGrid4->CreateGrid(5, 5, wxGrid::wxGridSelectCells); + itemBoxSizer3->Add(itemGrid4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer3->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + wxBitmapButton* itemBitmapButton6 = new wxBitmapButton; + itemBitmapButton6->Create( itemPanel2, ID_BITMAPBUTTON1, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer5->Add(itemBitmapButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton7 = new wxBitmapButton; + itemBitmapButton7->Create( itemPanel2, ID_BITMAPBUTTON, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer5->Add(itemBitmapButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton8 = new wxBitmapButton; + itemBitmapButton8->Create( itemPanel2, ID_BITMAPBUTTON2, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer5->Add(itemBitmapButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton9 = new wxBitmapButton; + itemBitmapButton9->Create( itemPanel2, ID_BITMAPBUTTON3, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer5->Add(itemBitmapButton9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + GetBookCtrl()->AddPage(itemPanel2, _("General")); + + wxPanel* itemPanel10 = new wxPanel; + itemPanel10->Create( GetBookCtrl(), ID_PANEL_MDF_ABSTRACTIONS, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL); + itemPanel10->SetSizer(itemBoxSizer11); + + wxTreeCtrl* itemTreeCtrl12 = new wxTreeCtrl; + itemTreeCtrl12->Create( itemPanel10, ID_GRID6, wxDefaultPosition, wxSize(600, 150), wxTR_SINGLE|wxSUNKEN_BORDER ); + itemBoxSizer11->Add(itemTreeCtrl12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer11->Add(itemBoxSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + wxBitmapButton* itemBitmapButton14 = new wxBitmapButton; + itemBitmapButton14->Create( itemPanel10, ID_BITMAPBUTTON24, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer13->Add(itemBitmapButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton15 = new wxBitmapButton; + itemBitmapButton15->Create( itemPanel10, ID_BITMAPBUTTON25, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer13->Add(itemBitmapButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton16 = new wxBitmapButton; + itemBitmapButton16->Create( itemPanel10, ID_BITMAPBUTTON26, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer13->Add(itemBitmapButton16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton17 = new wxBitmapButton; + itemBitmapButton17->Create( itemPanel10, ID_BITMAPBUTTON27, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer13->Add(itemBitmapButton17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + GetBookCtrl()->AddPage(itemPanel10, _("Abstractions")); + + wxPanel* itemPanel18 = new wxPanel; + itemPanel18->Create( GetBookCtrl(), ID_PANEL_MDF_REGISTERS, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxVERTICAL); + itemPanel18->SetSizer(itemBoxSizer19); + + wxTreeCtrl* itemTreeCtrl20 = new wxTreeCtrl; + itemTreeCtrl20->Create( itemPanel18, ID_TREECTRL, wxDefaultPosition, wxSize(600, 150), wxTR_SINGLE|wxSUNKEN_BORDER ); + itemBoxSizer19->Add(itemTreeCtrl20, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxBoxSizer* itemBoxSizer21 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer19->Add(itemBoxSizer21, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + wxBitmapButton* itemBitmapButton22 = new wxBitmapButton; + itemBitmapButton22->Create( itemPanel18, ID_BITMAPBUTTON20, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer21->Add(itemBitmapButton22, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton23 = new wxBitmapButton; + itemBitmapButton23->Create( itemPanel18, ID_BITMAPBUTTON21, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer21->Add(itemBitmapButton23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton24 = new wxBitmapButton; + itemBitmapButton24->Create( itemPanel18, ID_BITMAPBUTTON22, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer21->Add(itemBitmapButton24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton25 = new wxBitmapButton; + itemBitmapButton25->Create( itemPanel18, ID_BITMAPBUTTON23, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer21->Add(itemBitmapButton25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + GetBookCtrl()->AddPage(itemPanel18, _("Registers")); + + wxPanel* itemPanel26 = new wxPanel; + itemPanel26->Create( GetBookCtrl(), ID_PANEL_MDF_DM, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxVERTICAL); + itemPanel26->SetSizer(itemBoxSizer27); + + wxGrid* itemGrid28 = new wxGrid( itemPanel26, ID_GRID, wxDefaultPosition, wxSize(600, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); + itemGrid28->SetDefaultColSize(50); + itemGrid28->SetDefaultRowSize(25); + itemGrid28->SetColLabelSize(25); + itemGrid28->SetRowLabelSize(50); + itemGrid28->CreateGrid(5, 5, wxGrid::wxGridSelectCells); + itemBoxSizer27->Add(itemGrid28, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxBoxSizer* itemBoxSizer29 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer27->Add(itemBoxSizer29, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + wxBitmapButton* itemBitmapButton30 = new wxBitmapButton; + itemBitmapButton30->Create( itemPanel26, ID_BITMAPBUTTON4, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer29->Add(itemBitmapButton30, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton31 = new wxBitmapButton; + itemBitmapButton31->Create( itemPanel26, ID_BITMAPBUTTON5, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer29->Add(itemBitmapButton31, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton32 = new wxBitmapButton; + itemBitmapButton32->Create( itemPanel26, ID_BITMAPBUTTON6, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer29->Add(itemBitmapButton32, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton33 = new wxBitmapButton; + itemBitmapButton33->Create( itemPanel26, ID_BITMAPBUTTON7, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer29->Add(itemBitmapButton33, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + GetBookCtrl()->AddPage(itemPanel26, _("Decision Matrix")); + + wxPanel* itemPanel34 = new wxPanel; + itemPanel34->Create( GetBookCtrl(), ID_PANEL_MDF_EVENTS, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* itemBoxSizer35 = new wxBoxSizer(wxVERTICAL); + itemPanel34->SetSizer(itemBoxSizer35); + + wxGrid* itemGrid36 = new wxGrid( itemPanel34, ID_GRID2, wxDefaultPosition, wxSize(600, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); + itemGrid36->SetDefaultColSize(50); + itemGrid36->SetDefaultRowSize(25); + itemGrid36->SetColLabelSize(25); + itemGrid36->SetRowLabelSize(50); + itemGrid36->CreateGrid(5, 5, wxGrid::wxGridSelectCells); + itemBoxSizer35->Add(itemGrid36, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxBoxSizer* itemBoxSizer37 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer35->Add(itemBoxSizer37, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + wxBitmapButton* itemBitmapButton38 = new wxBitmapButton; + itemBitmapButton38->Create( itemPanel34, ID_BITMAPBUTTON8, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer37->Add(itemBitmapButton38, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton39 = new wxBitmapButton; + itemBitmapButton39->Create( itemPanel34, ID_BITMAPBUTTON9, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer37->Add(itemBitmapButton39, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton40 = new wxBitmapButton; + itemBitmapButton40->Create( itemPanel34, ID_BITMAPBUTTON10, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer37->Add(itemBitmapButton40, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton41 = new wxBitmapButton; + itemBitmapButton41->Create( itemPanel34, ID_BITMAPBUTTON11, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer37->Add(itemBitmapButton41, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + GetBookCtrl()->AddPage(itemPanel34, _("Events")); + + wxPanel* itemPanel42 = new wxPanel; + itemPanel42->Create( GetBookCtrl(), ID_PANEL_MDF_ALARM, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* itemBoxSizer43 = new wxBoxSizer(wxVERTICAL); + itemPanel42->SetSizer(itemBoxSizer43); + + wxGrid* itemGrid44 = new wxGrid( itemPanel42, ID_GRID3, wxDefaultPosition, wxSize(600, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); + itemGrid44->SetDefaultColSize(50); + itemGrid44->SetDefaultRowSize(25); + itemGrid44->SetColLabelSize(25); + itemGrid44->SetRowLabelSize(50); + itemGrid44->CreateGrid(5, 5, wxGrid::wxGridSelectCells); + itemBoxSizer43->Add(itemGrid44, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxBoxSizer* itemBoxSizer45 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer43->Add(itemBoxSizer45, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + wxBitmapButton* itemBitmapButton46 = new wxBitmapButton; + itemBitmapButton46->Create( itemPanel42, ID_BITMAPBUTTON12, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer45->Add(itemBitmapButton46, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton47 = new wxBitmapButton; + itemBitmapButton47->Create( itemPanel42, ID_BITMAPBUTTON13, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer45->Add(itemBitmapButton47, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton48 = new wxBitmapButton; + itemBitmapButton48->Create( itemPanel42, ID_BITMAPBUTTON14, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer45->Add(itemBitmapButton48, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton49 = new wxBitmapButton; + itemBitmapButton49->Create( itemPanel42, ID_BITMAPBUTTON15, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer45->Add(itemBitmapButton49, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + GetBookCtrl()->AddPage(itemPanel42, _("Alarm bits")); + + wxPanel* itemPanel50 = new wxPanel; + itemPanel50->Create( GetBookCtrl(), ID_PANEL_MDF_BOOT, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* itemBoxSizer51 = new wxBoxSizer(wxVERTICAL); + itemPanel50->SetSizer(itemBoxSizer51); + + wxGrid* itemGrid52 = new wxGrid( itemPanel50, ID_GRID4, wxDefaultPosition, wxSize(600, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); + itemGrid52->SetDefaultColSize(50); + itemGrid52->SetDefaultRowSize(25); + itemGrid52->SetColLabelSize(25); + itemGrid52->SetRowLabelSize(50); + itemGrid52->CreateGrid(5, 5, wxGrid::wxGridSelectCells); + itemBoxSizer51->Add(itemGrid52, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxBoxSizer* itemBoxSizer53 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer51->Add(itemBoxSizer53, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + wxBitmapButton* itemBitmapButton54 = new wxBitmapButton; + itemBitmapButton54->Create( itemPanel50, ID_BITMAPBUTTON16, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer53->Add(itemBitmapButton54, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton55 = new wxBitmapButton; + itemBitmapButton55->Create( itemPanel50, ID_BITMAPBUTTON17, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer53->Add(itemBitmapButton55, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton56 = new wxBitmapButton; + itemBitmapButton56->Create( itemPanel50, ID_BITMAPBUTTON18, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer53->Add(itemBitmapButton56, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBitmapButton* itemBitmapButton57 = new wxBitmapButton; + itemBitmapButton57->Create( itemPanel50, ID_BITMAPBUTTON19, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + itemBoxSizer53->Add(itemBitmapButton57, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + GetBookCtrl()->AddPage(itemPanel50, _("Boot Loader")); + +////@end MDFEditor content construction +} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Should we show tooltips? +// + +bool MDFEditor::ShowToolTips() +{ + return true; +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Get bitmap resources +// + +wxBitmap MDFEditor::GetBitmapResource( const wxString& name ) +{ + // Bitmap retrieval +////@begin MDFEditor bitmap retrieval + wxUnusedVar(name); + return wxNullBitmap; +////@end MDFEditor bitmap retrieval +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Get icon resources +// + +wxIcon MDFEditor::GetIconResource( const wxString& name ) +{ + // Icon retrieval +////@begin MDFEditor icon retrieval + wxUnusedVar(name); + return wxNullIcon; +////@end MDFEditor icon retrieval +} Added: trunk/src/vscp/vscpworks/mdfeditor.h =================================================================== --- trunk/src/vscp/vscpworks/mdfeditor.h (rev 0) +++ trunk/src/vscp/vscpworks/mdfeditor.h 2008-04-20 20:45:55 UTC (rev 887) @@ -0,0 +1,175 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: mdfeditor.h +// Purpose: +// Author: Ake Hedman +// Modified by: +// Created: Sun 20 Apr 2008 22:00:39 CEST +// RCS-ID: +// Copyright: (C) 2007 Ake Hedman, D Of Scandinavia, <ak...@do...> +// Licence: +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version +// 2 of the License, or (at your option) any later version. +// +// This file is part of the VSCP (http://can.sourceforge.net) +// +// Copyright (C) 2000-2007 Ake Hedman, D Of Scandinavia, <ak...@do...> +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this file see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for VSCP & Friends may be arranged by contacting +// D of Scandinavia at in...@do..., http://www.dofscandinavia.com +///////////////////////////////////////////////////////////////////////////// + +#ifndef _MDFEDITOR_H_ +#define _MDFEDITOR_H_ + +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) +#pragma interface "mdfeditor.h" +#endif + +/*! + * Includes + */ + +////@begin includes +#include "mdfeditor_symbols.h" +#include "wx/propdlg.h" +#include "wx/grid.h" +#include "wx/treectrl.h" +////@end includes + +/*! + * Forward declarations + */ + +////@begin forward declarations +////@end forward declarations + +/*! + * Control identifiers + */ + +////@begin control identifiers +#define SYMBOL_MDFEDITOR_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxDIALOG_MODAL +#define SYMBOL_MDFEDITOR_TITLE _("MDF Editor") +#define SYMBOL_MDFEDITOR_IDNAME ID_MDFEDITOR +#define SYMBOL_MDFEDITOR_SIZE wxSize(400, 300) +#define SYMBOL_MDFEDITOR_POSITION wxDefaultPosition +////@end control identifiers + + + +/*! + * MDFEditor class declaration + */ + +class MDFEditor: public wxPropertySheetDialog +{ + DECLARE_DYNAMIC_CLASS( MDFEditor ) + DECLARE_EVENT_TABLE() + +public: + /// Constructors + MDFEditor(); + MDFEditor( wxWindow* parent, wxWindowID id = SYMBOL_MDFEDITOR_IDNAME, const wxString& caption = SYMBOL_MDFEDITOR_TITLE, const wxPoint& pos = SYMBOL_MDFEDITOR_POSITION, const wxSize& size = SYMBOL_MDFEDITOR_SIZE, long style = SYMBOL_MDFEDITOR_STYLE ); + + /// Creation + bool Create( wxWindow* parent, wxWindowID id = SYMBOL_MDFEDITOR_IDNAME, const wxString& caption = SYMBOL_MDFEDITOR_TITLE, const wxPoint& pos = SYMBOL_MDFEDITOR_POSITION, const wxSize& size = SYMBOL_MDFEDITOR_SIZE, long style = SYMBOL_MDFEDITOR_STYLE ); + + /// Destructor + ~MDFEditor(); + + /// Initialises member variables + void Init(); + + /// Creates the controls and sizers + void CreateControls(); + +////@begin MDFEditor event handler declarations + +////@end MDFEditor event handler declarations + +////@begin MDFEditor member function declarations + + /// Retrieves bitmap resources + wxBitmap GetBitmapResource( const wxString& name ); + + /// Retrieves icon resources + wxIcon GetIconResource( const wxString& name ); +////@end MDFEditor member function declarations + + /// Should we show tooltips? + static bool ShowToolTips(); + +////@begin MDFEditor member variables + /// Control identifiers + enum { + ID_MDFEDITOR = 10005, + ID_PANEL_MDF_GENERAL = 10006, + ID_GRID1 = 10008, + ID_BITMAPBUTTON1 = 10009, + ID_BITMAPBUTTON = 10010, + ID_BITMAPBUTTON2 = 10011, + ID_BITMAPBUTTON3 = 10012, + ID_PANEL_MDF_ABSTRACTIONS = 10000, + ID_GRID6 = 10038, + ID_BITMAPBUTTON24 = 10039, + ID_BITMAPBUTTON25 = 10040, + ID_BITMAPBUTTON26 = 10041, + ID_BITMAPBUTTON27 = 10042, + ID_PANEL_MDF_REGISTERS = 10001, + ID_TREECTRL = 10033, + ID_BITMAPBUTTON20 = 10034, + ID_BITMAPBUTTON21 = 10035, + ID_BITMAPBUTTON22 = 10036, + ID_BITMAPBUTTON23 = 10037, + ID_PANEL_MDF_DM = 10002, + ID_GRID = 10013, + ID_BITMAPBUTTON4 = 10014, + ID_BITMAPBUTTON5 = 10015, + ID_BITMAPBUTTON6 = 10016, + ID_BITMAPBUTTON7 = 10017, + ID_PANEL_MDF_EVENTS = 10003, + ID_GRID2 = 10018, + ID_BITMAPBUTTON8 = 10019, + ID_BITMAPBUTTON9 = 10020, + ID_BITMAPBUTTON10 = 10021, + ID_BITMAPBUTTON11 = 10022, + ID_PANEL_MDF_ALARM = 10004, + ID_GRID3 = 10023, + ID_BITMAPBUTTON12 = 10024, + ID_BITMAPBUTTON13 = 10025, + ID_BITMAPBUTTON14 = 10026, + ID_BITMAPBUTTON15 = 10027, + ID_PANEL_MDF_BOOT = 10007, + ID_GRID4 = 10028, + ID_BITMAPBUTTON16 = 10029, + ID_BITMAPBUTTON17 = 10030, + ID_BITMAPBUTTON18 = 10031, + ID_BITMAPBUTTON19 = 10032 + }; +////@end MDFEditor member variables +}; + +#endif + // _MDFEDITOR_H_ Added: trunk/src/vscp/vscpworks/mdfeditor_symbols.h =================================================================== --- trunk/src/vscp/vscpworks/mdfeditor_symbols.h (rev 0) +++ trunk/src/vscp/vscpworks/mdfeditor_symbols.h 2008-04-20 20:45:55 UTC (rev 887) @@ -0,0 +1,50 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: mdfeditor_symbols.h +// Purpose: Symbols file +// Author: Ake Hedman +// Modified by: +// Created: Sun 20 Apr 2008 22:32:07 CEST +// RCS-ID: +// Copyright: (C) 2007 Ake Hedman, D Of Scandinavia, <ak...@do...> +// Licence: +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version +// 2 of the License, or (at your option) any later version. +// +// This file is part of the VSCP (http://can.sourceforge.net) +// +// Copyright (C) 2000-2007 Ake Hedman, D Of Scandinavia, <ak...@do...> +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this file see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for VSCP & Friends may be arranged by contacting +// D of Scandinavia at in...@do..., http://www.dofscandinavia.com +///////////////////////////////////////////////////////////////////////////// + +#define ID_MDFEDITOR_SYMBOL_0 _("General") +#define ID_MDFEDITOR_SYMBOL_1 _("Abstractions") +#define ID_MDFEDITOR_SYMBOL_2 _("Registers") +#define ID_MDFEDITOR_SYMBOL_3 _("Decision Matrix") +#define ID_MDFEDITOR_SYMBOL_4 _("Events") +#define ID_MDFEDITOR_SYMBOL_5 _("Alarm bits") +#define ID_MDFEDITOR_SYMBOL_6 _("Boot Loader") +#define ID_MDFEDITOR_SYMBOL_7 _("MDF Editor") Modified: trunk/src/vscp/vscpworks/readmsfurl.cpp =================================================================== --- trunk/src/vscp/vscpworks/readmsfurl.cpp 2008-04-18 08:08:45 UTC (rev 886) +++ trunk/src/vscp/vscpworks/readmsfurl.cpp 2008-04-20 20:45:55 UTC (rev 887) @@ -1,195 +1,194 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: readmsfurl.cpp -// Purpose: -// Author: Ake Hedman -// Modified by: -// Created: 21/12/2007 17:16:49 -// RCS-ID: -// Copyright: (C) 2007 Ake Hedman, D Of Scandinavia, <ak...@do...> -// Licence: -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version -// 2 of the License, or (at your option) any later version. -// -// This file is part of the VSCP (http://can.sourceforge.net) -// -// Copyright (C) 2000-2008 Ake Hedman, D Of Scandinavia, <ak...@do...> -// -// This file is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this file see the file COPYING. If not, write to -// the Free Software Foundation, 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. -// -// As a special exception, if other files instantiate templates or use macros -// or inline functions from this file, or you compile this file and link it -// with other works to produce a work based on this file, this file does not -// by itself cause the resulting work to be covered by the GNU General Public -// License. However the source code for this file must still be made available -// in accordance with section (3) of the GNU General Public License. -// -// This exception does not invalidate any other reasons why a work based on -// this file might be covered by the GNU General Public License. -// -// Alternative licenses for VSCP & Friends may be arranged by contacting -// D of Scandinavia at in...@do..., http://www.dofscandinavia.com -///////////////////////////////////////////////////////////////////////////// - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "readmsfurl.h" -#endif - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -////@begin includes -////@end includes - -#include "readmsfurl.h" - -////@begin XPM images - -////@end XPM images - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ReadMSFURL type definition -// - -IMPLEMENT_DYNAMIC_CLASS( ReadMSFURL, wxDialog ) - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ReadMSFURL event table definition -// - -BEGIN_EVENT_TABLE( ReadMSFURL, wxDialog ) - -////@begin ReadMSFURL event table entries -////@end ReadMSFURL event table entries - -END_EVENT_TABLE() - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ReadMSFURL constructors -// - -ReadMSFURL::ReadMSFURL() -{ - Init(); -} - -ReadMSFURL::ReadMSFURL( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ - Init(); - Create(parent, id, caption, pos, size, style); -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ReadMSFURL creator -// - -bool ReadMSFURL::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ -////@begin ReadMSFURL creation - SetExtraStyle(wxWS_EX_BLOCK_EVENTS); - wxDialog::Create( parent, id, caption, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end ReadMSFURL creation - return true; -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ReadMSFURL destructor -// - -ReadMSFURL::~ReadMSFURL() -{ -////@begin ReadMSFURL destruction -////@end ReadMSFURL destruction -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Member initialisation -// - -void ReadMSFURL::Init() -{ -////@begin ReadMSFURL member initialisation -////@end ReadMSFURL member initialisation -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Control creation for ReadMSFURL -// - -void ReadMSFURL::CreateControls() -{ -////@begin ReadMSFURL content construction - ReadMSFURL* itemDialog1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemDialog1->SetSizer(itemBoxSizer2); - -////@end ReadMSFURL content construction -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Should we show tooltips? -// - -bool ReadMSFURL::ShowToolTips() -{ - return true; -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Get bitmap resources -// - -wxBitmap ReadMSFURL::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin ReadMSFURL bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end ReadMSFURL bitmap retrieval -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Get icon resources -// - -wxIcon ReadMSFURL::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin ReadMSFURL icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end ReadMSFURL icon retrieval -} +///////////////////////////////////////////////////////////////////////////// +// Name: readmsfurl.cpp +// Purpose: +// Author: Ake Hedman +// Modified by: +// Created: 21/12/2007 17:16:49 +// RCS-ID: +// Copyright: (C) 2007 Ake Hedman, D Of Scandinavia, <ak...@do...> +// Licence: +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version +// 2 of the License, or (at your option) any later version. +// +// This file is part of the VSCP (http://can.sourceforge.net) +// +// Copyright (C) 2000-2008 Ake Hedman, D Of Scandinavia, <ak...@do...> +// +// This file is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this file see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for VSCP & Friends may be arranged by contacting +// D of Scandinavia at in...@do..., http://www.dofscandinavia.com +///////////////////////////////////////////////////////////////////////////// + +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) +#pragma implementation "readmsfurl.h" +#endif + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +////@begin includes +////@end includes + +#include "readmsfurl.h" + +////@begin XPM images +////@end XPM images + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// ReadMSFURL type definition +// + +IMPLEMENT_DYNAMIC_CLASS( ReadMSFURL, wxDialog ) + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// ReadMSFURL event table definition +// + +BEGIN_EVENT_TABLE( ReadMSFURL, wxDialog ) + +////@begin ReadMSFURL event table entries +////@end ReadMSFURL event table entries + +END_EVENT_TABLE() + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// ReadMSFURL constructors +// + +ReadMSFURL::ReadMSFURL() +{ + Init(); +} + +ReadMSFURL::ReadMSFURL( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +{ + Init(); + Create(parent, id, caption, pos, size, style); +} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// ReadMSFURL creator +// + +bool ReadMSFURL::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +{ +////@begin ReadMSFURL creation + SetExtraStyle(wxWS_EX_BLOCK_EVENTS); + wxDialog::Create( parent, id, caption, pos, size, style ); + + CreateControls(); + if (GetSizer()) + { + GetSizer()->SetSizeHints(this); + } + Centre(); +////@end ReadMSFURL creation + return true; +} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// ReadMSFURL destructor +// + +ReadMSFURL::~ReadMSFURL() +{ +////@begin ReadMSFURL destruction +////@end ReadMSFURL destruction +} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Member initialisation +// + +void ReadMSFURL::Init() +{ +////@begin ReadMSFURL member initialisation +////@end ReadMSFURL member initialisation +} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Control creation for ReadMSFURL +// + +void ReadMSFURL::CreateControls() +{ +////@begin ReadMSFURL content construction + ReadMSFURL* itemDialog1 = this; + + wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); + itemDialog1->SetSizer(itemBoxSizer2); + +////@end ReadMSFURL content construction +} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Should we show tooltips? +// + +bool ReadMSFURL::ShowToolTips() +{ + return true; +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Get bitmap resources +// + +wxBitmap ReadMSFURL::GetBitmapResource( const wxString& name ) +{ + // Bitmap retrieval +////@begin ReadMSFURL bitmap retrieval + wxUnusedVar(name); + return wxNullBitmap; +////@end ReadMSFURL bitmap retrieval +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Get icon resources +// + +wxIcon ReadMSFURL::GetIconResource( const wxString& name ) +{ + // Icon retrieval +////@begin ReadMSFURL icon retrieval + wxUnusedVar(name); + return wxNullIcon; +////@end ReadMSFURL icon retrieval +} Modified: trunk/src/vscp/vscpworks/readmsfurl.h =================================================================== --- trunk/src/vscp/vscpworks/readmsfurl.h 2008-04-18 08:08:45 UTC (rev 886) +++ trunk/src/vscp/vscpworks/readmsfurl.h 2008-04-20 20:45:55 UTC (rev 887) @@ -1,127 +1,129 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: readmsfurl.h -// Purpose: -// Author: Ake Hedman -// Modified by: -// Created: 21/12/2007 17:16:49 -// RCS-ID: -// Copyright: (C) 2007 Ake Hedman, D Of Scandinavia, <ak...@do...> -// Licence: -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free So... [truncated message content] |
From: <ak...@us...> - 2008-04-18 08:08:49
|
Revision: 886 http://can.svn.sourceforge.net/can/?rev=886&view=rev Author: akhe Date: 2008-04-18 01:08:45 -0700 (Fri, 18 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/src/vscp/vscpworks/vscpworks.pjd Modified: trunk/src/vscp/vscpworks/vscpworks.pjd =================================================================== --- trunk/src/vscp/vscpworks/vscpworks.pjd 2008-04-17 11:21:20 UTC (rev 885) +++ trunk/src/vscp/vscpworks/vscpworks.pjd 2008-04-18 08:08:45 UTC (rev 886) @@ -188,7 +188,7 @@ <string name="app_class_name">"Application"</string> <bool name="generate_app_class">0</bool> <string name="external_symbol_filenames">""</string> - <string name="configuration">"GCC Unicode Release"</string> + <string name="configuration">"GCC Release Unicode"</string> <string name="source_encoding">"utf-8"</string> <string name="xrc_encoding">"utf-8"</string> <string name="project_encoding">"iso-8859-1"</string> @@ -406,7 +406,7 @@ <string name="CFG">""</string> </document> <document> - <string name="title">"GCC Debug Unicode"</string> + <string name="title">"GCC Debug"</string> <string name="type">"gcc-config-data-document"</string> <string name="filename">""</string> <string name="icon-name">""</string> @@ -419,7 +419,7 @@ <long name="makefile-last-written">0</long> <string name="Compiler name">"GCC"</string> <string name="Build mode">"Debug"</string> - <string name="Unicode mode">"Unicode"</string> + <string name="Unicode mode">"ANSI"</string> <string name="Shared mode">"Static"</string> <string name="Modularity">"Modular"</string> <string name="GUI mode">"GUI"</string> @@ -470,7 +470,7 @@ <string name="Icns location">"%AUTO%"</string> </document> <document> - <string name="title">"GCC Release shared Unicode"</string> + <string name="title">"GCC Release"</string> <string name="type">"gcc-config-data-document"</string> <string name="filename">""</string> <string name="icon-name">""</string> @@ -483,70 +483,6 @@ <long name="makefile-last-written">0</long> <string name="Compiler name">"GCC"</string> <string name="Build mode">"Release"</string> - <string name="Unicode mode">"Unicode"</string> - <string name="Shared mode">"Shared"</string> - <string name="Modularity">"Modular"</string> - <string name="GUI mode">"GUI"</string> - <string name="Toolkit">"wxGTK+2"</string> - <string name="Runtime linking">"Dynamic"</string> - <string name="Use exceptions">"Yes"</string> - <string name="Use ODBC">"No"</string> - <string name="Use OpenGL">"No"</string> - <string name="Use wx-config">"Yes"</string> - <string name="Use installed wxWidgets">"No"</string> - <string name="Enable universal binaries">"No"</string> - <string name="wxWidgets version">"%WXVERSION%"</string> - <string name="Executable name">"%EXECUTABLE%"</string> - <string name="Program arguments">""</string> - <string name="Working path">"%AUTO%"</string> - <string name="Output path">"%AUTO%"</string> - <string name="Objects path">"%AUTO%"</string> - <string name="Compiler location">"%AUTO%"</string> - <string name="wxWidgets location">"%AUTO%"</string> - <string name="C++ command">"%AUTO%"</string> - <string name="Resource compiler">"%AUTO%"</string> - <string name="Make command">"%AUTO%"</string> - <string name="Project makefile">"%AUTO%"</string> - <string name="wxWidgets makefile">"%AUTO%"</string> - <string name="Compiler bin path">"%AUTO%"</string> - <string name="Compiler include path">"%AUTO%"</string> - <string name="Compiler lib path">"%AUTO%"</string> - <string name="Preprocessor flags">"%AUTO%"</string> - <string name="Optimizations">"%AUTO%"</string> - <string name="Warnings">"%AUTO%"</string> - <string name="Debug flags">"%AUTO%"</string> - <string name="Libraries">"%AUTO%"</string> - <string name="Library path">"%AUTO%"</string> - <string name="Linker flags">"%AUTO%"</string> - <string name="Include path">"%AUTO%"</string> - <string name="Resource flags">"%AUTO%"</string> - <string name="Resource path">"%AUTO%"</string> - <string name="wxWidgets build path">"%AUTO%"</string> - <string name="wxWidgets build command">"%AUTO%"</string> - <string name="wxWidgets clean command">"%AUTO%"</string> - <string name="PATH variable">"%AUTO%"</string> - <bool name="Suppress source rules">0</bool> - <bool name="Enable makefile generation">1</bool> - <string name="Command for wx-config">"%AUTO%"</string> - <string name="SDK path">"%AUTO%"</string> - <string name="Minimum OS version">"%AUTO%"</string> - <string name="Info.plist location">"%AUTO%"</string> - <string name="Icns location">"%AUTO%"</string> - </document> - <document> - <string name="title">"GCC Debug"</string> - <string name="type">"gcc-config-data-document"</string> - <string name="filename">""</string> - <string name="icon-name">""</string> - <long name="is-transient">0</long> - <long name="owns-file">1</long> - <long name="title-mode">0</long> - <long name="locked">0</long> - <string name="template-name">"GCC"</string> - <bool name="dirty">0</bool> - <long name="makefile-last-written">0</long> - <string name="Compiler name">"GCC"</string> - <string name="Build mode">"Debug"</string> <string name="Unicode mode">"ANSI"</string> <string name="Shared mode">"Static"</string> <string name="Modularity">"Modular"</string> @@ -598,31 +534,29 @@ <string name="Icns location">"%AUTO%"</string> </document> <document> - <string name="title">"GCC Release"</string> - <string name="type">"gcc-config-data-document"</string> + <string name="title">"VC++ Project Unicode Release"</string> + <string name="type">"vc-project-config-data-document"</string> <string name="filename">""</string> <string name="icon-name">""</string> <long name="is-transient">0</long> <long name="owns-file">1</long> <long name="title-mode">0</long> <long name="locked">0</long> - <string name="template-name">"GCC"</string> + <string name="template-name">"VC++ Project"</string> <bool name="dirty">0</bool> <long name="makefile-last-written">0</long> - <string name="Compiler name">"GCC"</string> + <string name="Compiler name">"VC++ Project"</string> <string name="Build mode">"Release"</string> - <string name="Unicode mode">"ANSI"</string> + <string name="Unicode mode">"Unicode"</string> <string name="Shared mode">"Static"</string> <string name="Modularity">"Modular"</string> <string name="GUI mode">"GUI"</string> - <string name="Toolkit">"wxGTK+2"</string> + <string name="Toolkit">"wxMSW"</string> <string name="Runtime linking">"Dynamic"</string> <string name="Use exceptions">"Yes"</string> <string name="Use ODBC">"No"</string> <string name="Use OpenGL">"No"</string> - <string name="Use wx-config">"Yes"</string> - <string name="Use installed wxWidgets">"No"</string> - <string name="Enable universal binaries">"No"</string> + <string name="Compiler version">"6"</string> <string name="wxWidgets version">"%WXVERSION%"</string> <string name="Executable name">"%EXECUTABLE%"</string> <string name="Program arguments">""</string> @@ -655,38 +589,39 @@ <string name="PATH variable">"%AUTO%"</string> <bool name="Suppress source rules">0</bool> <bool name="Enable makefile generation">1</bool> - <string name="Command for wx-config">"%AUTO%"</string> - <string name="SDK path">"%AUTO%"</string> - <string name="Minimum OS version">"%AUTO%"</string> - <string name="Info.plist location">"%AUTO%"</string> - <string name="Icns location">"%AUTO%"</string> + <string name="Project make command">"%AUTO%"</string> + <string name="Project build command">"%AUTO%"</string> + <string name="Project rebuild command">"%AUTO%"</string> + <string name="Project clean command">"%AUTO%"</string> + <string name="Project debug command">"%AUTO%"</string> + <string name="Pre-build command">"%AUTO%"</string> + <string name="Post-build command">"%AUTO%"</string> + <string name="Pre-link command">"%AUTO%"</string> + <string name="CFG">""</string> </document> <document> - <string name="title">"GCC Unicode Debug"</string> - <string name="type">"gcc-config-data-document"</string> + <string name="title">"VC++ Unicode Release"</string> + <string name="type">"vc-config-data-document"</string> <string name="filename">""</string> <string name="icon-name">""</string> <long name="is-transient">0</long> <long name="owns-file">1</long> <long name="title-mode">0</long> <long name="locked">0</long> - <string name="template-name">"GCC"</string> - <bool name="dirty">0</bool> + <string name="template-name">"VC++"</string> + <bool name="dirty">1</bool> <long name="makefile-last-written">0</long> - <string name="Compiler name">"GCC"</string> - <string name="Build mode">"Debug"</string> + <string name="Compiler name">"VC++"</string> + <string name="Build mode">"Release"</string> <string name="Unicode mode">"Unicode"</string> <string name="Shared mode">"Static"</string> <string name="Modularity">"Modular"</string> <string name="GUI mode">"GUI"</string> - <string name="Toolkit">"wxGTK+2"</string> + <string name="Toolkit">"wxMSW"</string> <string name="Runtime linking">"Dynamic"</string> <string name="Use exceptions">"Yes"</string> <string name="Use ODBC">"No"</string> <string name="Use OpenGL">"No"</string> - <string name="Use wx-config">"Yes"</string> - <string name="Use installed wxWidgets">"No"</string> - <string name="Enable universal binaries">"No"</string> <string name="wxWidgets version">"%WXVERSION%"</string> <string name="Executable name">"%EXECUTABLE%"</string> <string name="Program arguments">""</string> @@ -719,38 +654,31 @@ <string name="PATH variable">"%AUTO%"</string> <bool name="Suppress source rules">0</bool> <bool name="Enable makefile generation">1</bool> - <string name="Command for wx-config">"%AUTO%"</string> - <string name="SDK path">"%AUTO%"</string> - <string name="Minimum OS version">"%AUTO%"</string> - <string name="Info.plist location">"%AUTO%"</string> - <string name="Icns location">"%AUTO%"</string> + <string name="CFG">""</string> </document> <document> - <string name="title">"GCC Unicode Release"</string> - <string name="type">"gcc-config-data-document"</string> + <string name="title">"VC++ Unicode Debug"</string> + <string name="type">"vc-config-data-document"</string> <string name="filename">""</string> <string name="icon-name">""</string> <long name="is-transient">0</long> <long name="owns-file">1</long> <long name="title-mode">0</long> <long name="locked">0</long> - <string name="template-name">"GCC"</string> - <bool name="dirty">0</bool> + <string name="template-name">"VC++"</string> + <bool name="dirty">1</bool> <long name="makefile-last-written">0</long> - <string name="Compiler name">"GCC"</string> - <string name="Build mode">"Release"</string> + <string name="Compiler name">"VC++"</string> + <string name="Build mode">"Debug"</string> <string name="Unicode mode">"Unicode"</string> <string name="Shared mode">"Static"</string> <string name="Modularity">"Modular"</string> <string name="GUI mode">"GUI"</string> - <string name="Toolkit">"wxGTK+2"</string> + <string name="Toolkit">"wxMSW"</string> <string name="Runtime linking">"Dynamic"</string> <string name="Use exceptions">"Yes"</string> <string name="Use ODBC">"No"</string> <string name="Use OpenGL">"No"</string> - <string name="Use wx-config">"Yes"</string> - <string name="Use installed wxWidgets">"No"</string> - <string name="Enable universal binaries">"No"</string> <string name="wxWidgets version">"%WXVERSION%"</string> <string name="Executable name">"%EXECUTABLE%"</string> <string name="Program arguments">""</string> @@ -783,14 +711,10 @@ <string name="PATH variable">"%AUTO%"</string> <bool name="Suppress source rules">0</bool> <bool name="Enable makefile generation">1</bool> - <string name="Command for wx-config">"%AUTO%"</string> - <string name="SDK path">"%AUTO%"</string> - <string name="Minimum OS version">"%AUTO%"</string> - <string name="Info.plist location">"%AUTO%"</string> - <string name="Icns location">"%AUTO%"</string> + <string name="CFG">""</string> </document> <document> - <string name="title">"VC++ Project Unicode Release"</string> + <string name="title">"VC++ Project unicode Debug"</string> <string name="type">"vc-project-config-data-document"</string> <string name="filename">""</string> <string name="icon-name">""</string> @@ -802,8 +726,8 @@ <bool name="dirty">0</bool> <long name="makefile-last-written">0</long> <string name="Compiler name">"VC++ Project"</string> - <string name="Build mode">"Release"</string> - <string name="Unicode mode">"Unicode"</string> + <string name="Build mode">"Debug"</string> + <string name="Unicode mode">"ANSI"</string> <string name="Shared mode">"Static"</string> <string name="Modularity">"Modular"</string> <string name="GUI mode">"GUI"</string> @@ -856,28 +780,31 @@ <string name="CFG">""</string> </document> <document> - <string name="title">"VC++ Unicode Release"</string> - <string name="type">"vc-config-data-document"</string> + <string name="title">"GCC Release Unicode"</string> + <string name="type">"gcc-config-data-document"</string> <string name="filename">""</string> <string name="icon-name">""</string> <long name="is-transient">0</long> <long name="owns-file">1</long> <long name="title-mode">0</long> <long name="locked">0</long> - <string name="template-name">"VC++"</string> - <bool name="dirty">1</bool> + <string name="template-name">"GCC"</string> + <bool name="dirty">0</bool> <long name="makefile-last-written">0</long> - <string name="Compiler name">"VC++"</string> + <string name="Compiler name">"GCC"</string> <string name="Build mode">"Release"</string> <string name="Unicode mode">"Unicode"</string> <string name="Shared mode">"Static"</string> <string name="Modularity">"Modular"</string> <string name="GUI mode">"GUI"</string> - <string name="Toolkit">"wxMSW"</string> + <string name="Toolkit">"wxGTK+2"</string> <string name="Runtime linking">"Dynamic"</string> <string name="Use exceptions">"Yes"</string> <string name="Use ODBC">"No"</string> <string name="Use OpenGL">"No"</string> + <string name="Use wx-config">"Yes"</string> + <string name="Use installed wxWidgets">"No"</string> + <string name="Enable universal binaries">"No"</string> <string name="wxWidgets version">"%WXVERSION%"</string> <string name="Executable name">"%EXECUTABLE%"</string> <string name="Program arguments">""</string> @@ -910,31 +837,38 @@ <string name="PATH variable">"%AUTO%"</string> <bool name="Suppress source rules">0</bool> <bool name="Enable makefile generation">1</bool> - <string name="CFG">""</string> + <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> </document> <document> - <string name="title">"VC++ Unicode Debug"</string> - <string name="type">"vc-config-data-document"</string> + <string name="title">"GCC Debug Unicode"</string> + <string name="type">"gcc-config-data-document"</string> <string name="filename">""</string> <string name="icon-name">""</string> <long name="is-transient">0</long> <long name="owns-file">1</long> <long name="title-mode">0</long> <long name="locked">0</long> - <string name="template-name">"VC++"</string> - <bool name="dirty">1</bool> + <string name="template-name">"GCC"</string> + <bool name="dirty">0</bool> <long name="makefile-last-written">0</long> - <string name="Compiler name">"VC++"</string> + <string name="Compiler name">"GCC"</string> <string name="Build mode">"Debug"</string> <string name="Unicode mode">"Unicode"</string> <string name="Shared mode">"Static"</string> <string name="Modularity">"Modular"</string> <string name="GUI mode">"GUI"</string> - <string name="Toolkit">"wxMSW"</string> + <string name="Toolkit">"wxGTK+2"</string> <string name="Runtime linking">"Dynamic"</string> <string name="Use exceptions">"Yes"</string> <string name="Use ODBC">"No"</string> <string name="Use OpenGL">"No"</string> + <string name="Use wx-config">"Yes"</string> + <string name="Use installed wxWidgets">"No"</string> + <string name="Enable universal binaries">"No"</string> <string name="wxWidgets version">"%WXVERSION%"</string> <string name="Executable name">"%EXECUTABLE%"</string> <string name="Program arguments">""</string> @@ -967,74 +901,12 @@ <string name="PATH variable">"%AUTO%"</string> <bool name="Suppress source rules">0</bool> <bool name="Enable makefile generation">1</bool> - <string name="CFG">""</string> + <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> </document> - <document> - <string name="title">"VC++ Project unicode Debug"</string> - <string name="type">"vc-project-config-data-document"</string> - <string name="filename">""</string> - <string name="icon-name">""</string> - <long name="is-transient">0</long> - <long name="owns-file">1</long> - <long name="title-mode">0</long> - <long name="locked">0</long> - <string name="template-name">"VC++ Project"</string> - <bool name="dirty">0</bool> - <long name="makefile-last-written">0</long> - <string name="Compiler name">"VC++ Project"</string> - <string name="Build mode">"Debug"</string> - <string name="Unicode mode">"ANSI"</string> - <string name="Shared mode">"Static"</string> - <string name="Modularity">"Modular"</string> - <string name="GUI mode">"GUI"</string> - <string name="Toolkit">"wxMSW"</string> - <string name="Runtime linking">"Dynamic"</string> - <string name="Use exceptions">"Yes"</string> - <string name="Use ODBC">"No"</string> - <string name="Use OpenGL">"No"</string> - <string name="Compiler version">"6"</string> - <string name="wxWidgets version">"%WXVERSION%"</string> - <string name="Executable name">"%EXECUTABLE%"</string> - <string name="Program arguments">""</string> - <string name="Working path">"%AUTO%"</string> - <string name="Output path">"%AUTO%"</string> - <string name="Objects path">"%AUTO%"</string> - <string name="Compiler location">"%AUTO%"</string> - <string name="wxWidgets location">"%AUTO%"</string> - <string name="C++ command">"%AUTO%"</string> - <string name="Resource compiler">"%AUTO%"</string> - <string name="Make command">"%AUTO%"</string> - <string name="Project makefile">"%AUTO%"</string> - <string name="wxWidgets makefile">"%AUTO%"</string> - <string name="Compiler bin path">"%AUTO%"</string> - <string name="Compiler include path">"%AUTO%"</string> - <string name="Compiler lib path">"%AUTO%"</string> - <string name="Preprocessor flags">"%AUTO%"</string> - <string name="Optimizations">"%AUTO%"</string> - <string name="Warnings">"%AUTO%"</string> - <string name="Debug flags">"%AUTO%"</string> - <string name="Libraries">"%AUTO%"</string> - <string name="Library path">"%AUTO%"</string> - <string name="Linker flags">"%AUTO%"</string> - <string name="Include path">"%AUTO%"</string> - <string name="Resource flags">"%AUTO%"</string> - <string name="Resource path">"%AUTO%"</string> - <string name="wxWidgets build path">"%AUTO%"</string> - <string name="wxWidgets build command">"%AUTO%"</string> - <string name="wxWidgets clean command">"%AUTO%"</string> - <string name="PATH variable">"%AUTO%"</string> - <bool name="Suppress source rules">0</bool> - <bool name="Enable makefile generation">1</bool> - <string name="Project make command">"%AUTO%"</string> - <string name="Project build command">"%AUTO%"</string> - <string name="Project rebuild command">"%AUTO%"</string> - <string name="Project clean command">"%AUTO%"</string> - <string name="Project debug command">"%AUTO%"</string> - <string name="Pre-build command">"%AUTO%"</string> - <string name="Post-build command">"%AUTO%"</string> - <string name="Pre-link command">"%AUTO%"</string> - <string name="CFG">""</string> - </document> </document> </document> </data> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-17 11:21:29
|
Revision: 885 http://can.svn.sourceforge.net/can/?rev=885&view=rev Author: akhe Date: 2008-04-17 04:21:20 -0700 (Thu, 17 Apr 2008) Log Message: ----------- Fixed bug for command frame send. Renamed ...RESPONSE opcode to ...REPLY Modified Paths: -------------- trunk/firmware/common/vscp_serial.c trunk/firmware/common/vscp_serial.h Property Changed: ---------------- trunk/src/vscp/ trunk/src/vscp/common/ trunk/src/vscp/samples/testinterface/VCProjectDebug/ trunk/src/vscp/samples/testinterface/VCUnicodeDebug/ Modified: trunk/firmware/common/vscp_serial.c =================================================================== --- trunk/firmware/common/vscp_serial.c 2008-04-16 20:26:51 UTC (rev 884) +++ trunk/firmware/common/vscp_serial.c 2008-04-17 11:21:20 UTC (rev 885) @@ -420,7 +420,7 @@ vs_bufferSerialByte( STX ); // ACK Code - vs_bufferSerialByteSubst( &checksum, VSCP_SERIAL_OPCODE_ERROR ); + vs_bufferSerialByteSubst( &checksum, VSCP_SERIAL_OPCODE_COMMAND ); // Flags: Data byte count vs_bufferSerialByteSubst( &checksum, count ); Modified: trunk/firmware/common/vscp_serial.h =================================================================== --- trunk/firmware/common/vscp_serial.h 2008-04-16 20:26:51 UTC (rev 884) +++ trunk/firmware/common/vscp_serial.h 2008-04-17 11:21:20 UTC (rev 885) @@ -88,7 +88,7 @@ #define VSCP_SERIAL_OPCODE_ACK 251 #define VSCP_SERIAL_OPCODE_NACK 252 #define VSCP_SERIAL_OPCODE_ERROR 253 -#define VSCP_SERIAL_OPCODE_RESPONSE 254 +#define VSCP_SERIAL_OPCODE_REPLY 254 #define VSCP_SERIAL_OPCODE_COMMAND 255 // CAN flag bits (uses data byte 0-3 for id and Property changes on: trunk/src/vscp ___________________________________________________________________ Name: svn:ignore - Deliveryx Delivery *.ncb *.opt delivery deliveryx VCProjectunicodeDebug + Deliveryx Delivery *.ncb *.opt delivery deliveryx VCProjectunicodeDebug ReleaseDll Release Property changes on: trunk/src/vscp/common ___________________________________________________________________ Name: svn:ignore + Debug Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug ___________________________________________________________________ Name: svn:ignore + *.obj *.exe *.ilk Property changes on: trunk/src/vscp/samples/testinterface/VCUnicodeDebug ___________________________________________________________________ Name: svn:ignore + *.obj *.exe *.ilk *.pdb This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-16 20:26:56
|
Revision: 884 http://can.svn.sourceforge.net/can/?rev=884&view=rev Author: akhe Date: 2008-04-16 13:26:51 -0700 (Wed, 16 Apr 2008) Log Message: ----------- Trim problem fixed (again ;-/ ) Modified Paths: -------------- trunk/firmware/arm/str/cantest_str75x_iar/str75x_lib/src/75x_can.c trunk/src/vscp/common/canal.h trunk/src/vscp/common/vscptcpif.cpp trunk/src/vscp/vscpworks/dlgnewvscpsession.cpp trunk/src/vscp/vscpworks/vscpworks.cpp Modified: trunk/firmware/arm/str/cantest_str75x_iar/str75x_lib/src/75x_can.c =================================================================== --- trunk/firmware/arm/str/cantest_str75x_iar/str75x_lib/src/75x_can.c 2008-04-16 18:35:26 UTC (rev 883) +++ trunk/firmware/arm/str/cantest_str75x_iar/str75x_lib/src/75x_can.c 2008-04-16 20:26:51 UTC (rev 884) @@ -56,12 +56,16 @@ /* Private variables ---------------------------------------------------------*/ /* array of pre-defined timing parameters for standard bitrates*/ -u16 CanTimings[] = { /* value bitrate NTQ TSEG1 TSEG2 SJW BRP */ - CAN_TIMING(11, 4, 4, 5), /* 0x3AC4 100 kbit/s 16 11 4 4 5 */ - CAN_TIMING(11, 4, 4, 4), /* 0x3AC3 125 kbit/s 16 11 4 4 4 */ - CAN_TIMING( 4, 3, 3, 4), /* 0x2383 250 kbit/s 8 4 3 3 4 */ - CAN_TIMING(13, 2, 1, 1), /* 0x1C00 500 kbit/s 16 13 2 1 1 */ - CAN_TIMING( 4, 3, 1, 1), /* 0x2300 1 Mbit/s 8 4 3 1 1 */ +u16 CanTimings[] = { /* value bitrate NTQ TSEG1 TSEG2 SJW BRP Sample point */ + CAN_TIMING(11, 4, 4, 5), /* 10 kbit/s 24 16 7 4 32 70.8% */ + CAN_TIMING(12, 2, 2, 25), /* 20 kbit/s 16 12 2 1 25 87.5% */ + CAN_TIMING(12, 2, 2, 10), /* 50 kbit/s 16 12 2 1 10 87.5% */ + CAN_TIMING(11, 4, 4, 5), /* 0x3AC4 100 kbit/s 16 11 4 4 5 75% */ + CAN_TIMING(11, 4, 4, 4), /* 0x3AC3 125 kbit/s 16 11 4 4 4 75% */ + CAN_TIMING( 4, 3, 3, 4), /* 0x2383 250 kbit/s 8 4 3 3 4 62.5% */ + CAN_TIMING(13, 2, 1, 1), /* 0x1C00 500 kbit/s 16 13 2 1 1 87.5% */ + CAN_TIMING(13, 2, 1, 1), /* 800 kbit/s 10 7 2 1 1 80% */ + CAN_TIMING( 4, 3, 1, 1), /* 0x2300 1 Mbit/s 8 4 3 1 1 62.5% */ }; /* Private function prototypes -----------------------------------------------*/ Modified: trunk/src/vscp/common/canal.h =================================================================== --- trunk/src/vscp/common/canal.h 2008-04-16 18:35:26 UTC (rev 883) +++ trunk/src/vscp/common/canal.h 2008-04-16 20:26:51 UTC (rev 884) @@ -416,7 +416,7 @@ #define CANAL_BAUD_20 8 // 20 Kbit #define CANAL_BAUD_10 9 // 10 Kbit -/// Status message codes ( in received message) +/// Status message codes ( in received message ) #define CANAL_STATUSMSG_OK 0x00 // Normal condition. #define CANAL_STATUSMSG_OVERRUN 0x01 // Overrun occured when sending data to CAN bus. #define CANAL_STATUSMSG_BUSLIGHT 0x02 // Error counter has reached 96. Modified: trunk/src/vscp/common/vscptcpif.cpp =================================================================== --- trunk/src/vscp/common/vscptcpif.cpp 2008-04-16 18:35:26 UTC (rev 883) +++ trunk/src/vscp/common/vscptcpif.cpp 2008-04-16 20:26:51 UTC (rev 884) @@ -184,7 +184,8 @@ // Username strUsername = tkz.GetNextToken(); - strUsername.Trim(); + strUsername.Trim(false); + strUsername.Trim(); if ( strUsername.length() ) { // If a username is given a password is required bUsePassword = true; @@ -195,7 +196,8 @@ // Password strPassword = tkz.GetNextToken(); - strPassword.Trim(); + strPassword.Trim(false); + strPassword.Trim(); wxLogDebug( _("strPassword = ") ); wxLogDebug( strPassword ); @@ -204,8 +206,9 @@ if ( wxstr.length() ) { strHostname = wxstr; } - strHostname.Trim(); - + strHostname.Trim(false); + strHostname.Trim(); + wxLogDebug( _("strHostname = ") ); wxLogDebug( strHostname ); @@ -233,17 +236,20 @@ const wxString& strUsername, const wxString& strPassword ) { - wxString strBuf; - - // Create the socket + wxString strBuf; + wxString wxstr; + + // Create the socket if ( NULL == ( m_psock = new wxSocketClient( wxSOCKET_BLOCK ) ) ) return CANAL_ERROR_GENERIC; // Here if we are connected //m_psock->SetFlags( wxSOCKET_NOWAIT ); m_psock->SetTimeout(2); - + + wxstr = strHostname; + wxstr.Trim(false); wxIPV4address addr; - addr.Hostname( strHostname ); + addr.Hostname( wxstr ); addr.Service( port ); // Connect to server @@ -268,13 +274,17 @@ wxLogDebug( _("Successfully connected to ") + strHostname ); - // Username - strBuf = _("USER ") + strUsername + _("\r\n"); + // Username + wxstr = strUsername; + wxstr.Trim(false); + strBuf = _("USER ") + wxstr + _("\r\n"); m_psock->Write( strBuf.mb_str(), strBuf.length() ); if ( !checkReturnValue() ) return 0; - // Password - strBuf = _("PASS ") + strPassword + _("\r\n"); + // Password + wxstr = strPassword; + wxstr.Trim(false); + strBuf = _("PASS ") + wxstr + _("\r\n"); m_psock->Write( strBuf.mb_str(), strBuf.length() ); if ( !checkReturnValue() ) return 0; Modified: trunk/src/vscp/vscpworks/dlgnewvscpsession.cpp =================================================================== --- trunk/src/vscp/vscpworks/dlgnewvscpsession.cpp 2008-04-16 18:35:26 UTC (rev 883) +++ trunk/src/vscp/vscpworks/dlgnewvscpsession.cpp 2008-04-16 20:26:51 UTC (rev 884) @@ -344,8 +344,14 @@ if ( NULL != pInfo ) { pInfo->m_strDescription = dlg.m_RemoteServerDescription->GetValue(); pInfo->m_strHost = dlg.m_RemoteServerURL->GetValue(); + pInfo->m_strHost.Trim(false); + pInfo->m_strHost.Trim(); pInfo->m_strUser = dlg.m_RemoteServerUsername->GetValue(); + pInfo->m_strUser.Trim(false); + pInfo->m_strUser.Trim(); pInfo->m_strPassword = dlg.m_RemoteServerPassword->GetValue(); + pInfo->m_strPassword.Trim(false); + pInfo->m_strPassword.Trim(); dlg.m_RemoteServerPort->GetValue().ToULong( &pInfo->m_port ); wxString str; str = dlg.m_GUID0->GetValue(); Modified: trunk/src/vscp/vscpworks/vscpworks.cpp =================================================================== --- trunk/src/vscp/vscpworks/vscpworks.cpp 2008-04-16 18:35:26 UTC (rev 883) +++ trunk/src/vscp/vscpworks/vscpworks.cpp 2008-04-16 20:26:51 UTC (rev 884) @@ -2068,9 +2068,8 @@ } else if (subsubchild->GetName() == wxT("host")) { - - pVSCPif->m_strHost = subsubchild->GetNodeContent().Trim(); - + pVSCPif->m_strHost = subsubchild->GetNodeContent(); + pVSCPif->m_strHost.Trim(false); } else if (subsubchild->GetName() == wxT("port")) { @@ -2086,12 +2085,16 @@ } else if (subsubchild->GetName() == wxT("username")) { - pVSCPif->m_strUser = subsubchild->GetNodeContent().Trim(); + pVSCPif->m_strUser = subsubchild->GetNodeContent().Trim(); + pVSCPif->m_strUser.Trim(false); + pVSCPif->m_strUser.Trim(); } else if (subsubchild->GetName() == wxT("password")) { - pVSCPif->m_strPassword = subsubchild->GetNodeContent().Trim(); + pVSCPif->m_strPassword = subsubchild->GetNodeContent().Trim(); + pVSCPif->m_strPassword.Trim(false); + pVSCPif->m_strPassword.Trim(); } else if (subsubchild->GetName() == wxT("guid")) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-16 18:35:39
|
Revision: 883 http://can.svn.sourceforge.net/can/?rev=883&view=rev Author: akhe Date: 2008-04-16 11:35:26 -0700 (Wed, 16 Apr 2008) Log Message: ----------- Fixed bug that allowed for space(s) before hostname which did not resolve and therefore not connect. Modified Paths: -------------- trunk/TODO trunk/src/vscp/common/vscptcpif.cpp trunk/src/vscp/vscpworks/vscpworks.cpp trunk/src/vscp/vscpworks/vscpworks.pjd Modified: trunk/TODO =================================================================== --- trunk/TODO 2008-04-16 09:35:56 UTC (rev 882) +++ trunk/TODO 2008-04-16 18:35:26 UTC (rev 883) @@ -17,7 +17,9 @@ - Check direct CANAL interface. - Hide transmit windows in receive mode. - Connection is not lost when server restarts. +- Dialog needed for "test connection" + Daemon ====== - Debug levels for the daeon in runtime version. Modified: trunk/src/vscp/common/vscptcpif.cpp =================================================================== --- trunk/src/vscp/common/vscptcpif.cpp 2008-04-16 09:35:56 UTC (rev 882) +++ trunk/src/vscp/common/vscptcpif.cpp 2008-04-16 18:35:26 UTC (rev 883) @@ -1,2198 +1,2201 @@ -/////////////////////////////////////////////////////////////////////////////// -// vscptcpif.cpp: -// -// This file is part is part of CANAL (CAN Abstraction Layer) -// http://can.sourceforge.net) -// -// Copyright (C) 2000-2008 Ake Hedman, eurosource, <ak...@eu...> -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// $RCSfile: canaltcpif.cpp,v $ -// $Date: 2005/08/24 21:56:55 $ -// $Author: akhe $ -// $Revision: 1.4 $ -/////////////////////////////////////////////////////////////////////////////// - - - -#ifdef __GNUG__ - //#pragma implementation -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -#ifdef __WXMSW__ - #include "wx/ownerdrw.h" -#endif - -#ifdef WIN32 -#include "winsock.h" -#endif - -#include <wx/thread.h> -#include <wx/datetime.h> -#include <wx/socket.h> -#include <wx/tokenzr.h> -#include <wx/listimpl.cpp> -#include <wx/event.h> - -#include "canal_macro.h" -#include "canal_win32_ipc.h" -#include "../common/canal.h" -#include "vscptcpif.h" - -WX_DEFINE_LIST( EVENT_RX_QUEUE ); -WX_DEFINE_LIST( EVENT_TX_QUEUE ); - - - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -VscpTcpIf::VscpTcpIf() -{ - m_psock = NULL; - m_bModeReceiveLoop = false; - m_responseTimeOut = DEFAULT_RESPONSE_TIMEOUT; -} - - -VscpTcpIf::~VscpTcpIf() -{ - if ( NULL != m_psock ) delete m_psock; -} - -/////////////////////////////////////////////////////////////////////////////// -// checkReturnValue -// - -bool VscpTcpIf::checkReturnValue( void ) -{ - bool rv = false; - bool bDone = false; - wxString wxstr; - char buf[ 512 ]; - wxDateTime start,now; - - start.SetToCurrent(); - - m_strReply.Empty(); - - do { - - wxTimeSpan tt = wxDateTime::Now() - start; - - // Check for timeout - if ( tt.GetSeconds() > m_responseTimeOut ) { - wxLogDebug( _("CHECKRETURNVALUE: TCP/IP Timeout") ); - return false; - } - - memset( buf, 0, sizeof( buf ) - 1 ); - - m_psock->Read( buf, sizeof( buf ) - 1 ); - if ( m_psock->Error() ) { - unsigned long errorcode = m_psock->LastError(); - wxLogDebug( _("CHECKRETURNVALUE: TCP/IP Communication error = %d"), errorcode ); - if ( errorcode != wxSOCKET_TIMEDOUT ) { - return false; // return on all errors except timeout - } - } - - if ( m_psock->LastCount() > 0 ) { - buf[ m_psock->LastCount() ] = 0; - //wxLogDebug( _("Length of reply = %d"), m_psock->LastCount() ); - wxString str(buf, wxConvUTF8); - m_strReply += str; - //wxLogDebug( _("CHECKRETURNVALUE :") + str ); - } - - if ( wxNOT_FOUND != m_strReply.Find(_("+OK")) ) { - //wxLogDebug( _("CHECKRETURNVALUE: Command suceeded!") ); - bDone = TRUE; - rv = true; - } - else if ( wxNOT_FOUND != m_strReply.Find(_("-OK")) ) { - //wxLogDebug( _("CHECKRETURNVALUE: Command failed!") ); - bDone = TRUE; - rv = false; - } - - } - while ( !bDone ); - - return rv; -} - -/////////////////////////////////////////////////////////////////////////////// -// doCommand -// - -bool VscpTcpIf::doCommand( unsigned char cmd ) -{ - cmd = cmd; // supress warning - return true; -} - -/////////////////////////////////////////////////////////////////////////////// -// doCmdOpen -// - -long VscpTcpIf::doCmdOpen( const wxString& strInterface, unsigned long flags ) -{ - //int pos; - bool bUsePassword = false; - short port = VSCP_LEVEL2_TCP_PORT; - - wxString wxstr; - wxString strUsername; - wxString strPassword; - wxString strHostname; - - flags=flags; // supress warning - - wxLogDebug( _("strInterface = ") ); - wxLogDebug( strInterface ); - - // Create working copy - wxString strBuf = strInterface; - - wxStringTokenizer tkz( strInterface, _(";") ); - - // Username - strUsername = tkz.GetNextToken(); - if ( strUsername.length() ) { - // If a username is given a password is required - bUsePassword = true; - } - - wxLogDebug( _("strUsername = ") ); - wxLogDebug( strUsername ); - - // Password - strPassword = tkz.GetNextToken(); - wxLogDebug( _("strPassword = ") ); - wxLogDebug( strPassword ); - - // Hostname - wxstr = tkz.GetNextToken(); - if ( wxstr.length() ) { - strHostname = wxstr; - } - - wxLogDebug( _("strHostname = ") ); - wxLogDebug( strHostname ); - - // Port - long val; - wxstr = tkz.GetNextToken(); - if ( wxstr.length() ) { - wxstr.ToLong( &val ); - port = (short)val; - } - - - return doCmdOpen( strHostname, - port, - strUsername, - strPassword ); -} - -/////////////////////////////////////////////////////////////////////////////// -// doCmdOpen -// - -long VscpTcpIf::doCmdOpen( const wxString& strHostname, - const short port, - const wxString& strUsername, - const wxString& strPassword ) -{ - wxString strBuf; - - // Create the socket - if ( NULL == ( m_psock = new wxSocketClient( wxSOCKET_BLOCK ) ) ) return CANAL_ERROR_GENERIC; - - // Here if we are connected - //m_psock->SetFlags( wxSOCKET_NOWAIT ); - m_psock->SetTimeout(2); - - wxIPV4address addr; - addr.Hostname( strHostname ); - addr.Service( port ); - - // Connect to server - m_psock->Connect( addr, false ); - - wxLogDebug( _("Connect in progress with server ") + strHostname ); - - if ( !m_psock->WaitOnConnect( 30 ) ) { - return 0; - } - - - wxLogDebug( _("Checking server respons") ); - - if ( !checkReturnValue() ) { - wxLogDebug( _("No response from ") + strHostname ); - wxLogDebug( _("------------------------------------------------------") ); - wxLogDebug( _("No response from ") + strHostname ); - wxLogDebug( _("------------------------------------------------------") ); - return 0; - } - - wxLogDebug( _("Successfully connected to ") + strHostname ); - - // Username - strBuf = _("USER ") + strUsername + _("\r\n"); - m_psock->Write( strBuf.mb_str(), strBuf.length() ); - if ( !checkReturnValue() ) return 0; - - // Password - strBuf = _("PASS ") + strPassword + _("\r\n"); - m_psock->Write( strBuf.mb_str(), strBuf.length() ); - if ( !checkReturnValue() ) return 0; - - wxLogDebug( _("Successfull log in to VSCP server") ); - - return 1922; // Driver hanle == any value -} - - - - -/////////////////////////////////////////////////////////////////////////////// -// close -// - -int VscpTcpIf::doCmdClose( void ) -{ - int rv; - - if ( NULL == m_psock ) return CANAL_ERROR_GENERIC; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_GENERIC; // Must be connected - - wxString strCmd(_("QUIT\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - - if ( checkReturnValue() ) { - rv = CANAL_ERROR_SUCCESS; - } - else { - rv = CANAL_ERROR_GENERIC; - } - - m_psock->Close(); - if ( NULL != m_psock ) delete m_psock; - m_psock = NULL; - - return rv; -} - - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdNOOP -// - -int VscpTcpIf::doCmdNOOP( void ) -{ - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - wxString strCmd(_("NOOP\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - - if ( checkReturnValue() ) { - return CANAL_ERROR_SUCCESS; - } - else { - return CANAL_ERROR_GENERIC; - } -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdSend -// - - -int VscpTcpIf::doCmdSend( const vscpEvent *pEvent ) -{ - uint16_t i; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - wxString strBuf, strWrk, strGUID; - unsigned char guidsum = 0; - - // Must be a valid data pointer if data - if ( ( pEvent->sizeData > 0 ) && ( NULL == pEvent->pdata ) ) return CANAL_ERROR_GENERIC; - - //send head,class,type,obid,timestamp,GUID,data1,data2,data3.... - strBuf.Printf( _("SEND %d,%d,%d,%lu,%lu,"), - pEvent->head, - pEvent->vscp_class, - pEvent->vscp_type, - pEvent->obid, - pEvent->timestamp ); - - // GUID - for ( i=0; i<16; i++ ) { - - guidsum += pEvent->GUID[ i ]; - strWrk.Printf( _("%d"), pEvent->GUID[ i ] ); - if ( i != 15 ) { - strWrk += _(":"); - } - - strGUID += strWrk; - } - - if ( 0 == guidsum ) { - strBuf += _("-"); - } - else { - strBuf += strGUID; - } - - strBuf += _(","); - - // Data - for ( i=0; i<pEvent->sizeData; i++ ) { - strWrk.Printf( _("%d"), pEvent->pdata[ i ] ); - strBuf += strWrk; - if ( i != ( pEvent->sizeData - 1 ) ) { - strBuf += _(","); - } - } - - strBuf += _("\r\n"); - - m_psock->Write( strBuf.mb_str(), strBuf.length() ); - - if ( checkReturnValue() ) { - return CANAL_ERROR_SUCCESS; - } - else { - return CANAL_ERROR_GENERIC; - } - -} - - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdSendEx -// - -int VscpTcpIf::doCmdSendEx( const vscpEventEx *pEvent ) -{ - uint16_t i; - wxString strBuf, strWrk, strGUID; - unsigned char guidsum = 0; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - //send head,class,type,obid,timestamp,GUID,data1,data2,data3.... - strBuf.Printf( _("SEND %d,%d,%d,%lu,%lu,"), - pEvent->head, - pEvent->vscp_class, - pEvent->vscp_type, - pEvent->obid, - pEvent->timestamp ); - - // GUID - for ( i=0; i<16; i++ ) { - - guidsum += pEvent->GUID[ i ]; - strWrk.Printf(_("%02X"), pEvent->GUID[ i ] ); - - if ( i != 15 ) { - strWrk += _(":"); - } - strGUID += strWrk; - } - - if ( 0 == guidsum ) { - strBuf += _("-"); - } - else { - strBuf += strGUID; - } - - strBuf += _(","); - - // Data - for ( i=0; i<pEvent->sizeData; i++ ) { - strWrk.Printf( _("%d"), pEvent->data[ i ] ); - strBuf += strWrk; - if ( i != ( pEvent->sizeData - 1 ) ) { - strBuf += _(","); - } - } - - strBuf += _("\r\n"); - - m_psock->Write( strBuf.mb_str(), strBuf.length() ); - - if ( checkReturnValue() ) { - return CANAL_ERROR_SUCCESS; - } - else { - return CANAL_ERROR_GENERIC; - } - -} - - - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdSendLevel1 -// - -int VscpTcpIf::doCmdSendLevel1( const canalMsg *pCanalMsg ) -{ - vscpEventEx event; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - event.vscp_class = (unsigned short)( 0x1ff & ( pCanalMsg->id >> 16 ) ); - event.vscp_type = (unsigned char)( 0xff & ( pCanalMsg->id >> 8 ) ); - event.obid = pCanalMsg->obid; - event.timestamp = pCanalMsg->timestamp; - event.head = (unsigned char)( 0xf0 & ( pCanalMsg->id >> 20 ) ) | VSCP_HEADER_CAN_MSG; - - if ( pCanalMsg->flags & CANAL_IDFLAG_EXTENDED) { - event.head |= VSCP_HEADER_CAN_EXTENDED; - } - - if ( pCanalMsg->flags & CANAL_IDFLAG_RTR) { - event.head |= VSCP_HEADER_CAN_RTR; - } - - memset( event.GUID, 0, 16); - - event.GUID[ 15 ] = pCanalMsg->id & 0xff; - - event.sizeData = pCanalMsg->sizeData; - memcpy( event.data, pCanalMsg->data, pCanalMsg->sizeData ); - - return doCmdSendEx( &event ); - -} - -/////////////////////////////////////////////////////////////////////////////// -// getEventFromLine -// - -bool VscpTcpIf::getEventFromLine( const wxString& strLine, vscpEvent *pEvent ) -{ - wxStringTokenizer strTokens; - wxString strWrk; - wxString strGUID; - long val; - - // Check pointer - if ( NULL == pEvent ) return false; - - // Tokinize the string - strTokens.SetString( strLine, _(",\r\n") ); - - // Get head - pEvent->head = 0; - if ( strTokens.HasMoreTokens() ) { - strWrk = strTokens.GetNextToken(); - - strWrk.ToLong( &val ); - pEvent->head = (uint8_t)val; - - } - - // Get Class - pEvent->vscp_class = 0; - if ( strTokens.HasMoreTokens() ) { - - strWrk = strTokens.GetNextToken(); - - strWrk.ToLong( &val ); - pEvent->vscp_class = (uint16_t)val; - - } - - - // Get Type - pEvent->vscp_type = 0; - if ( strTokens.HasMoreTokens() ) { - - strWrk = strTokens.GetNextToken(); - - strWrk.ToLong( &val ); - pEvent->vscp_type = (uint16_t)val; - - } - - - - // Get OBID - pEvent->obid = 0; - if ( strTokens.HasMoreTokens() ) { - - strWrk = strTokens.GetNextToken(); - - strWrk.ToLong( &val ); - pEvent->obid = (uint16_t)val; - - } - - - // Get Timestamp - pEvent->timestamp = 0; - if ( strTokens.HasMoreTokens() ) { - - strWrk = strTokens.GetNextToken(); - - strWrk.ToLong( &val ); - pEvent->timestamp = (uint16_t)val; - - } - - - // Get GUID - if ( strTokens.HasMoreTokens() ) { - strGUID = strTokens.GetNextToken(); - } - - // Must have a GUID - if ( 0 == strGUID.length() ) return false; - - - // Handle data - pEvent->sizeData = 0; - char data[ 512 ]; - - while ( strTokens.HasMoreTokens() && ( pEvent->sizeData < 512 ) ) { - - strWrk = strTokens.GetNextToken(); - data[ pEvent->sizeData ] = readStringValue( strWrk ); - pEvent->sizeData++; - - } - - // Continue to handle GUID - getGuidFromString( pEvent, strGUID ); - - - // Copy in the data - pEvent->pdata = new unsigned char[ pEvent->sizeData ]; - if ( NULL != pEvent->pdata ) { - memcpy( pEvent->pdata, data, pEvent->sizeData ); - } - - return true; - -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdReceive -// - -int VscpTcpIf::doCmdReceive( vscpEvent *pEvent ) -{ - int pos; - wxStringTokenizer strTokens; - wxString strLine; - wxString strWrk; - wxString strGUID; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - if ( NULL == pEvent ) return CANAL_ERROR_GENERIC; - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - wxString strCmd(_("RETR\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - // Handle the data (if any) - pos = m_strReply.Find(_("\r")); - if ( !pos ) { - return CANAL_ERROR_GENERIC; // No reply data - } - - // Save the line - strLine = m_strReply.Left( pos ); - - // Take away the line we work on - m_strReply = m_strReply.Right( m_strReply.length() - pos - 1 ); - - if ( !getEventFromLine( strLine, pEvent ) ) return CANAL_ERROR_PARAMETER; - - return CANAL_ERROR_SUCCESS; - -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdReceiveEx -// - -int VscpTcpIf::doCmdReceiveEx( vscpEventEx *pEventEx ) -{ - int pos; - wxStringTokenizer strTokens; - wxString strLine; - wxString strBuf; - wxString strWrk; - wxString strGUID; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - if ( NULL == pEventEx ) return CANAL_ERROR_PARAMETER; - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - wxString strCmd(_("RETR\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - // Handle the data (if any) - pos = m_strReply.Find(_("\r") ); - if ( !pos ) { - return CANAL_ERROR_GENERIC; // No reply data - } - - // Save the line - strLine = m_strReply.Left( pos ); - - vscpEvent *pEvent = new vscpEvent; - if ( NULL == pEvent) return CANAL_ERROR_PARAMETER; - - if ( !getEventFromLine( strLine, pEvent ) ) return CANAL_ERROR_PARAMETER; - - if ( !convertVSCPtoEx( pEventEx, pEvent ) ) { - delete pEvent; - return CANAL_ERROR_PARAMETER; - } - - delete pEvent; - - return CANAL_ERROR_SUCCESS; - -} - - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdReceiveLevel1 -// - -int VscpTcpIf::doCmdReceiveLevel1( canalMsg *pCanalMsg ) -{ - vscpEventEx event; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // Must have a valid pointer - if ( NULL == pCanalMsg ) return CANAL_ERROR_PARAMETER; - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - // Fetch event - if ( CANAL_ERROR_SUCCESS != doCmdReceiveEx( &event ) ) return CANAL_ERROR_GENERIC; - - // No CAN or Level I event if data is > 8 - if ( event.sizeData > 8 ) return CANAL_ERROR_GENERIC; - - - pCanalMsg->id = (unsigned long)( ( event.head >> 5 ) << 20 ) | - ( (unsigned long)event.vscp_class << 16 ) | - ( (unsigned long)event.vscp_type << 8) | - event.GUID[ 15 ]; - - pCanalMsg->obid = event.obid; - pCanalMsg->sizeData = event.sizeData; - if ( pCanalMsg->sizeData ) { - memcpy( pCanalMsg->data, event.data, event.sizeData ); - } - - pCanalMsg->timestamp = event.timestamp; - - return CANAL_ERROR_SUCCESS; - -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdEnterReceiveLoop -// - -int VscpTcpIf::doCmdEnterReceiveLoop( void ) -{ - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - wxString strCmd(_("RCVLOOP\r\n")); - m_psock->SetTimeout( 2 ); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - m_strReply = _(""); - m_bModeReceiveLoop = true; - return CANAL_ERROR_SUCCESS; -} - -/////////////////////////////////////////////////////////////////////////////// -// doCmdBlockReceive -// - -int VscpTcpIf::doCmdBlockReceive( vscpEvent *pEvent, uint32_t timeout ) -{ - char buf[512]; - static wxString strBuf = _(""); - wxString strReply; - - timeout = timeout; - - // If not receive loop active terminate - if ( !m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - // TODO This eats 100% CPU time on Windows. Why!? - //if ( !m_psock->WaitForRead( 0, timeout ) ) { - // return CANAL_ERROR_TIMEOUT; - //} - - m_psock->Read( buf, sizeof( buf ) - 1 ); - - if ( m_psock->Error() ) { - if ( wxSOCKET_TIMEDOUT == m_psock->LastError() ) { - return CANAL_ERROR_TIMEOUT; - } - else if ( wxSOCKET_INVOP == m_psock->LastError() ) { - return CANAL_ERROR_COMMUNICATION; - } - else if ( wxSOCKET_IOERR == m_psock->LastError() ) { - return CANAL_ERROR_COMMUNICATION; - } - else if ( wxSOCKET_INVADDR == m_psock->LastError() ) { - return CANAL_ERROR_COMMUNICATION; - } - else if ( wxSOCKET_INVSOCK == m_psock->LastError() ) { - return CANAL_ERROR_COMMUNICATION; - } - else if ( wxSOCKET_NOHOST == m_psock->LastError() ) { - return CANAL_ERROR_COMMUNICATION; - } - else if ( wxSOCKET_INVPORT == m_psock->LastError() ) { - return CANAL_ERROR_COMMUNICATION; - } - else if ( wxSOCKET_WOULDBLOCK == m_psock->LastError() ) { - return CANAL_ERROR_FIFO_EMPTY; - } - else if ( wxSOCKET_MEMERR == m_psock->LastError() ) { - return CANAL_ERROR_COMMUNICATION; - } - else { - return CANAL_ERROR_COMMUNICATION; - } - } - - if ( m_psock->LastCount() > 0 ) { - buf[ m_psock->LastCount() ] = 0; - //wxLogDebug( _("Length of reply = %d"), m_psock->LastCount() ); - strBuf += wxString( buf, wxConvUTF8 ); - //wxLogDebug( strBuf ); - } - - int pos; - int rv = CANAL_ERROR_SUCCESS; - while ( ( pos = strBuf.Find( 0x0A ) ) ) { - - if ( wxNOT_FOUND == pos ) return CANAL_ERROR_FIFO_EMPTY; - if ( 0 == pos ) { - //wxLogDebug( _("pos == NULL") ); - strBuf = strBuf.Right( strBuf.Length() - 1 ); - //wxLogDebug( strBuf ); - rv = CANAL_ERROR_PARAMETER; - continue; - } - - wxString strLine; - strLine = strBuf.Mid( 0, pos ); - strBuf = strBuf.Mid( pos + 1 ); - - //wxLogDebug( _("[") + strLine + _("]") ); - - if ( wxNOT_FOUND != strLine.Find(_("+OK")) ) { - rv = CANAL_ERROR_FIFO_EMPTY; // No data - continue; - } - - //wxMessageBox( _("Line=") + strLine ); - //wxMessageBox( _("Buf=") + strBuf ); - - // Get the event - if ( !getEventFromLine( strLine, pEvent ) ) { - rv = CANAL_ERROR_PARAMETER; - continue; - } - - return CANAL_ERROR_SUCCESS; - - } - - return rv; - -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdDataAvailable -// - -int VscpTcpIf::doCmdDataAvailable( void ) -{ - wxString strLine; - int pos; - int nMsg = 0; - - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return 0; - - wxString strCmd(_("CDTA\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return 0; - - // Handle the data (if any) - pos = m_strReply.Find(_("\r") ); - if ( !pos ) { - return 0; // No reply data - } - - // Save the line - strLine = m_strReply.Left( pos ); - - long val; - if ( strLine.ToLong(&val) ) { - nMsg = (uint16_t)val; - } - - return nMsg; - -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdState -// - -int VscpTcpIf::doCmdStatus( canalStatus *pStatus ) -{ - int pos; - long val; - wxString strBuf; - wxString strWrk; - wxString strLine; - wxStringTokenizer strTokens; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - wxString strCmd(_("INFO\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - // Handle the data (if any) - pos = m_strReply.Find(_("\r") ); - if ( !pos ) { - return CANAL_ERROR_GENERIC; // No reply data - } - - // Save the line - strLine = m_strReply.Left( pos ); - - // channelstatus - strTokens.SetString( strLine, _(",\r\n") ); - - // lasterrorcode - if ( !strTokens.HasMoreTokens() ) return CANAL_ERROR_GENERIC; - ( strTokens.GetNextToken() ).ToLong( &val ); - pStatus->lasterrorcode = val; - - - // lasterrorsubcode - if ( !strTokens.HasMoreTokens() ) return CANAL_ERROR_GENERIC; - ( strTokens.GetNextToken() ).ToLong( &val ); - pStatus->lasterrorsubcode = val; - - - // lasterrorsubcode - if ( !strTokens.HasMoreTokens() ) return CANAL_ERROR_GENERIC; - strWrk = strTokens.GetNextToken(); - memcpy( pStatus->lasterrorstr, strWrk, sizeof(pStatus->lasterrorstr) ); - - return CANAL_ERROR_SUCCESS; - -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdStatistics -// - -int VscpTcpIf::doCmdStatistics( canalStatistics *pStatistics ) -{ - int pos; - long val; - wxString strBuf; - wxString strWrk; - wxString strLine; - wxStringTokenizer strTokens; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - wxString strCmd(_("STAT\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - // Handle the data (if any) - pos = m_strReply.Find(_("\r") ); - if ( !pos ) { - return CANAL_ERROR_GENERIC; // No reply data - } - - // Save the line - strLine = m_strReply.Left( pos ); - - strTokens.SetString( strLine, _(",\r\n")); - - // Busoff - pStatistics->cntBusOff = 0; - if ( ( strTokens.GetNextToken() ).ToLong( &val ) ) { - pStatistics->cntBusOff = val; - } - else { - return CANAL_ERROR_GENERIC; - } - - - // Buswarnings - pStatistics->cntBusWarnings = 0; - if ( ( strTokens.GetNextToken() ).ToLong( &val ) ) { - pStatistics->cntBusWarnings = val; - } - else { - return CANAL_ERROR_GENERIC; - } - - - - // Overruns - pStatistics->cntOverruns = 0; - if ( ( strTokens.GetNextToken() ).ToLong( &val ) ) { - pStatistics->cntOverruns = val; - } - else { - return CANAL_ERROR_GENERIC; - } - - - // Received data - pStatistics->cntReceiveData = 0; - if ( ( strTokens.GetNextToken() ).ToLong( &val ) ) { - pStatistics->cntReceiveData = val; - } - else { - return CANAL_ERROR_GENERIC; - } - - - - // Received Frames - pStatistics->cntReceiveFrames = 0; - if ( ( strTokens.GetNextToken() ).ToLong( &val ) ) { - pStatistics->cntReceiveFrames = val; - } - else { - return CANAL_ERROR_GENERIC; - } - - - - // Transmitted data - pStatistics->cntTransmitData = 0; - if ( ( strTokens.GetNextToken() ).ToLong( &val ) ) { - pStatistics->cntReceiveFrames = val; - } - else { - return CANAL_ERROR_GENERIC; - } - - - // Transmitted frames - pStatistics->cntTransmitFrames = 0; - if ( ( strTokens.GetNextToken() ).ToLong( &val ) ) { - pStatistics->cntTransmitFrames = val; - } - else { - return CANAL_ERROR_GENERIC; - } - - return CANAL_ERROR_SUCCESS; - -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdFilter -// - -int VscpTcpIf::doCmdFilter( vscpEventFilter *pFilter ) -{ - wxString strCmd; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - // filter-priority, filter-class, filter-type, filter-GUID - strCmd.Printf( _("SFLT %d,%d,%d,%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d\r\n"), - pFilter->filter_priority, - pFilter->filter_class, - pFilter->filter_type, - pFilter->filter_GUID[ 0 ], - pFilter->filter_GUID[ 1 ], - pFilter->filter_GUID[ 2 ], - pFilter->filter_GUID[ 3 ], - pFilter->filter_GUID[ 4 ], - pFilter->filter_GUID[ 5 ], - pFilter->filter_GUID[ 6 ], - pFilter->filter_GUID[ 7 ], - pFilter->filter_GUID[ 8 ], - pFilter->filter_GUID[ 9 ], - pFilter->filter_GUID[ 10 ], - pFilter->filter_GUID[ 11 ], - pFilter->filter_GUID[ 12 ], - pFilter->filter_GUID[ 13 ], - pFilter->filter_GUID[ 14 ], - pFilter->filter_GUID[ 15 ] ); - - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - - // mask-priority, mask-class, mask-type, mask-GUID - strCmd.Printf( _("SFLT %d,%d,%d,%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d\r\n"), - pFilter->mask_priority, - pFilter->mask_class, - pFilter->mask_type, - pFilter->mask_GUID[ 0 ], - pFilter->mask_GUID[ 1 ], - pFilter->mask_GUID[ 2 ], - pFilter->mask_GUID[ 3 ], - pFilter->mask_GUID[ 4 ], - pFilter->mask_GUID[ 5 ], - pFilter->mask_GUID[ 6 ], - pFilter->mask_GUID[ 7 ], - pFilter->mask_GUID[ 8 ], - pFilter->mask_GUID[ 9 ], - pFilter->mask_GUID[ 10 ], - pFilter->mask_GUID[ 11 ], - pFilter->mask_GUID[ 12 ], - pFilter->mask_GUID[ 13 ], - pFilter->mask_GUID[ 14 ], - pFilter->mask_GUID[ 15 ] ); - - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - return CANAL_ERROR_SUCCESS; -} - -/////////////////////////////////////////////////////////////////////////////// -// doCmdVersion -// - -unsigned long VscpTcpIf::doCmdVersion( void ) -{ - long val; - int pos; - unsigned char version[3]; - wxString strLine; - wxStringTokenizer strTokens; - - if ( NULL == m_psock ) return 0; // Must have a valid socket - if ( !m_psock->IsOk() ) return 0; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - wxString strCmd(_("VERS\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return 0; - - // Handle the data (if any) - pos = m_strReply.Find(_("\r") ); - if ( !pos ) { - return 0; // No reply data - } - - // Save the line - strLine = m_strReply.Left( pos ); - - strTokens.SetString( strLine, _(",\r\n")); - - // Major version - version[ 0 ] = 0; - if ( ( strTokens.GetNextToken() ).ToLong( &val ) ) { - version[ 0 ] = (uint8_t)val; - } - else { - return 0; - } - - // Minor version - version[ 1 ] = 0; - if ( ( strTokens.GetNextToken() ).ToLong( &val ) ) { - version[ 1 ] = (uint8_t)val; - } - else { - return 0; - } - - // Sub minor version - version[ 2 ] = 0; - if ( ( strTokens.GetNextToken() ).ToLong( &val ) ) { - version[ 2 ] = (uint8_t)val; - } - else { - return 0; - } - - return ( version[0] << 16 ) + ( version[1] << 8 ) + version[0]; - -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdDLLVersion -// - -unsigned long VscpTcpIf::doCmdDLLVersion( void ) -{ - return TCPIP_DLL_VERSION; -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdVendorString -// - -const char * VscpTcpIf::doCmdVendorString( void ) -{ - return wxString( TCPIP_VENDOR_STRING ).mb_str(); -} - -/////////////////////////////////////////////////////////////////////////////// -// doCmdGetDriverInfo -// - -const char * VscpTcpIf::doCmdGetDriverInfo( void ) -{ - return NULL; -} - -/////////////////////////////////////////////////////////////////////////////// -// doCmdGetGUID -// - -int VscpTcpIf::doCmdGetGUID( char *pGUID ) -{ - long val; - int pos; - wxString strLine; - wxStringTokenizer strTokens; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - wxString strCmd(_("SGID\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - // Handle the data (if any) - pos = m_strReply.Find(_("\r") ); - if ( !pos ) { - return CANAL_ERROR_GENERIC; // No reply data - } - - // Save the line - strLine = m_strReply.Left( pos ); - - strTokens.SetString( strLine, _(",\r\n")); - - if ( strTokens.HasMoreTokens() ) { - - int idx = 0; - wxStringTokenizer wrkToken( strTokens.GetNextToken(), _(":") ); - while ( wrkToken.HasMoreTokens() && ( idx < 16 ) ) { - - (wrkToken.GetNextToken()).ToLong( &val ); - pGUID[ idx ] = (uint8_t)val; - idx++; - - } - - if ( idx != 16 ) return CANAL_ERROR_GENERIC; - - } - else { - return CANAL_ERROR_GENERIC; - } - - return CANAL_ERROR_SUCCESS; - -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdSetGUID -// - -int VscpTcpIf::doCmdSetGUID( char *pGUID ) -{ - int pos; - wxString strLine; - wxString strCmd; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - if ( NULL == pGUID ) return CANAL_ERROR_GENERIC; - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - // Handle the data (if any) - - pos = m_strReply.Find(_("\r")); - if ( !pos ) { - return CANAL_ERROR_GENERIC; - } - - // Save the line - strLine = m_strReply.Left( pos ); - - strCmd.Printf( _("SGID %d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d\r\n"), - pGUID[ 0 ], - pGUID[ 1 ], - pGUID[ 2 ], - pGUID[ 3 ], - pGUID[ 4 ], - pGUID[ 5 ], - pGUID[ 6 ], - pGUID[ 7 ], - pGUID[ 8 ], - pGUID[ 9 ], - pGUID[ 10 ], - pGUID[ 11 ], - pGUID[ 12 ], - pGUID[ 13 ], - pGUID[ 14 ], - pGUID[ 15 ] - ); - - - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - return checkReturnValue(); -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdGetChannelInfo -// - - -int VscpTcpIf::doCmdGetChannelInfo( VSCPChannelInfo *pChannelInfo ) -{ - int rv; - wxStringTokenizer strTokens; - wxString strWrk; - - // Must have a valid pointer - if ( NULL == pChannelInfo ) return CANAL_ERROR_PARAMETER; - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - m_psock->Write( _("CHID\r\n"), 6 ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - strWrk = m_strReply; - - // Channel - strTokens.SetString( strWrk, _(",\r\n") ); - if ( strTokens.HasMoreTokens() ) { - long val; - ( strTokens.GetNextToken() ).ToLong( &val ); - pChannelInfo->channel = (uint16_t)val; - } - else { - return CANAL_ERROR_GENERIC; - } - - // Set the interface level/type - pChannelInfo->channelType = CANAL_COMMAND_OPEN_VSCP_LEVEL2; - - // Get the channel GUID - rv = doCmdGetGUID( pChannelInfo->GUID ); - - return rv; - -} - -/////////////////////////////////////////////////////////////////////////////// -// doCmdGetChannelID -// - -int VscpTcpIf::doCmdGetChannelID( unsigned long *pChannelID ) -{ - int pos; - wxString strLine; - - // Check pointer - if ( NULL == pChannelID ) return CANAL_ERROR_PARAMETER; - - wxString strCmd(_("CHID\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - // Handle the data (if any) - - pos = m_strReply.Find(_("\r")); - if ( !pos ) { - return CANAL_ERROR_GENERIC; // No reply data - } - - // Save the line - strLine = m_strReply.Left( pos ); - - if ( !strLine.ToULong( pChannelID ) ) { - return CANAL_ERROR_GENERIC; - } - - return CANAL_ERROR_SUCCESS; -} - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdInterfaceList -// - -int VscpTcpIf::doCmdInterfaceList( wxArrayString& array ) -{ - wxString strCmd(_("INTERFACE LIST\r\n")); - m_psock->Write( strCmd.mb_str(), strCmd.length() ); - if ( !checkReturnValue() ) return CANAL_ERROR_GENERIC; - - // Handle the data (if any) - wxStringTokenizer tkz( m_strReply, _("\r\n") ); - while ( tkz.HasMoreTokens() ) { - wxString str = tkz.GetNextToken(); - if ( wxNOT_FOUND == str.Find( _("+OK") ) ) { - array.Add( str ); - } - } - - return CANAL_ERROR_SUCCESS; -} - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - - - - - -/////////////////////////////////////////////////////////////////////////////// -// doCmdBinary -// - -int VscpTcpIf::doCmdBinary( void ) -{ - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected' - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - m_psock->Write( _("BIN1\r\n"), 6 ); - return checkReturnValue(); -} - - -/////////////////////////////////////////////////////////////////////////////// -// doBinaryNOOP -// - -int VscpTcpIf::doBinaryNOOP( void ) -{ - int rv = CANAL_ERROR_GENERIC; - unsigned char type; - unsigned short nRead; - char outbuf[2]; - char rbuf[512]; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - outbuf[0] = CANAL_BINARY_COMMAND_NOOP; - - if ( !Binary_WriteMsg( CANAL_BINARY_FRAME_TYPE_COMMAND, outbuf, 1 ) ) return CANAL_ERROR_GENERIC; - - // Wait for ACK - if ( Binary_ReadMsg( &type, rbuf, sizeof( rbuf ), &nRead ) ) { - if ( ( CANAL_BINARY_FRAME_TYPE_ERROR == type ) && - ( CANAL_BINARY_ERROR_NONE == rbuf[ 0 ] ) && - ( 1 == nRead ) ) { - rv = true; - } - } - - return rv; - -} - -/////////////////////////////////////////////////////////////////////////////// -// doBinaryClose -// - -int VscpTcpIf::doBinaryClose( void ) -{ - char outbuf[2]; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - outbuf[0] = CANAL_BINARY_COMMAND_CLOSE; - - if ( !Binary_WriteMsg( CANAL_BINARY_FRAME_TYPE_COMMAND, outbuf, 1 ) ) return CANAL_ERROR_GENERIC; - - return true; -} - -/////////////////////////////////////////////////////////////////////////////// -// doBinarySend -// - -int VscpTcpIf::doBinarySend( vscpEvent *pEvent ) -{ - unsigned short nRead; - unsigned char type; - char outbuf[512]; - char rbuf[512]; - int rv = CANAL_ERROR_GENERIC; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - outbuf[ 0 ] = pEvent->head; - outbuf[ 1 ] = ( pEvent->vscp_class >> 8 ) & 0xff; - outbuf[ 2 ] = pEvent->vscp_class & 0xff; - outbuf[ 3 ] = ( pEvent->vscp_type >> 8 ) & 0xff; - outbuf[ 4 ] = pEvent->vscp_type & 0xff; - memcpy( outbuf+5, pEvent->GUID, 16 ); - - // Handle data - if ( NULL != pEvent->pdata ) { - - memcpy( outbuf+22, pEvent->pdata, pEvent->sizeData ); - - if ( Binary_WriteMsg( CANAL_BINARY_FRAME_TYPE_VSCP, outbuf, pEvent->sizeData + 21 ) ) { - if ( Binary_ReadMsg( &type, rbuf, sizeof( rbuf ), &nRead ) ) { - if ( ( CANAL_BINARY_FRAME_TYPE_ERROR == type ) && - ( CANAL_BINARY_ERROR_NONE == rbuf[ 0 ] ) && - ( 1 == nRead ) ) { - rv = true; - } - } - } - } - - return rv; -} - -/////////////////////////////////////////////////////////////////////////////// -// doBinarySendEx -// - -int VscpTcpIf::doBinarySendEx( vscpEventEx *pEvent ) -{ - unsigned short nRead; - unsigned char type; - char outbuf[512]; - char rbuf[512]; - int rv = CANAL_ERROR_GENERIC; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - outbuf[ 0 ] = pEvent->head; - outbuf[ 1 ] = ( pEvent->vscp_class >> 8 ) & 0xff; - outbuf[ 2 ] = pEvent->vscp_class & 0xff; - outbuf[ 3 ] = ( pEvent->vscp_type >> 8 ) & 0xff; - outbuf[ 4 ] = pEvent->vscp_type & 0xff; - memcpy( outbuf+5, pEvent->GUID, 16 ); - - // Handle data - if ( pEvent->sizeData ) { - - memcpy( outbuf+22, pEvent->data, pEvent->sizeData ); - - if ( Binary_WriteMsg( CANAL_BINARY_FRAME_TYPE_VSCP, outbuf, pEvent->sizeData + 21 ) ) { - - if ( Binary_ReadMsg( &type, rbuf, sizeof( rbuf ), &nRead ) ) { - if ( ( CANAL_BINARY_FRAME_TYPE_ERROR == type ) && - ( CANAL_BINARY_ERROR_NONE == rbuf[ 0 ] ) && - ( 1 == nRead ) ) { - rv = true; - } - } - } - } - - return rv; -} - -/////////////////////////////////////////////////////////////////////////////// -// doBinaryReceive -// - -int VscpTcpIf::doBinaryReceive( vscpEvent *pEvent ) -{ - int rv = CANAL_ERROR_GENERIC; - char outbuf[2]; - char rbuf[512]; - unsigned short nRead; - unsigned char type; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - // Request a frame - outbuf[0] = CANAL_BINARY_COMMAND_READ; - Binary_WriteMsg( CANAL_BINARY_FRAME_TYPE_COMMAND, outbuf, 1 ); - - pEvent->pdata = NULL; - - if ( Binary_ReadMsg( &type, rbuf, sizeof( rbuf ), &nRead ) ) { - - if ( CANAL_BINARY_FRAME_TYPE_VSCP == type ) { - - pEvent->head = rbuf[ 0 ]; - pEvent->vscp_class = ( rbuf[1] << 8 ) + rbuf[3]; - pEvent->vscp_type = ( rbuf[3] << 8 ) + rbuf[5]; - memcpy( pEvent->GUID, rbuf + 5, 16 ); - - rv = true; - pEvent->sizeData = nRead - 21; - - if ( pEvent->sizeData ) { - unsigned char *pData = new unsigned char[nRead - 21]; - if ( NULL != pData ) { - memcpy( pData, rbuf + 21, nRead - 21 ); - pEvent->pdata = pData; - } - else { - // Unable to allocate space for data - rv = CANAL_ERROR_GENERIC; - } - } - - } - else if ( CANAL_BINARY_FRAME_TYPE_ERROR == rbuf[ 0 ] ) { - - m_lastBinaryError = rbuf[ 1 ]; - if ( CANAL_BINARY_ERROR_NO_DATA == rbuf[ 1 ] ) { - ; - } - - - } - - } - - return rv; -} - - -/////////////////////////////////////////////////////////////////////////////// -// doBinaryReceiveEx -// - -int VscpTcpIf::doBinaryReceiveEx( vscpEventEx *pEvent ) -{ - int rv = CANAL_ERROR_GENERIC; - char outbuf[2]; - char rbuf[512]; - unsigned short nRead; - unsigned char type; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - // Request a frame - outbuf[0] = CANAL_BINARY_COMMAND_READ; - Binary_WriteMsg( CANAL_BINARY_FRAME_TYPE_COMMAND, outbuf, 1 ); - - - if ( Binary_ReadMsg( &type, rbuf, sizeof( rbuf ), &nRead ) ) { - - if ( CANAL_BINARY_FRAME_TYPE_VSCP == type ) { - - pEvent->head = rbuf[ 0 ]; - pEvent->vscp_class = ( rbuf[1] << 8 ) + rbuf[3]; - pEvent->vscp_type = ( rbuf[3] << 8 ) + rbuf[5]; - memcpy( pEvent->GUID, rbuf + 5, 16 ); - pEvent->sizeData = nRead - 21; - - rv = true; - if ( pEvent->sizeData ) { - memcpy( pEvent->data, rbuf + 21, nRead - 21 ); - - } - else { - // Unable to allocate space for data - rv = CANAL_ERROR_GENERIC; - } - - } - else if ( CANAL_BINARY_FRAME_TYPE_ERROR == type ) { - - m_lastBinaryError = rbuf[0]; - if ( CANAL_BINARY_ERROR_NO_DATA == rbuf[0] ) { - ; - } - - - } - - } - - return rv; -} - -/////////////////////////////////////////////////////////////////////////////// -// Binary_WriteMsg -// - -int VscpTcpIf::Binary_WriteMsg( unsigned char type, const void *buffer, wxUint32 nbytes ) -{ - wxUint32 total; - int error; - int old_flags; - unsigned char outbuf[ 1024 ]; - wxUint32 msgcnt = 0; - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - error = true; - total = 0; - old_flags = m_psock->GetFlags(); - m_psock->SetFlags( ( m_psock->GetFlags() & wxSOCKET_BLOCK ) | wxSOCKET_WAITALL ); - - // SOF - outbuf[msgcnt++] = (unsigned char) 0x55; - outbuf[msgcnt++] = (unsigned char) 0xaa; - - outbuf[msgcnt++] = type; - - outbuf[msgcnt++] = (unsigned char) ((nbytes >> 8) & 0xff); - outbuf[msgcnt++] = (unsigned char) (nbytes & 0xff); - - memcpy( outbuf + msgcnt, buffer, nbytes ); - msgcnt += nbytes; - - if ( ( m_psock->Write( outbuf, msgcnt ).LastCount() ) < msgcnt ) { - goto exit; - } - - // everything was OK - error = CANAL_ERROR_GENERIC; - -exit: - - m_psock->SetFlags( old_flags ); - return !error; -} - -// discard buffer -#define MAX_DISCARD_SIZE (10 * 1024) - -/////////////////////////////////////////////////////////////////////////////// -// Binary_ReadMsg -// - -int VscpTcpIf::Binary_ReadMsg( unsigned char *pType, void *buffer, wxUint32 nbytes, unsigned short *pnRead ) -{ - wxUint32 len, len2, sig, total; - int error; - int old_flags; - struct { - unsigned char sig[2]; - unsigned char type; - unsigned char len[2]; - } msg; - - - if ( NULL == m_psock ) return CANAL_ERROR_PARAMETER; // Must have a valid socket - if ( !m_psock->IsOk() ) return CANAL_ERROR_PARAMETER; // Must be connected - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return CANAL_ERROR_PARAMETER; - - // Check pointers - if ( NULL == pType ) return CANAL_ERROR_PARAMETER; - if ( NULL == buffer ) return CANAL_ERROR_PARAMETER; - if ( NULL == pnRead ) return CANAL_ERROR_PARAMETER; - - - *pnRead = 0; - total = 0; - error = true; - old_flags = m_psock->GetFlags(); - m_psock->SetFlags( (old_flags & wxSOCKET_BLOCK) | wxSOCKET_WAITALL ); - - if ( m_psock->Read( &msg, sizeof( msg ) ).LastCount() != sizeof( msg ) ) { - goto exit; - } - - // Set type - *pType = msg.type; - - sig = (wxUint32)msg.sig[ 0 ]; - sig |= (wxUint32)(msg.sig[ 1 ] << 8); - - if ( sig != 0xaa55 ) { - wxLogWarning(_("wxSocket: invalid signature in ReadMsg.")); - goto exit; - } - - len = (wxUint16)msg.len[ 1 ]; - len |= (wxUint16)(msg.len[ 0 ] << 8); - - if ( len > nbytes ) { - len2 = len - nbytes; - len = nbytes; - } - else { - len2 = 0; - } - - // Don't attemp to read if the msg was zero bytes long. - if ( len ) { - total = m_psock->Read( buffer, len ).LastCount(); - - if (total != len) { - goto exit; - } - } - if ( len2 ) { - char *discard_buffer = new char[MAX_DISCARD_SIZE]; - long discard_len; - - // NOTE: discarded bytes don't add to m_lcount. - do { - - discard_len = ( ( len2 > MAX_DISCARD_SIZE)? MAX_DISCARD_SIZE : len2 ); - discard_len = m_psock->Read(discard_buffer, (wxUint32)discard_len).LastCount(); - len2 -= (wxUint32)discard_len; - - } while ( ( discard_len > 0 ) && len2 ); - - delete [] discard_buffer; - - if (len2 != 0) { - goto exit; - } - - } - - // everything was OK - error = CANAL_ERROR_GENERIC; - *pnRead = len; - -exit: - - m_psock->SetFlags( old_flags ); - - return !CANAL_ERROR_GENERIC; -} - - -/////////////////////////////////////////////////////////////////////////////// -// sendBinaryErrorFrame -// - -void VscpTcpIf::sendBinaryErrorFrame( unsigned char error_code ) -{ - char buf[2]; - - // If receive loop active terminate - if ( m_bModeReceiveLoop ) return; - - buf[0] = error_code; - Binary_WriteMsg( CANAL_BINARY_FRAME_TYPE_ERROR, buf, 1 ); -} - - - -//////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Constructor -// - -ctrlObjVscpTcpIf::ctrlObjVscpTcpIf() -{ - m_strUsername = _("admin"); - m_strPassword = _("secret"); - m_strHost = _("localhost"); - m_port = VSCP_LEVEL2_TCP_PORT; - m_rxState = RX_TREAD_STATE_NONE; - m_bQuit = false; // Dont even think of quiting yet... - m_error = 0; // No error - m_rxChannelID = 0; // No receive channel - m_txChannelID = 0; // No transmit channel - m_bFilterOwnTx = false; // Don't filter TX - m_bUseRXTXEvents = false; // No events - m_pWnd = NULL; // No message window - m_wndID = 0; // No meaage window id - m_maxRXqueue = MAX_TREAD_RECEIVE_EVENTS; -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Destructor -// - -ctrlObjVscpTcpIf::~ctrlObjVscpTcpIf() -{ - -} - - - -//////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - - - -DEFINE_EVENT_TYPE(wxVSCPTCPIF_RX_EVENT); -DEFINE_EVENT_TYPE(wxVSCPTCPIF_CONNECTION_LOST_EVENT); - - - -/////////////////////////////////////////////////////////////////////////////// -// VSCPTCPIP_RX_WorkerThread -// - -VSCPTCPIP_RX_WorkerThread::VSCPTCPIP_RX_WorkerThread() -{ - m_pCtrlObject = NULL; -} - -/////////////////////////////////////////////////////////////////////////////// -// VSCPTCPIP_RX_WorkerThread -// - -VSCPTCPIP_RX_WorkerThread::~VSCPTCPIP_RX_WorkerThread() -{ - ; -} - -/////////////////////////////////////////////////////////////////////////////// -// Entry -// -// Is there any messages to send from Level II clients. Send it/them to all -// devices/clients except for itself. -// - -void *VSCPTCPIP_RX_WorkerThread::Entry() -{ - // Must be a valid control object pointer - if ( NULL == m_pCtrlObject ) return NULL; - - - int rv; - VscpTcpIf tcpifReceive; // TODO - //wxCommandEvent eventReceive( wxVSCPTCPIF_RX_EVENT, m_pCtrlObject->m_wndID ); - //wxCommandEvent eventConnectionLost( wxVSCPTCPIF_CONNECTION_LOST_EVENT, m_pCtrlObject->m_wndID ); - - // Must be a valid control object pointer - if ( NULL == m_pCtrlObject ) return NULL; - - // Connect to the server with the control interface - if ( CANAL_ERROR_SUCCESS != - tcpifReceive.doCmdOpen( m_pCtrlObject->m_strHost, - m_pCtrlObject->m_port, - m_pCtrlObject->m_strUsername, - m_pCtrlObject->m_strPassword ) ) { - if ( m_pCtrlObject->m_bUseRXTXEvents ) { - // TODO if ( NULL != m_pCtrlObject->m_pWnd ) wxPostEvent( m_pCtrlObject->m_pWnd, eventConnectionLost ); - } - m_pCtrlObject->m_rxState = RX_TREAD_STATE_FAIL_DISCONNECTED; - return NULL; - } - - m_pCtrlObject->m_rxState = RX_TREAD_STATE_CONNECTED; - - // Find the channel id - tcpifReceive.doCmdGetChannelID( &m_pCtrlObject->m_rxChannelID ); - - // Start Receive Loop - tcpifReceive.doCmdEnterReceiveLoop(); - - - while ( !TestDestroy() && !m_pCtrlObject->m_bQuit ) - { - vscpEvent *pEvent = new vscpEvent; - if ( NULL == pEvent ) break; - - if ( CANAL_ERROR_SUCCESS == - ( rv = tcpifReceive.doCmdBlockReceive( pEvent ) ) ) { - if ( m_pCtrlObject->m_bFilterOwnTx && ( m_pCtrlObject->m_txChannelID == pEvent->obid ) ) { - deleteVSCPevent( pEvent ); - continue; - } - if ( m_pCtrlObject->m_bUseRXTXEvents ) { - //eventReceive.SetClientData( pEvent ); - //if ( NULL != m_pCtrlObject->m_pWnd ) wxPostEvent( m_pCtrlObject->m_pWnd, eventReceive ); - } - else { - if ( m_pCtrlObject->m_rxQueue.GetCount() <= m_pCtrlObject->m_maxRXqueue ) { - // Add the event to the in queue - m_pCtrlObject->m_mutexRxQueue.Lock(); - m_pCtrlObject->m_rxQueue.Append( pEvent ); - m_pCtrlObject->m_semRxQueue.Post(); - m_pCtrlObject->m_mutexRxQueue.Unlock(); - } - else { - delete pEvent; - } - } - } - else { - delete pEvent; - if ( CANAL_ERROR_COMMUNICATION == rv ) { - m_pCtrlObject->m_rxState = RX_TREAD_STATE_FAIL_DISCONNECTED; - m_pCtrlObject->m_bQuit = true; - } - } - } // while - - // Close the interface - tcpifReceive.doCmdClose(); - - if ( m_pCtrlObject->m_bUseRXTXEvents ) { - // TODO if ( NULL != m_pCtrlObject->m_pWnd ) wxPostEvent( m_pCtrlObject->m_pWnd, eventConnectionLost ); - } - - if ( m_pCtrlObject->m_rxState != RX_TREAD_STATE_FAIL_DISCONNECTED ) { - m_pCtrlObject->m_rxState = RX_TREAD_STATE_DISCONNECTED; - } - - return NULL; - -} - -/////////////////////////////////////////////////////////////////////////////// -// OnExit -// - -void VSCPTCPIP_RX_WorkerThread::OnExit() -{ - -} - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -// VSCPTCPIP_TX_WorkerThread -// - -VSCPTCPIP_TX_WorkerThread::VSCPTCPIP_TX_WorkerThread() -{ - m_pCtrlObject = NULL; -} - -/////////////////////////////////////////////////////////////////////////////// -// VSCPTCPIP_TX_WorkerThread -// - -VSCPTCPIP_TX_WorkerThread::~VSCPTCPIP_TX_WorkerThread() -{ - ; -} - -/////////////////////////////////////////////////////////////////////////////// -// Entry -// -// Is there any messages to send from Level II clients. Send it/them to all -// devices/clients except for itself. -// - -void *VSCPTCPIP_TX_WorkerThread::Entry() -{ - // Must be a valid control object pointer - if ( NULL == m_pCtrlObject ) return NULL; - - VscpTcpIf tcpifTransmit; - //wxCommandEvent eventConnectionLost( wxVSCPTCPIF_CONNECTION_LOST_EVENT, m_pCtrlObject->m_wndID ); - - // Must be a valid control object pointer - if ( NULL == m_pCtrlObject ) return NULL; - - // Connect to the server with the control interface - if ( CANAL_ERROR_SUCCESS != - tcpifTransmit.doCmdOpen( m_pCtrlObject->m_strHost, - m_pCtrlObject->m_port, - m_pCtrlObject->m_strUsername, - m_pCtrlObject->m_strPassword ) ) { - if ( m_pCtrlObject->m_bUseRXTXEvents ) { - // TODO if ( NULL != m_pCtrlObject->m_pWnd ) wxPostEvent( m_pCtrlObject->m_pWnd, eventConnectionLost ); - } - m_pCtrlObject->m_rxState = RX_TREAD_STATE_FAIL_DISCONNECTED; - return NULL; - } - - m_pCtrlObject->m_rxState = RX_TREAD_STATE_CONNECTED; - - // Find the channel id - tcpifTransmit.doCmdGetChannelID( &m_pCtrlObject->m_txChannelID ); - - EVENT_TX_QUEUE::compatibility_iterator node; - vscpEvent *pEvent; - while ( !TestDestroy() && !m_pCtrlObject->m_bQuit ) { - - if ( wxSEMA_TIMEOUT == m_pCtrlObject->m_semTxQueue.WaitTimeout( 500 ) ) continue; - m_pCtrlObject->m_mutexTxQueue.Lock(); - node = m_pCtrlObject->m_txQueue.GetFirst(); - pEvent = node->GetData(); - tcpifTransmit.doCmdSend( pEvent ); - m_pCtrlObject->m_mutexTxQueue.Unlock(); - - } // while - - // Close the interface - tcpifTransmit.doCmdClose(); - - if ( m_pCtrlObject->m_bUseRXTXEvents ) { - // TODO if ( NULL != m_pCtrlObject->m_pWnd ) wxPostEvent( m_pCtrlObject->m_pWnd, eventConnectionLost ); - } - - if ( m_pCtrlObject->m_rxState != RX_TREAD_STATE_FAIL_DISCONNECTED ) { - m_pCtrlObject->m_rxState = RX_TREAD_STATE_DISCONNECTED; - } - - return NULL; - -} - -/////////////////////////////////////////////////////////////////////////////// -// OnExit -// - -void VSCPTCPIP_TX_WorkerThread::OnExit() -{ - -} - +/////////////////////////////////////////////////////////////////////////////// +// vscptcpif.cpp: +// +// This file is part is part of CANAL (CAN Abstraction Layer) +// http://can.sourceforge.net) +// +// Copyright (C) 2000-2008 Ake Hedman, eurosource, <ak...@eu...> +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $RCSfile: canaltcpif.cpp,v $ +// $Date: 2005/08/24 21:56:55 $ +// $Author: akhe $ +// $Revision: 1.4 $ +/////////////////////////////////////////////////////////////////////////////// + + + +#ifdef __GNUG__ + //#pragma implementation +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +#ifdef __WXMSW__ + #include "wx/ownerdrw.h" +#endif + +#ifdef WIN32 +#include "winsock.h" +#endif + +#include <wx/thread.h> +#include <wx/datetime.h> +#include <wx/socket.h> +#include <wx/tokenzr.h> +#include <wx/listimpl.cpp> +#include <wx/event.h> + +#include "canal_macro.h" +#include "canal_win32_ipc.h" +#include "../common/canal.h" +#include "vscptcpif.h" + +WX_DEFINE_LIST( EVENT_RX_QUEUE ); +WX_DEFINE_LIST( EVENT_TX_QUEUE ); + + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +VscpTcpIf::VscpTcpIf() +{ + m_psock = NULL; + m_bModeReceiveLoop = false; + m_responseTimeOut = DEFAULT_RESPONSE_TIMEOUT; +} + + +VscpTcpIf::~VscpTcpIf() +{ + if ( NULL != m_psock ) delete m_psock; +} + +/////////////////////////////////////////////////////////////////////////////// +// checkReturnValue +// + +bool VscpTcpIf::checkReturnValue( void ) +{ + bool rv = false; + bool bDone = false; + wxString wxstr; + char buf[ 512 ]; + wxDateTime start,now; + + start.SetToCurrent(); + + m_strReply.Empty(); + + do { + + wxTimeSpan tt = wxDateTime::Now() - start; + + // Check for timeout + if ( tt.GetSeconds() > m_responseTimeOut ) { + wxLogDebug( _("CHECKRETURNVALUE: TCP/IP Timeout") ); + return false; + } + + memset( buf, 0, sizeof( buf ) - 1 ); + + m_psock->Read( buf, sizeof( buf ) - 1 ); + if ( m_psock->Error() ) { + unsigned long errorcode = m_psock->LastError(); + wxLogDebug( _("CHECKRETURNVALUE: TCP/IP Communication error = %d"), errorcode ); + if ( errorcode != wxSOCKET_TIMEDOUT ) { + return false; // r... [truncated message content] |
From: <ak...@us...> - 2008-04-16 09:36:14
|
Revision: 882 http://can.svn.sourceforge.net/can/?rev=882&view=rev Author: akhe Date: 2008-04-16 02:35:56 -0700 (Wed, 16 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/TODO Modified: trunk/TODO =================================================================== --- trunk/TODO 2008-04-15 16:22:52 UTC (rev 881) +++ trunk/TODO 2008-04-16 09:35:56 UTC (rev 882) @@ -8,6 +8,7 @@ VSCP Works ========== +- Better status information when connecting. - No date gives garage in data field (scroll) or date??? - Edit receive events - Add note to receive events @@ -15,6 +16,7 @@ - Center RX Fields. - Check direct CANAL interface. - Hide transmit windows in receive mode. +- Connection is not lost when server restarts. Daemon ====== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-15 16:23:14
|
Revision: 881 http://can.svn.sourceforge.net/can/?rev=881&view=rev Author: akhe Date: 2008-04-15 09:22:52 -0700 (Tue, 15 Apr 2008) Log Message: ----------- canal.h updated with message status codes. Modified Paths: -------------- trunk/firmware/common/vscp_serial.c trunk/firmware/common/vscp_serial.h trunk/src/vscp/common/canal.h trunk/src/vscp/common/tcpipclientthread.cpp trunk/src/vscp/samples/testinterface/testInterface.ncb trunk/src/vscp/samples/testinterface/testInterface.opt trunk/src/vscp/vscpworks/vscpworks.dsp Modified: trunk/firmware/common/vscp_serial.c =================================================================== --- trunk/firmware/common/vscp_serial.c 2008-04-15 12:26:35 UTC (rev 880) +++ trunk/firmware/common/vscp_serial.c 2008-04-15 16:22:52 UTC (rev 881) @@ -175,14 +175,14 @@ // Ack the frame if ( ( VSCP_SERIAL_OPCODE_ACK != vs_msgbuffer[ 0 ] ) && ( VSCP_SERIAL_OPCODE_SENT_ACK != vs_msgbuffer[ 0 ] ) ) { - //vs_sendAck( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); + //vs_sendAck( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); } } else { // Nack the frame if ( ( VSCP_SERIAL_OPCODE_NACK != vs_msgbuffer[ 0 ] ) && ( VSCP_SERIAL_OPCODE_SENT_NACK != vs_msgbuffer[ 0 ] ) ) { - //vs_sendNack( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); + //vs_sendNack( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); } } @@ -401,6 +401,7 @@ BOOL vs_sendCommandFrame( uint8_t channel, uint8_t seqnumber, + uint16_t command, uint8_t count, uint8_t *pData ) { @@ -426,6 +427,10 @@ // Channel vs_bufferSerialByteSubst( &checksum, channel ); + + // Command + vs_bufferSerialByteSubst( &checksum, ( command & 0xff ) ); + vs_bufferSerialByteSubst( &checksum, ( ( command >> 8 ) & 0xff ) ); // Counter vs_bufferSerialByteSubst( &checksum, seqnumber ); Modified: trunk/firmware/common/vscp_serial.h =================================================================== --- trunk/firmware/common/vscp_serial.h 2008-04-15 12:26:35 UTC (rev 880) +++ trunk/firmware/common/vscp_serial.h 2008-04-15 16:22:52 UTC (rev 881) @@ -81,6 +81,7 @@ #define VSCP_SERIAL_OPCODE_LEVEL2_EVENT 2 #define VSCP_SERIAL_OPCODE_POLL_EVENT 3 #define VSCP_SERIAL_OPCODE_NO_EVENT 4 +#define VSCP_SERIAL_OPCODE_CAN_FRAME 5 #define VSCP_SERIAL_OPCODE_RESERVED_DLE 10 #define VSCP_SERIAL_OPCODE_SENT_ACK 249 #define VSCP_SERIAL_OPCODE_SENT_NACK 250 @@ -93,7 +94,7 @@ // CAN flag bits (uses data byte 0-3 for id and // bit 32 is Extended id, bit 31 RTR #define VSCP_SERIAL_CAN_DATA0_EXTENDED 0x80 -#define VSCP_SERIAL_CAN_DATA0_RTR 0x40 +#define VSCP_SERIAL_CAN_DATA0_RTR 0x40 // The serial frame typedef struct { @@ -103,7 +104,7 @@ uint8_t seqnumber; uint8_t vscpclass; uint8_t vscptype; - uint8_t data[16]; + uint8_t data[ 16 ]; } vs_frame; #ifdef VSCP_SERIAL_ENABLE_SLIDING_WINDOWS @@ -246,12 +247,14 @@ First byte of data is command code @param channel Channel number NACK is sent for. @param seqnumber Id for packet which is NACK'ed + @param command Command code. @param count Number of databytes (0-16) @param pData Pointer to data. @return TRUE och success. FALSE on failure. */ BOOL vs_sendCommandFrame( uint8_t channel, uint8_t seqnumber, + uint16_t command, uint8_t count, uint8_t *pData ); Modified: trunk/src/vscp/common/canal.h =================================================================== --- trunk/src/vscp/common/canal.h 2008-04-15 12:26:35 UTC (rev 880) +++ trunk/src/vscp/common/canal.h 2008-04-15 16:22:52 UTC (rev 881) @@ -401,7 +401,7 @@ #define CANAL_IDFLAG_STANDARD 0x00000000 // Standard message id (11-bit) #define CANAL_IDFLAG_EXTENDED 0x00000001 // Extended message id (29-bit) #define CANAL_IDFLAG_RTR 0x00000002 // RTR-Frame -#define CANAL_IDFLAG_ERROR 0x00000004 // This package is an error indication (id holds error code) +#define CANAL_IDFLAG_STATUS 0x00000004 // This package is a status indication (id holds error code) #define CANAL_IDFLAG_SEND 0x80000000 // Reserved for use by application software to indicate send /// Communicaton speeds @@ -416,7 +416,21 @@ #define CANAL_BAUD_20 8 // 20 Kbit #define CANAL_BAUD_10 9 // 10 Kbit -/// Status codes +/// Status message codes ( in received message) +#define CANAL_STATUSMSG_OK 0x00 // Normal condition. +#define CANAL_STATUSMSG_OVERRUN 0x01 // Overrun occured when sending data to CAN bus. +#define CANAL_STATUSMSG_BUSLIGHT 0x02 // Error counter has reached 96. +#define CANAL_STATUSMSG_BUSHEAVY 0x03 // Error counter has reached 128. +#define CANAL_STATUSMSG_BUSOFF 0x04 // Device is in BUSOFF. CANAL_STATUS_OK is + // sent when returning to operational mode. +#define CANAL_STATUSMSG_STUFF 0x20 // Stuff Error. +#define CANAL_STATUSMSG_FORM 0x21 // Form Error. +#define CANAL_STATUSMSG_ACK 0x23 // Ack Error. +#define CANAL_STATUSMSG_BIT1 0x24 // Bit1 Error. +#define CANAL_STATUSMSG_BIT0 0x25 // Bit0 Error. +#define CANAL_STATUSMSG_CRC 0x27 // CRC Error. + +/// Status codes /returned by status request) #define CANAL_STATUS_NONE 0x00000000 #define CANAL_STATUS_ACTIVE 0x10000000 #define CANAL_STATUS_PASSIVE 0x40000000 Modified: trunk/src/vscp/common/tcpipclientthread.cpp =================================================================== --- trunk/src/vscp/common/tcpipclientthread.cpp 2008-04-15 12:26:35 UTC (rev 880) +++ trunk/src/vscp/common/tcpipclientthread.cpp 2008-04-15 16:22:52 UTC (rev 881) @@ -90,7 +90,7 @@ // Create the socket server = new wxSocketServer ( addr, wxSOCKET_BLOCK | wxSOCKET_REUSEADDR ); - m_pCtrlObject->logMsg ( _T ( "TCP ClientThread: Start." ), DAEMON_LOGMSG_INFO ); + m_pCtrlObject->logMsg ( _T ( "TCP ClientListenThread: Start." ), DAEMON_LOGMSG_INFO ); if ( server->Ok() ) { Modified: trunk/src/vscp/samples/testinterface/testInterface.ncb =================================================================== (Binary files differ) Modified: trunk/src/vscp/samples/testinterface/testInterface.opt =================================================================== (Binary files differ) Modified: trunk/src/vscp/vscpworks/vscpworks.dsp =================================================================== --- trunk/src/vscp/vscpworks/vscpworks.dsp 2008-04-15 12:26:35 UTC (rev 880) +++ trunk/src/vscp/vscpworks/vscpworks.dsp 2008-04-15 16:22:52 UTC (rev 881) @@ -31,7 +31,7 @@ MTL=midl.exe RSC=rc.exe -!IF "$(CFG)" == "vscpworks - Win32 Debug" +!IF "$(CFG)" == "vscpworks - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -43,20 +43,20 @@ # PROP Output_Dir "VCProjectDebug" # PROP Intermediate_Dir "VCProjectDebug" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /Fd"VCProjectDebug\vscpworks.pdb" /MDd /Od /GR /EHsc /W4 /Zi /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /D_UNICODE /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswud" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /c -# ADD CPP /nologo /FD /Fd"VCProjectDebug\vscpworks.pdb" /MDd /Od /GR /EHsc /W4 /Zi /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /D_UNICODE /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswud" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /c -# ADD BASE MTL /nologo /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /D_UNICODE /mktyplib203 /win32 -# ADD MTL /nologo /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /D_UNICODE /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /D_UNICODE /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswud" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" -# ADD RSC /l 0x405 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /D_UNICODE /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswud" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" +# ADD BASE CPP /nologo /MDd /W4 /GR /Zi /Od /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswud" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "__WXDEBUG__" /D "_DEBUG" /D "_UNICODE" /Fd"VCProjectDebug\vscpworks.pdb" /FD /EHsc /c +# ADD CPP /nologo /MDd /W4 /GR /Zi /Od /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswud" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "__WXDEBUG__" /D "_DEBUG" /D "_UNICODE" /Fd"VCProjectDebug\vscpworks.pdb" /FD /EHsc /c +# ADD BASE MTL /nologo /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "__WXDEBUG__" /D "_DEBUG" /D "_UNICODE" /mktyplib203 /win32 +# ADD MTL /nologo /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "__WXDEBUG__" /D "_DEBUG" /D "_UNICODE" /mktyplib203 /win32 +# ADD BASE RSC /l 0x405 /i "D:\wxWidgets-2.8.7/include" /i "D:\wxWidgets-2.8.7/contrib/include" /i "D:\wxWidgets-2.8.7/lib/vc_lib/mswud" /i "C:\Program Files\Microsoft Visual Studio\vc98\include" /d "NOPCH" /d "WIN32" /d "__WXMSW__" /d "_WINDOWS" /d "__WXDEBUG__" /d "_DEBUG" /d "_UNICODE" +# ADD RSC /l 0x405 /i "D:\wxWidgets-2.8.7/include" /i "D:\wxWidgets-2.8.7/contrib/include" /i "D:\wxWidgets-2.8.7/lib/vc_lib/mswud" /i "C:\Program Files\Microsoft Visual Studio\vc98\include" /d "NOPCH" /d "WIN32" /d "__WXMSW__" /d "_WINDOWS" /d "__WXDEBUG__" /d "_DEBUG" /d "_UNICODE" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw28ud_richtext.lib wxmsw28ud_aui.lib wxmsw28ud_core.lib wxbase28ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxmsw28ud_adv.lib wxmsw28ud_html.lib wxmsw28ud_xrc.lib wxbase28ud_net.lib wxbase28ud_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 /DEBUG /out:"VCProjectDebug\vscpworks.exe" -# ADD LINK32 wxmsw28ud_richtext.lib wxmsw28ud_aui.lib wxmsw28ud_core.lib wxbase28ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxmsw28ud_adv.lib wxmsw28ud_html.lib wxmsw28ud_xrc.lib wxbase28ud_net.lib wxbase28ud_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 /DEBUG /out:"VCProjectDebug\vscpworks.exe" +# ADD BASE LINK32 wxmsw28ud_richtext.lib wxmsw28ud_aui.lib wxmsw28ud_core.lib wxbase28ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxmsw28ud_adv.lib wxmsw28ud_html.lib wxmsw28ud_xrc.lib wxbase28ud_net.lib wxbase28ud_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" +# ADD LINK32 wxmsw28ud_richtext.lib wxmsw28ud_aui.lib wxmsw28ud_core.lib wxbase28ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxmsw28ud_adv.lib wxmsw28ud_html.lib wxmsw28ud_xrc.lib wxbase28ud_net.lib wxbase28ud_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" -!ELSEIF "$(CFG)" == "vscpworks - Win32 Release" +!ELSEIF "$(CFG)" == "vscpworks - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -67,21 +67,22 @@ # PROP Use_Debug_Libraries 0 # PROP Output_Dir "VCProjectRelease" # PROP Intermediate_Dir "VCProjectRelease" +# PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /Fd"VCProjectRelease\vscpworks.pdb" /MD /O2 /GR /EHsc /W4 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/msw" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /c -# ADD CPP /nologo /FD /Fd"VCProjectRelease\vscpworks.pdb" /MD /O2 /GR /EHsc /W4 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/msw" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /c -# ADD BASE MTL /nologo /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /mktyplib203 /win32 -# ADD MTL /nologo /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/msw" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" -# ADD RSC /l 0x405 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/msw" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" +# ADD BASE CPP /nologo /MD /W4 /GR /O2 /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/msw" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /Fd"VCProjectRelease\vscpworks.pdb" /FD /EHsc /c +# ADD CPP /nologo /MD /W4 /GR /O2 /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/msw" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /Fd"VCProjectRelease\vscpworks.pdb" /FD /EHsc /c +# ADD BASE MTL /nologo /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /mktyplib203 /win32 +# ADD MTL /nologo /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /mktyplib203 /win32 +# ADD BASE RSC /l 0x405 /i "D:\wxWidgets-2.8.7/include" /i "D:\wxWidgets-2.8.7/contrib/include" /i "D:\wxWidgets-2.8.7/lib/vc_lib/msw" /i "C:\Program Files\Microsoft Visual Studio\vc98\include" /d "NOPCH" /d "WIN32" /d "__WXMSW__" /d "_WINDOWS" +# ADD RSC /l 0x405 /i "D:\wxWidgets-2.8.7/include" /i "D:\wxWidgets-2.8.7/contrib/include" /i "D:\wxWidgets-2.8.7/lib/vc_lib/msw" /i "C:\Program Files\Microsoft Visual Studio\vc98\include" /d "NOPCH" /d "WIN32" /d "__WXMSW__" /d "_WINDOWS" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw28_richtext.lib wxmsw28_aui.lib wxmsw28_core.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxmsw28_adv.lib wxmsw28_html.lib wxmsw28_xrc.lib wxbase28_net.lib wxbase28_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 /out:"VCProjectRelease\vscpworks.exe" -# ADD LINK32 wxmsw28_richtext.lib wxmsw28_aui.lib wxmsw28_core.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxmsw28_adv.lib wxmsw28_html.lib wxmsw28_xrc.lib wxbase28_net.lib wxbase28_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 /out:"VCProjectRelease\vscpworks.exe" +# ADD BASE LINK32 wxmsw28_richtext.lib wxmsw28_aui.lib wxmsw28_core.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxmsw28_adv.lib wxmsw28_html.lib wxmsw28_xrc.lib wxbase28_net.lib wxbase28_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /subsystem:windows /machine:I386 /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" +# ADD LINK32 wxmsw28_richtext.lib wxmsw28_aui.lib wxmsw28_core.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxmsw28_adv.lib wxmsw28_html.lib wxmsw28_xrc.lib wxbase28_net.lib wxbase28_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /subsystem:windows /machine:I386 /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" -!ELSEIF "$(CFG)" == "vscpworks - Win32 Unicode Release" +!ELSEIF "$(CFG)" == "vscpworks - Win32 Unicode Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -93,20 +94,20 @@ # PROP Output_Dir "VCProjectUnicodeRelease" # PROP Intermediate_Dir "VCProjectUnicodeRelease" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /Fd"VCProjectUnicodeRelease\vscpworks.pdb" /MD /O2 /GR /EHsc /W4 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D_UNICODE /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswu" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /c -# ADD CPP /nologo /FD /Fd"VCProjectUnicodeRelease\vscpworks.pdb" /MD /O2 /GR /EHsc /W4 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D_UNICODE /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswu" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /c -# ADD BASE MTL /nologo /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D_UNICODE /mktyplib203 /win32 -# ADD MTL /nologo /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D_UNICODE /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D_UNICODE /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswu" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" -# ADD RSC /l 0x405 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D_UNICODE /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswu" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" +# ADD BASE CPP /nologo /MD /W4 /GR /O2 /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswu" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "_UNICODE" /Fd"VCProjectUnicodeRelease\vscpworks.pdb" /FD /EHsc /c +# ADD CPP /nologo /MD /W4 /GR /O2 /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswu" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "_UNICODE" /Fd"VCProjectUnicodeRelease\vscpworks.pdb" /FD /EHsc /c +# ADD BASE MTL /nologo /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "_UNICODE" /mktyplib203 /win32 +# ADD MTL /nologo /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "_UNICODE" /mktyplib203 /win32 +# ADD BASE RSC /l 0x405 /i "D:\wxWidgets-2.8.7/include" /i "D:\wxWidgets-2.8.7/contrib/include" /i "D:\wxWidgets-2.8.7/lib/vc_lib/mswu" /i "C:\Program Files\Microsoft Visual Studio\vc98\include" /d "NOPCH" /d "WIN32" /d "__WXMSW__" /d "_WINDOWS" /d "_UNICODE" +# ADD RSC /l 0x405 /i "D:\wxWidgets-2.8.7/include" /i "D:\wxWidgets-2.8.7/contrib/include" /i "D:\wxWidgets-2.8.7/lib/vc_lib/mswu" /i "C:\Program Files\Microsoft Visual Studio\vc98\include" /d "NOPCH" /d "WIN32" /d "__WXMSW__" /d "_WINDOWS" /d "_UNICODE" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw28u_richtext.lib wxmsw28u_aui.lib wxmsw28u_core.lib wxbase28u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxmsw28u_adv.lib wxmsw28u_html.lib wxmsw28u_xrc.lib wxbase28u_net.lib wxbase28u_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 /out:"VCProjectUnicodeRelease\vscpworks.exe" -# ADD LINK32 wxmsw28u_richtext.lib wxmsw28u_aui.lib wxmsw28u_core.lib wxbase28u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxmsw28u_adv.lib wxmsw28u_html.lib wxmsw28u_xrc.lib wxbase28u_net.lib wxbase28u_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 /out:"VCProjectUnicodeRelease\vscpworks.exe" +# ADD BASE LINK32 wxmsw28u_richtext.lib wxmsw28u_aui.lib wxmsw28u_core.lib wxbase28u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxmsw28u_adv.lib wxmsw28u_html.lib wxmsw28u_xrc.lib wxbase28u_net.lib wxbase28u_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /subsystem:windows /machine:I386 /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" +# ADD LINK32 wxmsw28u_richtext.lib wxmsw28u_aui.lib wxmsw28u_core.lib wxbase28u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxmsw28u_adv.lib wxmsw28u_html.lib wxmsw28u_xrc.lib wxbase28u_net.lib wxbase28u_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /subsystem:windows /machine:I386 /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" -!ELSEIF "$(CFG)" == "vscpworks - Win32 unicode Debug" +!ELSEIF "$(CFG)" == "vscpworks - Win32 unicode Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -118,20 +119,20 @@ # PROP Output_Dir "VCProjectunicodeDebug" # PROP Intermediate_Dir "VCProjectunicodeDebug" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /Fd"VCProjectunicodeDebug\vscpworks.pdb" /MDd /Od /GR /EHsc /W4 /Zi /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswd" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /c -# ADD CPP /nologo /FD /Fd"VCProjectunicodeDebug\vscpworks.pdb" /MDd /Od /GR /EHsc /W4 /Zi /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswd" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /c -# ADD BASE MTL /nologo /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /mktyplib203 /win32 -# ADD MTL /nologo /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswd" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" -# ADD RSC /l 0x405 /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswd" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" +# ADD BASE CPP /nologo /MDd /W4 /GR /Zi /Od /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswd" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "__WXDEBUG__" /D "_DEBUG" /Fd"VCProjectunicodeDebug\vscpworks.pdb" /FD /EHsc /c +# ADD CPP /nologo /MDd /W4 /GR /Zi /Od /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswd" /I "C:\Program Files\Microsoft Visual Studio\vc98\include" /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "__WXDEBUG__" /D "_DEBUG" /Fd"VCProjectunicodeDebug\vscpworks.pdb" /FD /EHsc /c +# ADD BASE MTL /nologo /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "__WXDEBUG__" /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "__WXDEBUG__" /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x405 /i "D:\wxWidgets-2.8.7/include" /i "D:\wxWidgets-2.8.7/contrib/include" /i "D:\wxWidgets-2.8.7/lib/vc_lib/mswd" /i "C:\Program Files\Microsoft Visual Studio\vc98\include" /d "NOPCH" /d "WIN32" /d "__WXMSW__" /d "_WINDOWS" /d "__WXDEBUG__" /d "_DEBUG" +# ADD RSC /l 0x405 /i "D:\wxWidgets-2.8.7/include" /i "D:\wxWidgets-2.8.7/contrib/include" /i "D:\wxWidgets-2.8.7/lib/vc_lib/mswd" /i "C:\Program Files\Microsoft Visual Studio\vc98\include" /d "NOPCH" /d "WIN32" /d "__WXMSW__" /d "_WINDOWS" /d "__WXDEBUG__" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw28d_richtext.lib wxmsw28d_aui.lib wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxmsw28d_adv.lib wxmsw28d_html.lib wxmsw28d_xrc.lib wxbase28d_net.lib wxbase28d_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 /DEBUG /out:"VCProjectunicodeDebug\vscpworks.exe" -# ADD LINK32 wxmsw28d_richtext.lib wxmsw28d_aui.lib wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxmsw28d_adv.lib wxmsw28d_html.lib wxmsw28d_xrc.lib wxbase28d_net.lib wxbase28d_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 /DEBUG /out:"VCProjectunicodeDebug\vscpworks.exe" +# ADD BASE LINK32 wxmsw28d_richtext.lib wxmsw28d_aui.lib wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxmsw28d_adv.lib wxmsw28d_html.lib wxmsw28d_xrc.lib wxbase28d_net.lib wxbase28d_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" +# ADD LINK32 wxmsw28d_richtext.lib wxmsw28d_aui.lib wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxmsw28d_adv.lib wxmsw28d_html.lib wxmsw28d_xrc.lib wxbase28d_net.lib wxbase28d_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"C:\Program Files\Microsoft Visual Studio\vc98\lib" -!ENDIF +!ENDIF # Begin Target @@ -144,47 +145,43 @@ # PROP Default_Filter "" # Begin Source File -SOURCE="dlgvscpmsg.cpp" +SOURCE="..\common\canalsuperwrapper.cpp" # End Source File # Begin Source File -SOURCE="dlgselectdaemoninterface.cpp" +SOURCE="..\..\common\crc.c" # End Source File # Begin Source File -SOURCE="frmmain.cpp" +SOURCE="dlgconfiguration.cpp" # End Source File # Begin Source File -SOURCE="vscpworks.cpp" +SOURCE="dlgnewvscpsession.cpp" # End Source File # Begin Source File -SOURCE="frmvscpsession.cpp" +SOURCE="dlgselectdaemoninterface.cpp" # End Source File # Begin Source File -SOURCE="dlgnewvscpsession.cpp" +SOURCE="dlgvscpfilter.cpp" # End Source File # Begin Source File -SOURCE="dlgconfiguration.cpp" -# End Source File -# Begin Source File - SOURCE="dlgvscpinterfacesettings.cpp" # End Source File # Begin Source File -SOURCE="dlgvscpfilter.cpp" +SOURCE="dlgvscpmsg.cpp" # End Source File # Begin Source File -SOURCE="vscpbootloader.cpp" +SOURCE="dlgvscptrmit.cpp" # End Source File # Begin Source File -SOURCE="dlgvscptrmit.cpp" +SOURCE="..\common\dllwrapper.cpp" # End Source File # Begin Source File @@ -192,47 +189,47 @@ # End Source File # Begin Source File -SOURCE="readregiister.cpp" +SOURCE="frmmain.cpp" # End Source File # Begin Source File -SOURCE="writeregister.cpp" +SOURCE="frmvscpsession.cpp" # End Source File # Begin Source File -SOURCE="readmsfurl.cpp" +SOURCE="gridtable.cpp" # End Source File # Begin Source File -SOURCE="readmdffile.cpp" +SOURCE="..\common\guid.cpp" # End Source File # Begin Source File -SOURCE="readguid.cpp" +SOURCE="..\common\mdf.cpp" # End Source File # Begin Source File -SOURCE="..\common\canalsuperwrapper.cpp" +SOURCE="readguid.cpp" # End Source File # Begin Source File -SOURCE="..\..\common\crc.c" +SOURCE="readmdffile.cpp" # End Source File # Begin Source File -SOURCE="..\common\dllwrapper.cpp" +SOURCE="readmsfurl.cpp" # End Source File # Begin Source File -SOURCE="..\common\guid.cpp" +SOURCE="readregiister.cpp" # End Source File # Begin Source File -SOURCE="..\common\mdf.cpp" +SOURCE="threadvscpwork.cpp" # End Source File # Begin Source File -SOURCE="threadvscpwork.cpp" +SOURCE="vscpbootloader.cpp" # End Source File # Begin Source File @@ -248,40 +245,43 @@ # End Source File # Begin Source File -SOURCE="gridtable.cpp" +SOURCE="vscpworks.cpp" # End Source File # Begin Source File SOURCE="vscpworks.rc" # End Source File +# Begin Source File +SOURCE="writeregister.cpp" +# End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "" # Begin Source File -SOURCE="dlgvscpmsg.h" +SOURCE="..\common\canal.h" # End Source File # Begin Source File -SOURCE="dlgselectdaemoninterface.h" +SOURCE="..\common\canaldlldef.h" # End Source File # Begin Source File -SOURCE="frmmain.h" +SOURCE="..\common\canalsuperwrapper.h" # End Source File # Begin Source File -SOURCE="vscpworks.h" +SOURCE="..\..\common\crc.h" # End Source File # Begin Source File -SOURCE="frmvscpsession.h" +SOURCE="..\common\devicelist.h" # End Source File # Begin Source File -SOURCE="dlgnewvscpsession.h" +SOURCE="..\common\devitem.h" # End Source File # Begin Source File @@ -289,94 +289,90 @@ # End Source File # Begin Source File -SOURCE="dlgvscpinterfacesettings.h" +SOURCE="dlgnewvscpsession.h" # End Source File # Begin Source File -SOURCE="dlgvscpfilter.h" +SOURCE="dlgselectdaemoninterface.h" # End Source File # Begin Source File -SOURCE="vscpbootloader.h" +SOURCE="dlgvscpfilter.h" # End Source File # Begin Source File -SOURCE="dlgvscptrmit.h" +SOURCE="dlgvscpinterfacesettings.h" # End Source File # Begin Source File -SOURCE="frmdeviceconfig.h" +SOURCE="dlgvscpmsg.h" # End Source File # Begin Source File -SOURCE="readregiister.h" +SOURCE="dlgvscptrmit.h" # End Source File # Begin Source File -SOURCE="writeregister.h" +SOURCE="..\common\dllwrapper.h" # End Source File # Begin Source File -SOURCE="readmsfurl.h" +SOURCE="frmdeviceconfig.h" # End Source File # Begin Source File -SOURCE="readmdffile.h" +SOURCE="frmmain.h" # End Source File # Begin Source File -SOURCE="readguid.h" +SOURCE="frmvscpsession.h" # End Source File # Begin Source File -SOURCE="..\common\canal.h" +SOURCE="gridtable.h" # End Source File # Begin Source File -SOURCE="..\common\canaldlldef.h" +SOURCE="..\common\guid.h" # End Source File # Begin Source File -SOURCE="..\common\canalsuperwrapper.h" +SOURCE="..\common\mdf.h" # End Source File # Begin Source File -SOURCE="..\..\common\crc.h" +SOURCE="platform.h" # End Source File # Begin Source File -SOURCE="..\common\devicelist.h" +SOURCE="readguid.h" # End Source File # Begin Source File -SOURCE="..\common\devitem.h" +SOURCE="readmdffile.h" # End Source File # Begin Source File -SOURCE="..\common\dllwrapper.h" +SOURCE="readmsfurl.h" # End Source File # Begin Source File -SOURCE="..\common\guid.h" +SOURCE="readregiister.h" # End Source File # Begin Source File -SOURCE="..\common\mdf.h" +SOURCE="threadvscpwork.h" # End Source File # Begin Source File -SOURCE="platform.h" +SOURCE="..\common\vscp.h" # End Source File # Begin Source File -SOURCE="threadvscpwork.h" +SOURCE="vscpbootloader.h" # End Source File # Begin Source File -SOURCE="..\common\vscp.h" -# End Source File -# Begin Source File - SOURCE="..\common\vscphelper.h" # End Source File # Begin Source File @@ -393,10 +389,12 @@ # End Source File # Begin Source File -SOURCE="gridtable.h" +SOURCE="vscpworks.h" # End Source File +# Begin Source File +SOURCE="writeregister.h" +# End Source File # End Group # End Target # End Project - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-15 12:26:37
|
Revision: 880 http://can.svn.sourceforge.net/can/?rev=880&view=rev Author: akhe Date: 2008-04-15 05:26:35 -0700 (Tue, 15 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/INSTALL Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2008-04-15 12:21:45 UTC (rev 879) +++ trunk/INSTALL 2008-04-15 12:26:35 UTC (rev 880) @@ -1,114 +1,7 @@ -To install VSCP and friends type + See BUILD_WIN32 and BUILD_UNIX -".configure" -followed by -"make" -and "make install" -You can use ./configure --help to get help about available switeches. Use --enable-debug to use the debug version of wxWidgets and use --enable-unicode to use the unicode version. The use of the unicode version is recommended. -To compile the package you need the wxWidgets libraries (GTK2). The toolkit can be found at http://www.wxwidgets.org. At the moment use the graphical version of the library (not base) even if you only will use the nongraphic components. - -If you want the VSCP Works application to compile the wxWidgets library has to be configured with the --enable-richtext otherwise it will not compile. - -Have Fun! -/Ake - - -Common Problems -=============== - -vscpworks does not compile -========================== -Check that you configured the wxWidgets package with --enable-richtext. If you issue "wx-config --libs" you should see the richtext library. - - -Problems with missing libcrypto -=============================== - -Compile complains that it can't find openssl/md5.h - -Solution: On Ubuntu at least install libssl-dev - -Complains ‘class wxXmlNode’ has no member named ‘GetNodeContent’ -================================================================ -You ned wxWidgets 2.8.0 or newer. - ---------------------------------------------------------------------- - -Compile errors when issuing Make. This can be due to many things. One cause is tht the wxBase version of the wxWidgets library is used instead of the full library (wxGTK2 library). You can check if this is the cause of the failure by looking in src/canal/cancmd/Makefile. The -Makefile should have a CXXFLAGS entry that looks something like below. if it have -I/usr/local/lib/wx/include/base... the base library of the wxWidgets toolkit is installed and you should install the full version instead. - -CXXFLAGS = -g -O2 -I/usr/local/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA - - -Use "wx-config" to check wxWidgets configurations - - -Fedora Core 4 -============= -libwx_gtk2_xrc-2.6.so.0 is missing when you try to start cw. This means that the path to it cant be found. Add the path to /etc/ld.conf.d (new entry with /usr/local/lib) and the problem will be resolved. - -Known configuration that compiles out of the box on Fedora Core 4 is 2.6, ansi, debug. Release build should also work. - -The wx libraries was built with the following swithes - -./configure --enable-debug --disable-unicode - -"wx-config" gives the following output - -wx-config --prefix -/usr/local - -wx-config --exec-prefix -/usr/local - -wx-config --release -2.6 - -wx-config --list - - Default config is gtk2-ansi-debug-2.6 - - Default config will be used for output - - Alternate matches: - base-ansi-debug-2.6 - base-ansi-release-2.6 - gtk2-ansi-release-2.6 - -wx-config --version -2.6.3 - -wx-config --basename -wx_gtk2d - -wx-config --cc -gcc - -wx-config --cppflags --I/usr/local/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA - -wx-config --cxxflags --I/usr/local/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA - -wx-config --libs --L/usr/local/lib -pthread -L/usr/X11R6/lib -lwx_gtk2d_xrc-2.6 -lwx_gtk2d_qa-2.6 -lwx_gtk2d_html-2.6 -lwx_gtk2d_adv-2.6 -lwx_gtk2d_core-2.6 -lwx_based_xml-2.6 -lwx_based_net-2.6 -lwx_based-2.6 - -wx-config --cxx -g++ - -wx-config --ld -g++ -shared -fPIC -o - -wx-config --linkdeps - - - - - - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-15 12:21:54
|
Revision: 879 http://can.svn.sourceforge.net/can/?rev=879&view=rev Author: akhe Date: 2008-04-15 05:21:45 -0700 (Tue, 15 Apr 2008) Log Message: ----------- Added some Unix build instructions. Modified Paths: -------------- trunk/BUILD_UNIX trunk/TODO trunk/src/vscp/common/old/udpreceivethread_unix.cpp~ trunk/src/vscp/vscpworks/vscpworks.pjd Modified: trunk/BUILD_UNIX =================================================================== --- trunk/BUILD_UNIX 2008-04-15 11:50:45 UTC (rev 878) +++ trunk/BUILD_UNIX 2008-04-15 12:21:45 UTC (rev 879) @@ -1,2 +1,159 @@ -Follow instructions in the file INSTALL in the root directory of the -distribution. +To build VSCP and friends type + +".configure --enable-unicode" + +followed by + +"make" + +and "make install" as root user. + +You can use ./configure --help to get help about available switches. Use --enable-debug to use the debug +version of wxWidgets and use --enable-unicode to use the unicode version. The use of the unicode version +is recommended. + + +To compile the package you need the wxWidgets libraries (GTK2). The toolkit can be found at +http://www.wxwidgets.org. At the moment use the graphical version of the library (not base) even if you +only will use the nongraphic components. + +If you want the VSCP Works application to compile the wxWidgets library has to be configured with the +--enable-richtext otherwise it will not compile. + +Configuration files should be located in /etc/vscp and there are samples of configuration files here in the root. +The names should be vscpd.conf for the daemon and vscpworks.conf for VSCP works. The daemon can be started with +a path to a configuration file in anoter location using the -c switch. + + +Have Fun! +/Ake <ak...@do...> + + + +Common Problems and notes +========================= + + + +vscpworks does not compile +========================== +Check that you configured the wxWidgets package with --enable-richtext. If you issue "wx-config --libs" you should see the richtext library. + + + + +Problems with missing libcrypto +=============================== + +Compile complains that it can't find openssl/md5.h + +Solution: On Ubuntu at least install libssl-dev. libcurl2-opemssl-dev also works on debian etch. + + + +Complains ‘class wxXmlNode’ has no member named ‘GetNodeContent’ +================================================================ +You need wxWidgets 2.8.0 or newer. + + + +--------------------------------------------------------------------- + +Compile errors when issuing Make. This can be due to many things. One cause is that the wxBase version of the +wxWidgets library is used instead of the full library (wxGTK2 library). You can check if this is the cause of +the failure by looking in src/canal/cancmd/Makefile. The +Makefile should have a CXXFLAGS entry that looks something like below. if it have +-I/usr/local/lib/wx/include/base... the base library of the wxWidgets toolkit is installed and you should +install the full version instead. + +CXXFLAGS = -g -O2 -I/usr/local/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA + + +Use "wx-config" to check wxWidgets configurations + + +Debian etch +=========== +make sure libopenssl-debv and libgtk2.0-dev is installed. Fet wxWidgets-1.8.7 or later from the wxWidgets site +and configure with + +./configure --enable-unicode + +Unsure if --enable-richtext really is needed. If you get compiants about it add the switch. + +Make the library with "make" and install it with "make install" if it compiled OK. + +tiff, gif, and librarues are needed for wxWidgets to compile install them. You can seach the package names with + +apt-cache search libxxx | grep libxx | less + +Remember to add the path to /usr/local/lib to /etc/ld.so.conf.d/i486-linux-gnu.conf and then issue "ldconfig" +after installing the libs. + +After this just build and install VSCP & Friends. + + +Fedora Core 4 +============= +libwx_gtk2_xrc-2.6.so.0 is missing when you try to start cw. This means that the path to it cant be found. Add the path to /etc/ld.conf.d (new entry with /usr/local/lib) and the problem will be resolved. + +Known configuration that compiles out of the box on Fedora Core 4 is 2.6, ansi, debug. Release build should also work. + +The wx libraries was built with the following swithes + +./configure --enable-debug --disable-unicode + +"wx-config" gives the following output + +wx-config --prefix +/usr/local + +wx-config --exec-prefix +/usr/local + +wx-config --release +2.6 + +wx-config --list + + Default config is gtk2-ansi-debug-2.6 + + Default config will be used for output + + Alternate matches: + base-ansi-debug-2.6 + base-ansi-release-2.6 + gtk2-ansi-release-2.6 + +wx-config --version +2.6.3 + +wx-config --basename +wx_gtk2d + +wx-config --cc +gcc + +wx-config --cppflags +-I/usr/local/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA + +wx-config --cxxflags +-I/usr/local/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA + +wx-config --libs +-L/usr/local/lib -pthread -L/usr/X11R6/lib -lwx_gtk2d_xrc-2.6 -lwx_gtk2d_qa-2.6 -lwx_gtk2d_html-2.6 -lwx_gtk2d_adv-2.6 -lwx_gtk2d_core-2.6 -lwx_based_xml-2.6 -lwx_based_net-2.6 -lwx_based-2.6 + +wx-config --cxx +g++ + +wx-config --ld +g++ -shared -fPIC -o + +wx-config --linkdeps + + + + + + + Modified: trunk/TODO =================================================================== --- trunk/TODO 2008-04-15 11:50:45 UTC (rev 878) +++ trunk/TODO 2008-04-15 12:21:45 UTC (rev 879) @@ -8,6 +8,7 @@ VSCP Works ========== +- No date gives garage in data field (scroll) or date??? - Edit receive events - Add note to receive events - Detect Connetion Lost. @@ -17,6 +18,8 @@ Daemon ====== +- Debug levels for the daeon in runtime version. +- syslog logging under Linux. - Fix filter - Variable defines - Scheduler. Modified: trunk/src/vscp/common/old/udpreceivethread_unix.cpp~ =================================================================== --- trunk/src/vscp/common/old/udpreceivethread_unix.cpp~ 2008-04-15 11:50:45 UTC (rev 878) +++ trunk/src/vscp/common/old/udpreceivethread_unix.cpp~ 2008-04-15 12:21:45 UTC (rev 879) @@ -4,25 +4,25 @@ // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version // 2 of the License, or (at your option) any later version. -// -// This file is part of the VSCP (http://can.sourceforge.net) // +// This file is part of the VSCP (http://can.sourceforge.net) +// // Copyright (C) 2000-2007 Ake Hedman, Eurosource,<ak...@eu...> -// +// // This file is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this file see the file COPYING. If not, write to // the Free Software Foundation, 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // -// $RCSfile: udpreceivethread_unix.cpp,v $ -// $Date: 2006/03/11 13:57:05 $ -// $Author: akhe $ -// $Revision: 1.13 $ +// $RCSfile: udpreceivethread_unix.cpp,v $ +// $Date: 2006/03/11 13:57:05 $ +// $Author: akhe $ +// $Revision: 1.13 $ #define _POSIX @@ -68,237 +68,256 @@ // // -void udpReceiveThread( void *pObject ) +void udpReceiveThread ( void *pObject ) { - unsigned long errorCode = 0; - socklen_t nLen; - - unsigned char buf[ 1024 ]; - unsigned char *p; + unsigned long errorCode = 0; + socklen_t nLen; - crcInit(); - CControlObject *pctrlObject = (CControlObject *)pObject; + unsigned char buf[ 1024 ]; + unsigned char *p; - char szName[ 128 ]; - struct hostent * lpLocalHostEntry; - - if ( -1 == gethostname( szName, sizeof( szName ) ) ) { - wxLogError( _("UDP Receive Thread: Failed to get hostname\n") ); - pthread_exit( &errorCode ); - } + crcInit(); + CControlObject *pctrlObject = ( CControlObject * ) pObject; - wxLogDebug( _("udpReceiceThread: Hostname: %s"), szName ); - - lpLocalHostEntry = gethostbyname( szName ); - if ( NULL == lpLocalHostEntry ) { - wxLogError( _("UDP Receive Thread: Failed to get hostaddress\n") ); - pthread_exit( &errorCode ); - } - - // Get the address - //localaddr = (in_addr_t *)lpLocalHostEntry->h_addr_list[ 0 ]; + char szName[ 128 ]; + struct hostent * lpLocalHostEntry; - // Get all local addresses of the local machine - int idx = -1; - void *pAddr; - in_addr_t localaddr[ 16 ]; // max 16 local addresses - do { - idx++; - localaddr[ idx ] = 0; - pAddr = (in_addr_t *)lpLocalHostEntry->h_addr_list[ idx ]; - if ( NULL != pAddr ) localaddr[ idx ] = *( ( in_addr_t *)pAddr); - if ( NULL != pAddr )wxLogDebug( _("udpReceiceThread: Local address: %X"), *(in_addr_t *)pAddr ); - } while ( ( NULL != pAddr ) && ( idx < 16 ) ); + if ( -1 == gethostname ( szName, sizeof ( szName ) ) ) + { + wxLogError ( _ ( "UDP Receive Thread: Failed to get hostname\n" ) ); + pthread_exit ( &errorCode ); + } - // - // Create a UDP/IP datagram socket - // - int theSocket; - - theSocket = socket( AF_INET, SOCK_DGRAM, 0 ); - if ( -1 == theSocket ) { - pthread_exit( &errorCode ); - } - - int on = 1; // As suggested by Charles Tewiah - setsockopt( theSocket, - SOL_SOCKET, - SO_REUSEADDR, - (const char *)&on, - sizeof ( on ) ); - - // - // Fill in the address structure - // - struct sockaddr_in saServer; + wxLogDebug ( _ ( "udpReceiceThread: Hostname: %s" ), szName ); - saServer.sin_family = AF_INET; - saServer.sin_addr.s_addr = INADDR_ANY; - saServer.sin_port = htons( pctrlObject->m_UDPPort ); + lpLocalHostEntry = gethostbyname ( szName ); + if ( NULL == lpLocalHostEntry ) + { + wxLogError ( _ ( "UDP Receive Thread: Failed to get hostaddress\n" ) ); + pthread_exit ( &errorCode ); + } - // - // bind the name to the socket - // + // Get the address + //localaddr = (in_addr_t *)lpLocalHostEntry->h_addr_list[ 0 ]; - int nRet; + // Get all local addresses of the local machine + int idx = -1; + void *pAddr; + in_addr_t localaddr[ 16 ]; // max 16 local addresses + do + { + idx++; + localaddr[ idx ] = 0; + pAddr = ( in_addr_t * ) lpLocalHostEntry->h_addr_list[ idx ]; + if ( NULL != pAddr ) localaddr[ idx ] = * ( ( in_addr_t * ) pAddr ); + if ( NULL != pAddr ) wxLogDebug ( _ ( "udpReceiceThread: Local address: %X" ), * ( in_addr_t * ) pAddr ); + } + while ( ( NULL != pAddr ) && ( idx < 16 ) ); - nRet = bind( theSocket, - ( struct sockaddr * )&saServer, - sizeof (struct sockaddr ) ); + // + // Create a UDP/IP datagram socket + // + int theSocket; - if ( -1 == nRet ) { - pthread_exit( &errorCode ); - } + theSocket = socket ( AF_INET, SOCK_DGRAM, 0 ); + if ( -1 == theSocket ) + { + pthread_exit ( &errorCode ); + } - struct sockaddr_in saClient; - nLen = sizeof( struct sockaddr_in ); + int on = 1; // As suggested by Charles Tewiah + setsockopt ( theSocket, + SOL_SOCKET, + SO_REUSEADDR, + ( const char * ) &on, + sizeof ( on ) ); - wxLogDebug( _("udpReceiceThread: Ready to Work!") ); - - // Receive loop - - while ( !pctrlObject->m_bQuit ) { + // + // Fill in the address structure + // + struct sockaddr_in saServer; - bzero( ( uint8_t *)&saClient, sizeof( saClient ) ); - nLen = sizeof( struct sockaddr_in ); - bzero( ( uint8_t *)buf, sizeof( buf ) ); - - // Wait for data from the client - - nRet = recvfrom( theSocket, - buf, - sizeof(buf ), - 0, - ( struct sockaddr * )&saClient, - &nLen ); + saServer.sin_family = AF_INET; + saServer.sin_addr.s_addr = INADDR_ANY; + saServer.sin_port = htons ( pctrlObject->m_UDPPort ); - if ( ( 0 == nRet ) || ( -1 == nRet ) || ( nRet < 25 ) ) { - continue; - } + // + // bind the name to the socket + // - wxLogDebug( _("UDPReceiveThread: Incoming event. Addr=%X"), - (in_addr_t)saClient.sin_addr.s_addr); + int nRet; + nRet = bind ( theSocket, + ( struct sockaddr * ) &saServer, + sizeof ( struct sockaddr ) ); - // Handle received package + if ( -1 == nRet ) + { + pthread_exit ( &errorCode ); + } - // If this is a packet sent from this machine - // we just disregards it - //if ( *localaddr == saClient.sin_addr.s_addr ) continue; - bool bLocalAddress = false; - idx = 0; - while ( ( 0 != localaddr[ idx ] ) && ( idx < 16 ) ) { - if ( localaddr[ idx ] == (in_addr_t)saClient.sin_addr.s_addr ) { - bLocalAddress = true; - } - idx++; - } - if ( bLocalAddress ) continue; + struct sockaddr_in saClient; + nLen = sizeof ( struct sockaddr_in ); - wxLogDebug( _("UDPReceiveThread: It's from another machine.") ); - - // Check size - // The size member must be low enough for the data to fit - // in the package - unsigned short size; - p = (unsigned char *)&size; - *(p+0) = buf[ VSCP_UDP_POS_SIZE + 1 ]; - *(p+1) = buf[ VSCP_UDP_POS_SIZE + 0 ]; - - if ( ( size + 25 ) > nRet ) { - // Wrong size -> Package faulty - continue; - } - - // Calculate CRC if requested - if ( !( buf[ VSCP_UDP_POS_HEAD + 0 ] & VSCP_NO_CRC_CALC ) ) { - if ( !crcFast( buf, size ) ) continue; // Faulty CRC - } + wxLogDebug ( _ ( "udpReceiceThread: Ready to Work!" ) ); - vscpEvent *pEvent = new vscpEvent; + // Receive loop - if ( NULL != pEvent ) { + while ( !pctrlObject->m_bQuit ) + { - // Head - p = (unsigned char *)&pEvent->head; - *(p+0) = buf[ VSCP_UDP_POS_HEAD + 0 ]; - - // VSCP class - p = (unsigned char *)&pEvent->vscp_class; - *(p+0) = buf[ VSCP_UDP_POS_CLASS + 1 ]; - *(p+1) = buf[ VSCP_UDP_POS_CLASS + 0 ]; + bzero ( ( uint8_t * ) &saClient, sizeof ( saClient ) ); + nLen = sizeof ( struct sockaddr_in ); + bzero ( ( uint8_t * ) buf, sizeof ( buf ) ); - // VSCP type - p = (unsigned char *)&pEvent->vscp_type; - *(p+0) = buf[ VSCP_UDP_POS_TYPE + 1 ]; - *(p+1) = buf[ VSCP_UDP_POS_TYPE + 0 ]; - - // Node address - p = (unsigned char *)&pEvent->GUID; - memcpy( p, &buf[ VSCP_UDP_POS_GUID + 0 ], 16 ); + // Wait for data from the client - // Number of valid data bytes - pEvent->sizeData = size; + nRet = recvfrom ( theSocket, + buf, + sizeof ( buf ), + 0, + ( struct sockaddr * ) &saClient, + &nLen ); - if ( pEvent->sizeData > 487 ) { - // Can't be a VSCP package - delete pEvent; - continue; - } - - // CRC - p = (unsigned char *)&pEvent->crc; - *(p+0) = buf[ VSCP_UDP_POS_CRC + 1 ]; - *(p+1) = buf[ VSCP_UDP_POS_CRC + 0 ]; + if ( ( 0 == nRet ) || ( -1 == nRet ) || ( nRet < 25 ) ) + { + continue; + } - pEvent->pdata = NULL; + wxLogDebug ( _ ( "UDPReceiveThread: Incoming event. Addr=%X" ), + ( in_addr_t ) saClient.sin_addr.s_addr ); - if ( 0 != pEvent->sizeData ) { - - // Allocate storage for data - unsigned char *pDataArea = new unsigned char[ pEvent->sizeData ]; - if ( NULL != pDataArea ) { - - // Data Max 487 (512- 25) bytes - pEvent->pdata = pDataArea; + // Handle received package - // size = sz - command_byte - control_bytes - memcpy( pEvent->pdata, &buf[ VSCP_UDP_POS_DATA ], pEvent->sizeData ); + // If this is a packet sent from this machine + // we just disregards it + //if ( *localaddr == saClient.sin_addr.s_addr ) continue; + bool bLocalAddress = false; + idx = 0; + while ( ( 0 != localaddr[ idx ] ) && ( idx < 16 ) ) + { + if ( localaddr[ idx ] == ( in_addr_t ) saClient.sin_addr.s_addr ) + { + bLocalAddress = true; + } + idx++; + } + if ( bLocalAddress ) continue; - } - } - - // Get mutex - pctrlObject->m_wxUDPMutex.Lock(); + wxLogDebug ( _ ( "UDPReceiveThread: It's from another machine." ) ); - // Must be room for the package - if ( pctrlObject->m_UDPQueue.nCount < - MAX_ITEMS_UDP_RECEIVE_QUEUE ) { + // Check size + // The size member must be low enough for the data to fit + // in the package + unsigned short size; + p = ( unsigned char * ) &size; + * ( p+0 ) = buf[ VSCP_UDP_POS_SIZE + 1 ]; + * ( p+1 ) = buf[ VSCP_UDP_POS_SIZE + 0 ]; - dllnode *pnewudpmsg = new dllnode; - if ( NULL != pnewudpmsg ) { + if ( ( size + 25 ) > nRet ) + { + // Wrong size -> Package faulty + continue; + } - // Add to in queue - pnewudpmsg->Key = 0; - pnewudpmsg->pKey = &pnewudpmsg->Key ; - pnewudpmsg->pObject = pEvent; - - if ( !dll_addNode( &pctrlObject->m_UDPQueue, pnewudpmsg ) ) { - delete pnewudpmsg; + // Calculate CRC if requested + if ( ! ( buf[ VSCP_UDP_POS_HEAD + 0 ] & VSCP_NO_CRC_CALC ) ) + { + if ( !crcFast ( buf, size ) ) continue; // Faulty CRC + } - } - } - } + vscpEvent *pEvent = new vscpEvent; - // Release mutex - pctrlObject->m_wxUDPMutex.Unlock(); + if ( NULL != pEvent ) + { - } - } + // Head + p = ( unsigned char * ) &pEvent->head; + * ( p+0 ) = buf[ VSCP_UDP_POS_HEAD + 0 ]; - close( theSocket ); - pthread_exit( &errorCode ); + // VSCP class + p = ( unsigned char * ) &pEvent->vscp_class; + * ( p+0 ) = buf[ VSCP_UDP_POS_CLASS + 1 ]; + * ( p+1 ) = buf[ VSCP_UDP_POS_CLASS + 0 ]; + // VSCP type + p = ( unsigned char * ) &pEvent->vscp_type; + * ( p+0 ) = buf[ VSCP_UDP_POS_TYPE + 1 ]; + * ( p+1 ) = buf[ VSCP_UDP_POS_TYPE + 0 ]; + + // Node address + p = ( unsigned char * ) &pEvent->GUID; + memcpy ( p, &buf[ VSCP_UDP_POS_GUID + 0 ], 16 ); + + // Number of valid data bytes + pEvent->sizeData = size; + + if ( pEvent->sizeData > 487 ) + { + // Can't be a VSCP package + delete pEvent; + continue; + } + + // CRC + p = ( unsigned char * ) &pEvent->crc; + * ( p+0 ) = buf[ VSCP_UDP_POS_CRC + 1 ]; + * ( p+1 ) = buf[ VSCP_UDP_POS_CRC + 0 ]; + + pEvent->pdata = NULL; + + if ( 0 != pEvent->sizeData ) + { + + // Allocate storage for data + unsigned char *pDataArea = new unsigned char[ pEvent->sizeData ]; + + if ( NULL != pDataArea ) + { + + // Data Max 487 (512- 25) bytes + pEvent->pdata = pDataArea; + + // size = sz - command_byte - control_bytes + memcpy ( pEvent->pdata, &buf[ VSCP_UDP_POS_DATA ], pEvent->sizeData ); + + } + } + + // Get mutex + pctrlObject->m_wxUDPMutex.Lock(); + + // Must be room for the package + if ( pctrlObject->m_UDPQueue.nCount < + MAX_ITEMS_UDP_RECEIVE_QUEUE ) + { + + dllnode *pnewudpmsg = new dllnode; + if ( NULL != pnewudpmsg ) + { + + // Add to in queue + pnewudpmsg->Key = 0; + pnewudpmsg->pKey = &pnewudpmsg->Key ; + pnewudpmsg->pObject = pEvent; + + if ( !dll_addNode ( &pctrlObject->m_UDPQueue, pnewudpmsg ) ) + { + delete pnewudpmsg; + + } + } + } + + // Release mutex + pctrlObject->m_wxUDPMutex.Unlock(); + + } + } + + close ( theSocket ); + pthread_exit ( &errorCode ); + } Modified: trunk/src/vscp/vscpworks/vscpworks.pjd =================================================================== --- trunk/src/vscp/vscpworks/vscpworks.pjd 2008-04-15 11:50:45 UTC (rev 878) +++ trunk/src/vscp/vscpworks/vscpworks.pjd 2008-04-15 12:21:45 UTC (rev 879) @@ -20,7 +20,7 @@ <string name="resource_prefix">""</string> <bool name="use_two_step_construction">1</bool> <bool name="use_enums">1</bool> - <string name="current_platform">"<All platforms>"</string> + <string name="current_platform">"__WXGTK__"</string> <string name="target_wx_version">"<Any>"</string> <string name="cpp_header_comment">"///////////////////////////////////////////////////////////////////////////// // Name: %HEADER-FILENAME% @@ -270,6 +270,7 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <document> <string name="title">"VC++ Project Debug"</string> <string name="type">"vc-project-config-data-document"</string> @@ -323,6 +324,7 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="Project make command">"%AUTO%"</string> <string name="Project build command">"%AUTO%"</string> <string name="Project rebuild command">"%AUTO%"</string> @@ -386,6 +388,7 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="Project make command">"%AUTO%"</string> <string name="Project build command">"%AUTO%"</string> <string name="Project rebuild command">"%AUTO%"</string> @@ -451,7 +454,12 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> </document> <document> <string name="title">"GCC Release shared Unicode"</string> @@ -508,7 +516,12 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> </document> <document> <string name="title">"GCC Debug"</string> @@ -565,7 +578,12 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> </document> <document> <string name="title">"GCC Release"</string> @@ -622,7 +640,12 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> </document> <document> <string name="title">"GCC Unicode Debug"</string> @@ -679,7 +702,12 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> </document> <document> <string name="title">"GCC Unicode Release"</string> @@ -736,7 +764,12 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> </document> <document> <string name="title">"VC++ Project Unicode Release"</string> @@ -791,6 +824,7 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="Project make command">"%AUTO%"</string> <string name="Project build command">"%AUTO%"</string> <string name="Project rebuild command">"%AUTO%"</string> @@ -853,6 +887,7 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="CFG">""</string> </document> <document> @@ -907,6 +942,7 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="CFG">""</string> </document> <document> @@ -962,6 +998,7 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> <string name="Project make command">"%AUTO%"</string> <string name="Project build command">"%AUTO%"</string> <string name="Project rebuild command">"%AUTO%"</string> @@ -25634,6 +25671,14 @@ <string name="proxy-type">"wbBoxSizerProxy"</string> <string name="proxy-Orientation">"Vertical"</string> <string name="proxy-Member variable name">""</string> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> <bool name="proxy-wxSHAPED">0</bool> <bool name="proxy-wxADJUST_MINSIZE">0</bool> <bool name="proxy-wxFIXED_MINSIZE">0</bool> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-15 11:50:55
|
Revision: 878 http://can.svn.sourceforge.net/can/?rev=878&view=rev Author: akhe Date: 2008-04-15 04:50:45 -0700 (Tue, 15 Apr 2008) Log Message: ----------- Non debug build is now default Modified Paths: -------------- trunk/src/vscp/daemon/linux/vscpd.cpp Modified: trunk/src/vscp/daemon/linux/vscpd.cpp =================================================================== --- trunk/src/vscp/daemon/linux/vscpd.cpp 2008-04-15 10:39:20 UTC (rev 877) +++ trunk/src/vscp/daemon/linux/vscpd.cpp 2008-04-15 11:50:45 UTC (rev 878) @@ -58,7 +58,7 @@ #include "../../common/controlobject.h" #include "../../common/version.h" -#define DEBUG +//#define DEBUG // Globals for the daemon int gbStopDaemon; @@ -133,11 +133,11 @@ switch ( arg ) { case 'c': - strcfgfile = wxString( optarg, wxConvUTF8); - + strcfgfile = wxString( optarg, wxConvUTF8 ); + //wxMBConvUTF8 cnv; + //cnv.MB2WC( strcfgfile, optarg, 10 ); break; - case 'd': nDebugLevel = atoi( optarg ); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-15 10:39:35
|
Revision: 877 http://can.svn.sourceforge.net/can/?rev=877&view=rev Author: akhe Date: 2008-04-15 03:39:20 -0700 (Tue, 15 Apr 2008) Log Message: ----------- Completed the sample with the canalsuperwrapper class Modified Paths: -------------- trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.idb trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.obj trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.pdb trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterfaceapp.obj trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd.bak trunk/src/vscp/samples/testinterface/testInterface.pjd trunk/src/vscp/samples/testinterface/testInterface.pjd.bak trunk/src/vscp/samples/testinterface/testInterface.plg trunk/src/vscp/samples/testinterface/testinterface.cpp trunk/src/vscp/samples/testinterface/testinterface.h trunk/src/vscp/samples/testinterface/vc60.pdb Modified: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.idb =================================================================== (Binary files differ) Modified: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.obj =================================================================== (Binary files differ) Modified: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.pdb =================================================================== (Binary files differ) Modified: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterfaceapp.obj =================================================================== (Binary files differ) Modified: trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd =================================================================== --- trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd 2008-04-15 10:18:01 UTC (rev 876) +++ trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd 2008-04-15 10:39:20 UTC (rev 877) @@ -182,7 +182,7 @@ <long name="title-mode">0</long> <long name="locked">0</long> <string name="template-name">"VC++ Project"</string> - <bool name="dirty">1</bool> + <bool name="dirty">0</bool> <long name="makefile-last-written">-8519680</long> <string name="Compiler name">"VC++ Project"</string> <string name="Build mode">"Release"</string> @@ -248,7 +248,7 @@ <long name="title-mode">0</long> <long name="locked">0</long> <string name="template-name">"VC++ Project"</string> - <bool name="dirty">1</bool> + <bool name="dirty">0</bool> <long name="makefile-last-written">-8519680</long> <string name="Compiler name">"VC++ Project"</string> <string name="Build mode">"Debug"</string> @@ -927,14 +927,6 @@ <string name="proxy-type">"wbBoxSizerProxy"</string> <string name="proxy-Orientation">"Vertical"</string> <string name="proxy-Member variable name">""</string> - <string name="proxy-AlignH">"Centre"</string> - <string name="proxy-AlignV">"Centre"</string> - <long name="proxy-Stretch factor">0</long> - <long name="proxy-Border">5</long> - <bool name="proxy-wxLEFT">1</bool> - <bool name="proxy-wxRIGHT">1</bool> - <bool name="proxy-wxTOP">1</bool> - <bool name="proxy-wxBOTTOM">1</bool> <bool name="proxy-wxSHAPED">0</bool> <bool name="proxy-wxADJUST_MINSIZE">0</bool> <bool name="proxy-wxFIXED_MINSIZE">0</bool> @@ -1421,6 +1413,70 @@ <bool name="proxy-wxFIXED_MINSIZE">0</bool> <string name="proxy-Platform">"<Any platform>"</string> <document> + <string name="title">"wxCheckBox: ID_CHECKBOX"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"checkbox"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="created">"15/4/2008"</string> + <string name="proxy-type">"wbCheckBoxProxy"</string> + <string name="proxy-Id name">"ID_CHECKBOX"</string> + <long name="proxy-Id value">10008</long> + <string name="proxy-Name">""</string> + <string name="proxy-Class">"wxCheckBox"</string> + <string name="proxy-Base class">"wxCheckBox"</string> + <bool name="proxy-External implementation">1</bool> + <bool name="proxy-Separate files">0</bool> + <string name="proxy-Implementation filename">""</string> + <string name="proxy-Header filename">""</string> + <string name="proxy-Member variable name">"m_chkUseCanalSuperWrapper"</string> + <string name="proxy-Label">"Use CanalSuperWrapper"</string> + <bool name="proxy-Initial value">0</bool> + <string name="proxy-Help text">""</string> + <string name="proxy-Tooltip text">""</string> + <string name="proxy-Data variable">""</string> + <string name="proxy-Data validator">""</string> + <string name="proxy-Data source">""</string> + <string name="proxy-Data class name">""</string> + <string name="proxy-Data class implementation filename">""</string> + <string name="proxy-Data class header filename">""</string> + <string name="proxy-Data class manager window">""</string> + <string name="proxy-Background colour">""</string> + <string name="proxy-Foreground colour">""</string> + <string name="proxy-Font">""</string> + <bool name="proxy-Hidden">0</bool> + <bool name="proxy-Enabled">1</bool> + <string name="proxy-Platform">"<Any platform>"</string> + <bool name="proxy-wxALIGN_RIGHT">0</bool> + <bool name="proxy-wxCHK_2STATE">0</bool> + <bool name="proxy-wxCHK_3STATE">0</bool> + <bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool> + <bool name="proxy-wxWANTS_CHARS">0</bool> + <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool> + <string name="proxy-Custom styles">""</string> + <long name="proxy-X">-1</long> + <long name="proxy-Y">-1</long> + <long name="proxy-Width">-1</long> + <long name="proxy-Height">-1</long> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <string name="proxy-Custom arguments">""</string> + <string name="proxy-Custom ctor arguments">""</string> + </document> + <document> <string name="title">"wxButton: ID_BUTTON_CONNECT"</string> <string name="type">"dialog-control-document"</string> <string name="filename">""</string> Modified: trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd.bak =================================================================== --- trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd.bak 2008-04-15 10:18:01 UTC (rev 876) +++ trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd.bak 2008-04-15 10:39:20 UTC (rev 877) @@ -1413,6 +1413,70 @@ <bool name="proxy-wxFIXED_MINSIZE">0</bool> <string name="proxy-Platform">"<Any platform>"</string> <document> + <string name="title">"wxCheckBox: ID_CHECKBOX"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"checkbox"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="created">"15/4/2008"</string> + <string name="proxy-type">"wbCheckBoxProxy"</string> + <string name="proxy-Id name">"ID_CHECKBOX"</string> + <long name="proxy-Id value">10008</long> + <string name="proxy-Name">""</string> + <string name="proxy-Class">"wxCheckBox"</string> + <string name="proxy-Base class">"wxCheckBox"</string> + <bool name="proxy-External implementation">1</bool> + <bool name="proxy-Separate files">0</bool> + <string name="proxy-Implementation filename">""</string> + <string name="proxy-Header filename">""</string> + <string name="proxy-Member variable name">"m_chkUseCanalSuperWrapper"</string> + <string name="proxy-Label">"Use CanalSuperWrapper"</string> + <bool name="proxy-Initial value">0</bool> + <string name="proxy-Help text">""</string> + <string name="proxy-Tooltip text">""</string> + <string name="proxy-Data variable">""</string> + <string name="proxy-Data validator">""</string> + <string name="proxy-Data source">""</string> + <string name="proxy-Data class name">""</string> + <string name="proxy-Data class implementation filename">""</string> + <string name="proxy-Data class header filename">""</string> + <string name="proxy-Data class manager window">""</string> + <string name="proxy-Background colour">""</string> + <string name="proxy-Foreground colour">""</string> + <string name="proxy-Font">""</string> + <bool name="proxy-Hidden">0</bool> + <bool name="proxy-Enabled">1</bool> + <string name="proxy-Platform">"<Any platform>"</string> + <bool name="proxy-wxALIGN_RIGHT">0</bool> + <bool name="proxy-wxCHK_2STATE">0</bool> + <bool name="proxy-wxCHK_3STATE">0</bool> + <bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool> + <bool name="proxy-wxWANTS_CHARS">0</bool> + <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool> + <string name="proxy-Custom styles">""</string> + <long name="proxy-X">-1</long> + <long name="proxy-Y">-1</long> + <long name="proxy-Width">-1</long> + <long name="proxy-Height">-1</long> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <string name="proxy-Custom arguments">""</string> + <string name="proxy-Custom ctor arguments">""</string> + </document> + <document> <string name="title">"wxButton: ID_BUTTON_CONNECT"</string> <string name="type">"dialog-control-document"</string> <string name="filename">""</string> @@ -1656,7 +1720,7 @@ <document> <string name="title">"canalsuperwrapper.cpp"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/canalsuperwrapper.cpp"</string> + <string name="filename">"../../common/canalsuperwrapper.cpp"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1668,7 +1732,7 @@ <document> <string name="title">"canalsuperwrapper.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/canalsuperwrapper.h"</string> + <string name="filename">"../../common/canalsuperwrapper.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1680,7 +1744,7 @@ <document> <string name="title">"crc.c"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../../common/crc.c"</string> + <string name="filename">"../../../common/crc.c"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1692,7 +1756,7 @@ <document> <string name="title">"crc.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../../common/crc.h"</string> + <string name="filename">"../../../common/crc.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1704,7 +1768,7 @@ <document> <string name="title">"dllwrapper.cpp"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/dllwrapper.cpp"</string> + <string name="filename">"../../common/dllwrapper.cpp"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1716,7 +1780,7 @@ <document> <string name="title">"dllwrapper.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/dllwrapper.h"</string> + <string name="filename">"../../common/dllwrapper.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1728,7 +1792,7 @@ <document> <string name="title">"guid.cpp"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/guid.cpp"</string> + <string name="filename">"../../common/guid.cpp"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1740,7 +1804,7 @@ <document> <string name="title">"guid.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/guid.h"</string> + <string name="filename">"../../common/guid.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1788,7 +1852,7 @@ <document> <string name="title">"vscphelper.cpp"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/vscphelper.cpp"</string> + <string name="filename">"../../common/vscphelper.cpp"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1800,7 +1864,7 @@ <document> <string name="title">"vscphelper.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/vscphelper.h"</string> + <string name="filename">"../../common/vscphelper.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1812,7 +1876,7 @@ <document> <string name="title">"vscptcpif.cpp"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/vscptcpif.cpp"</string> + <string name="filename">"../../common/vscptcpif.cpp"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1824,7 +1888,7 @@ <document> <string name="title">"vscptcpif.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/vscptcpif.h"</string> + <string name="filename">"../../common/vscptcpif.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> Modified: trunk/src/vscp/samples/testinterface/testInterface.pjd =================================================================== --- trunk/src/vscp/samples/testinterface/testInterface.pjd 2008-04-15 10:18:01 UTC (rev 876) +++ trunk/src/vscp/samples/testinterface/testInterface.pjd 2008-04-15 10:39:20 UTC (rev 877) @@ -927,14 +927,6 @@ <string name="proxy-type">"wbBoxSizerProxy"</string> <string name="proxy-Orientation">"Vertical"</string> <string name="proxy-Member variable name">""</string> - <string name="proxy-AlignH">"Centre"</string> - <string name="proxy-AlignV">"Centre"</string> - <long name="proxy-Stretch factor">0</long> - <long name="proxy-Border">5</long> - <bool name="proxy-wxLEFT">1</bool> - <bool name="proxy-wxRIGHT">1</bool> - <bool name="proxy-wxTOP">1</bool> - <bool name="proxy-wxBOTTOM">1</bool> <bool name="proxy-wxSHAPED">0</bool> <bool name="proxy-wxADJUST_MINSIZE">0</bool> <bool name="proxy-wxFIXED_MINSIZE">0</bool> @@ -1421,6 +1413,70 @@ <bool name="proxy-wxFIXED_MINSIZE">0</bool> <string name="proxy-Platform">"<Any platform>"</string> <document> + <string name="title">"wxCheckBox: ID_CHECKBOX"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"checkbox"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="created">"15/4/2008"</string> + <string name="proxy-type">"wbCheckBoxProxy"</string> + <string name="proxy-Id name">"ID_CHECKBOX"</string> + <long name="proxy-Id value">10008</long> + <string name="proxy-Name">""</string> + <string name="proxy-Class">"wxCheckBox"</string> + <string name="proxy-Base class">"wxCheckBox"</string> + <bool name="proxy-External implementation">1</bool> + <bool name="proxy-Separate files">0</bool> + <string name="proxy-Implementation filename">""</string> + <string name="proxy-Header filename">""</string> + <string name="proxy-Member variable name">"m_chkUseCanalSuperWrapper"</string> + <string name="proxy-Label">"Use CanalSuperWrapper"</string> + <bool name="proxy-Initial value">0</bool> + <string name="proxy-Help text">""</string> + <string name="proxy-Tooltip text">""</string> + <string name="proxy-Data variable">""</string> + <string name="proxy-Data validator">""</string> + <string name="proxy-Data source">""</string> + <string name="proxy-Data class name">""</string> + <string name="proxy-Data class implementation filename">""</string> + <string name="proxy-Data class header filename">""</string> + <string name="proxy-Data class manager window">""</string> + <string name="proxy-Background colour">""</string> + <string name="proxy-Foreground colour">""</string> + <string name="proxy-Font">""</string> + <bool name="proxy-Hidden">0</bool> + <bool name="proxy-Enabled">1</bool> + <string name="proxy-Platform">"<Any platform>"</string> + <bool name="proxy-wxALIGN_RIGHT">0</bool> + <bool name="proxy-wxCHK_2STATE">0</bool> + <bool name="proxy-wxCHK_3STATE">0</bool> + <bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool> + <bool name="proxy-wxWANTS_CHARS">0</bool> + <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool> + <string name="proxy-Custom styles">""</string> + <long name="proxy-X">-1</long> + <long name="proxy-Y">-1</long> + <long name="proxy-Width">-1</long> + <long name="proxy-Height">-1</long> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <string name="proxy-Custom arguments">""</string> + <string name="proxy-Custom ctor arguments">""</string> + </document> + <document> <string name="title">"wxButton: ID_BUTTON_CONNECT"</string> <string name="type">"dialog-control-document"</string> <string name="filename">""</string> Modified: trunk/src/vscp/samples/testinterface/testInterface.pjd.bak =================================================================== --- trunk/src/vscp/samples/testinterface/testInterface.pjd.bak 2008-04-15 10:18:01 UTC (rev 876) +++ trunk/src/vscp/samples/testinterface/testInterface.pjd.bak 2008-04-15 10:39:20 UTC (rev 877) @@ -1413,6 +1413,70 @@ <bool name="proxy-wxFIXED_MINSIZE">0</bool> <string name="proxy-Platform">"<Any platform>"</string> <document> + <string name="title">"wxCheckBox: ID_CHECKBOX"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"checkbox"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="created">"15/4/2008"</string> + <string name="proxy-type">"wbCheckBoxProxy"</string> + <string name="proxy-Id name">"ID_CHECKBOX"</string> + <long name="proxy-Id value">10008</long> + <string name="proxy-Name">""</string> + <string name="proxy-Class">"wxCheckBox"</string> + <string name="proxy-Base class">"wxCheckBox"</string> + <bool name="proxy-External implementation">1</bool> + <bool name="proxy-Separate files">0</bool> + <string name="proxy-Implementation filename">""</string> + <string name="proxy-Header filename">""</string> + <string name="proxy-Member variable name">"m_chkUseCanalSuperWrapper"</string> + <string name="proxy-Label">"Use CanalSuperWrapper"</string> + <bool name="proxy-Initial value">0</bool> + <string name="proxy-Help text">""</string> + <string name="proxy-Tooltip text">""</string> + <string name="proxy-Data variable">""</string> + <string name="proxy-Data validator">""</string> + <string name="proxy-Data source">""</string> + <string name="proxy-Data class name">""</string> + <string name="proxy-Data class implementation filename">""</string> + <string name="proxy-Data class header filename">""</string> + <string name="proxy-Data class manager window">""</string> + <string name="proxy-Background colour">""</string> + <string name="proxy-Foreground colour">""</string> + <string name="proxy-Font">""</string> + <bool name="proxy-Hidden">0</bool> + <bool name="proxy-Enabled">1</bool> + <string name="proxy-Platform">"<Any platform>"</string> + <bool name="proxy-wxALIGN_RIGHT">0</bool> + <bool name="proxy-wxCHK_2STATE">0</bool> + <bool name="proxy-wxCHK_3STATE">0</bool> + <bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool> + <bool name="proxy-wxWANTS_CHARS">0</bool> + <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool> + <string name="proxy-Custom styles">""</string> + <long name="proxy-X">-1</long> + <long name="proxy-Y">-1</long> + <long name="proxy-Width">-1</long> + <long name="proxy-Height">-1</long> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <string name="proxy-Custom arguments">""</string> + <string name="proxy-Custom ctor arguments">""</string> + </document> + <document> <string name="title">"wxButton: ID_BUTTON_CONNECT"</string> <string name="type">"dialog-control-document"</string> <string name="filename">""</string> @@ -1656,7 +1720,7 @@ <document> <string name="title">"canalsuperwrapper.cpp"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/canalsuperwrapper.cpp"</string> + <string name="filename">"../../common/canalsuperwrapper.cpp"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1668,7 +1732,7 @@ <document> <string name="title">"canalsuperwrapper.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/canalsuperwrapper.h"</string> + <string name="filename">"../../common/canalsuperwrapper.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1680,7 +1744,7 @@ <document> <string name="title">"crc.c"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../../common/crc.c"</string> + <string name="filename">"../../../common/crc.c"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1692,7 +1756,7 @@ <document> <string name="title">"crc.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../../common/crc.h"</string> + <string name="filename">"../../../common/crc.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1704,7 +1768,7 @@ <document> <string name="title">"dllwrapper.cpp"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/dllwrapper.cpp"</string> + <string name="filename">"../../common/dllwrapper.cpp"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1716,7 +1780,7 @@ <document> <string name="title">"dllwrapper.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/dllwrapper.h"</string> + <string name="filename">"../../common/dllwrapper.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1728,7 +1792,7 @@ <document> <string name="title">"guid.cpp"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/guid.cpp"</string> + <string name="filename">"../../common/guid.cpp"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1740,7 +1804,7 @@ <document> <string name="title">"guid.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/guid.h"</string> + <string name="filename">"../../common/guid.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1788,7 +1852,7 @@ <document> <string name="title">"vscphelper.cpp"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/vscphelper.cpp"</string> + <string name="filename">"../../common/vscphelper.cpp"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1800,7 +1864,7 @@ <document> <string name="title">"vscphelper.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/vscphelper.h"</string> + <string name="filename">"../../common/vscphelper.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1812,7 +1876,7 @@ <document> <string name="title">"vscptcpif.cpp"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/vscptcpif.cpp"</string> + <string name="filename">"../../common/vscptcpif.cpp"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> @@ -1824,7 +1888,7 @@ <document> <string name="title">"vscptcpif.h"</string> <string name="type">"source-editor-document"</string> - <string name="filename">"../common/vscptcpif.h"</string> + <string name="filename">"../../common/vscptcpif.h"</string> <string name="icon-name">"source-editor"</string> <long name="is-transient">0</long> <long name="owns-file">0</long> Modified: trunk/src/vscp/samples/testinterface/testInterface.plg =================================================================== --- trunk/src/vscp/samples/testinterface/testInterface.plg 2008-04-15 10:18:01 UTC (rev 876) +++ trunk/src/vscp/samples/testinterface/testInterface.plg 2008-04-15 10:39:20 UTC (rev 877) @@ -6,52 +6,53 @@ --------------------Configuration: testInterface - Win32 Debug-------------------- </h3> <h3>Command Lines</h3> -Creating temporary file "D:\DOCUME~1\ADMINI~1\LOKALA~1\Temp\RSPE6.tmp" with contents +Creating temporary file "D:\DOCUME~1\ADMINI~1\LOKALA~1\Temp\RSP13C.tmp" with contents [ /nologo /MDd /W4 /GR /Zi /Od /I "D:\wxWidgets-2.8.7/include" /I "D:\wxWidgets-2.8.7/contrib/include" /I "D:\wxWidgets-2.8.7/lib/vc_lib/mswud" /I "D:\Program\Microsoft Visual Studio\vc98\include" /D "NOPCH" /D "WIN32" /D "__WXMSW__" /D "_WINDOWS" /D "__WXDEBUG__" /D "_DEBUG" /D "_UNICODE" /Fo"VCProjectDebug/" /Fd"VCProjectDebug\testInterface.pdb" /FD /EHsc /c "D:\development\vscp\src\vscp\samples\testinterface\testinterfaceapp.cpp" "D:\development\vscp\src\vscp\samples\testinterface\testinterface.cpp" -"D:\development\vscp\src\vscp\common\vscphelper.cpp" -"D:\development\vscp\src\vscp\common\vscptcpif.cpp" -"D:\development\vscp\src\vscp\common\canalsuperwrapper.cpp" -"D:\development\vscp\src\vscp\common\dllwrapper.cpp" -"D:\development\vscp\src\vscp\common\guid.cpp" +"D:\development\vscp\src\common\crc.c" ] -Creating command line "cl.exe @D:\DOCUME~1\ADMINI~1\LOKALA~1\Temp\RSPE6.tmp" -Creating temporary file "D:\DOCUME~1\ADMINI~1\LOKALA~1\Temp\RSPE7.tmp" with contents +Creating command line "cl.exe @D:\DOCUME~1\ADMINI~1\LOKALA~1\Temp\RSP13C.tmp" +Creating temporary file "D:\DOCUME~1\ADMINI~1\LOKALA~1\Temp\RSP13D.tmp" with contents [ wxmsw28ud_richtext.lib wxmsw28ud_aui.lib wxmsw28ud_core.lib wxbase28ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxmsw28ud_adv.lib wxmsw28ud_html.lib wxmsw28ud_xrc.lib wxbase28ud_net.lib wxbase28ud_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /subsystem:windows /incremental:yes /pdb:"VCProjectDebug/testInterface.pdb" /debug /machine:I386 /out:"VCProjectDebug/testInterface.exe" /libpath:"D:\wxWidgets-2.8.7/lib/vc_lib" /libpath:"D:\Program\Microsoft Visual Studio\vc98\lib" .\VCProjectDebug\testinterfaceapp.obj .\VCProjectDebug\testinterface.obj -.\VCProjectDebug\testInterface.res -.\VCProjectDebug\vscphelper.obj -.\VCProjectDebug\vscptcpif.obj .\VCProjectDebug\canalsuperwrapper.obj +.\VCProjectDebug\crc.obj .\VCProjectDebug\dllwrapper.obj .\VCProjectDebug\guid.obj +.\VCProjectDebug\vscphelper.obj +.\VCProjectDebug\vscptcpif.obj +.\VCProjectDebug\testInterface.res ] -Creating command line "link.exe @D:\DOCUME~1\ADMINI~1\LOKALA~1\Temp\RSPE7.tmp" +Creating command line "link.exe @D:\DOCUME~1\ADMINI~1\LOKALA~1\Temp\RSP13D.tmp" <h3>Output Window</h3> Compiling... testinterfaceapp.cpp testinterface.cpp -vscphelper.cpp -vscptcpif.cpp -canalsuperwrapper.cpp -dllwrapper.cpp -guid.cpp Generating Code... -D:\development\vscp\src\vscp\common\vscptcpif.cpp(855) : warning C4706: assignment within conditional expression +Compiling... +crc.c +D:\development\vscp\src\common\crc.c(123) : warning C4244: '=' : conversion from 'int ' to 'unsigned short ', possible loss of data +D:\development\vscp\src\common\crc.c(127) : warning C4244: '=' : conversion from 'int ' to 'unsigned short ', possible loss of data +D:\development\vscp\src\common\crc.c(135) : warning C4244: 'return' : conversion from 'int ' to 'unsigned short ', possible loss of data +D:\development\vscp\src\common\crc.c(172) : warning C4244: '=' : conversion from 'int ' to 'unsigned short ', possible loss of data +D:\development\vscp\src\common\crc.c(184) : warning C4244: '=' : conversion from 'int ' to 'unsigned short ', possible loss of data +D:\development\vscp\src\common\crc.c(188) : warning C4244: '=' : conversion from 'int ' to 'unsigned short ', possible loss of data +D:\development\vscp\src\common\crc.c(225) : warning C4244: '=' : conversion from 'int ' to 'unsigned char ', possible loss of data +D:\development\vscp\src\common\crc.c(226) : warning C4244: '=' : conversion from 'int ' to 'unsigned short ', possible loss of data +D:\development\vscp\src\common\crc.c(232) : warning C4244: 'return' : conversion from 'int ' to 'unsigned short ', possible loss of data +D:\development\vscp\src\common\crc.c(236) : warning C4505: 'reflect' : unreferenced local function has been removed + D:\development\vscp\src\common\crc.c(59) : see declaration of 'reflect' +Generating Code... Linking... -vscphelper.obj : error LNK2001: unresolved external symbol _crcFast -vscphelper.obj : error LNK2001: unresolved external symbol _crcInit -VCProjectDebug/testInterface.exe : fatal error LNK1120: 2 unresolved externals -Error executing link.exe. <h3>Results</h3> -testInterface.exe - 3 error(s), 1 warning(s) +testInterface.exe - 0 error(s), 10 warning(s) </pre> </body> </html> Modified: trunk/src/vscp/samples/testinterface/testinterface.cpp =================================================================== --- trunk/src/vscp/samples/testinterface/testinterface.cpp 2008-04-15 10:18:01 UTC (rev 876) +++ trunk/src/vscp/samples/testinterface/testinterface.cpp 2008-04-15 10:39:20 UTC (rev 877) @@ -113,6 +113,7 @@ m_txtServer = NULL; m_txtUsername = NULL; m_txtPassword = NULL; + m_chkUseCanalSuperWrapper = NULL; m_btnConnect = NULL; m_btnDisConnect = NULL; m_txtLog = NULL; @@ -156,6 +157,10 @@ wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add(itemBoxSizer9, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + m_chkUseCanalSuperWrapper = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Use CanalSuperWrapper"), wxDefaultPosition, wxDefaultSize, 0 ); + m_chkUseCanalSuperWrapper->SetValue(false); + itemBoxSizer9->Add(m_chkUseCanalSuperWrapper, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + m_btnConnect = new wxButton( itemDialog1, ID_BUTTON_CONNECT, _("Connect"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer9->Add(m_btnConnect, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); @@ -212,17 +217,33 @@ void TestInterface::OnButtonConnectClick( wxCommandEvent& event ) { - if ( 1922 == m_tcpif.doCmdOpen( m_txtServer->GetValue(), - 9598, - m_txtUsername->GetValue(), - m_txtPassword->GetValue() ) ) { - m_txtLog->SetValue( m_txtLog->GetValue() + _("\r\n") + _("Connected") ); - m_btnConnect->Enable( false ); - } - else { - m_txtLog->SetValue( m_txtLog->GetValue() + _("\r\n") + _("Failed to connect") ); - m_btnConnect->Enable(); - } + if ( !m_chkUseCanalSuperWrapper->GetValue() ) { + if ( 1922 == m_tcpif.doCmdOpen( m_txtServer->GetValue(), + 9598, + m_txtUsername->GetValue(), + m_txtPassword->GetValue() ) ) { + m_txtLog->SetValue( m_txtLog->GetValue() + _("\r\n") + _("Connected with VscpTcpIf") ); + m_btnConnect->Enable( false ); + } + else { + m_txtLog->SetValue( m_txtLog->GetValue() + _("\r\n") + _("Failed to connect woth VscpTcpIf") ); + m_btnConnect->Enable(); + } + } + else { + m_csw.SetInterface( m_txtServer->GetValue(), + 9598, + m_txtUsername->GetValue(), + m_txtPassword->GetValue() ); + if ( m_csw.doCmdOpen() ) { + m_txtLog->SetValue( m_txtLog->GetValue() + _("\r\n") + _("Connected with CanalSuperWrapper") ); + m_btnConnect->Enable( false ); + } + else { + m_txtLog->SetValue( m_txtLog->GetValue() + _("\r\n") + _("Failed to connect woth CanalSuperWrapper") ); + m_btnConnect->Enable(); + } + } event.Skip(); } @@ -233,8 +254,14 @@ void TestInterface::OnButtonDisconnectClick( wxCommandEvent& event ) { - m_tcpif.doCmdClose(); - m_txtLog->SetValue( m_txtLog->GetValue() + _("\r\n") + _("Disconnected") ); + if ( !m_chkUseCanalSuperWrapper->GetValue() ) { + m_tcpif.doCmdClose(); + m_txtLog->SetValue( m_txtLog->GetValue() + _("\r\n") + _("Disconnected") ); + } + else { + m_csw.doCmdClose(); + m_txtLog->SetValue( m_txtLog->GetValue() + _("\r\n") + _("Disconnected with CanalSuperWrapper") ); + } m_btnConnect->Enable(); event.Skip(); } Modified: trunk/src/vscp/samples/testinterface/testinterface.h =================================================================== --- trunk/src/vscp/samples/testinterface/testinterface.h 2008-04-15 10:18:01 UTC (rev 876) +++ trunk/src/vscp/samples/testinterface/testinterface.h 2008-04-15 10:39:20 UTC (rev 877) @@ -18,6 +18,7 @@ */ #include "../../common/vscptcpif.h" +#include "../../common/canalsuperwrapper.h" ////@begin includes ////@end includes @@ -38,6 +39,7 @@ #define ID_TEXTCTRL_TEXT_SERVER 10001 #define ID_TEXTCTRL_TEXT_USERNAME 10002 #define ID_TEXTCTRL_TEXT_PASSWORD 10003 +#define ID_CHECKBOX 10008 #define ID_BUTTON_CONNECT 10004 #define ID_BUTTON_DISCONNECT 10005 #define ID_TEXTCTRL_LOG 10007 @@ -78,8 +80,8 @@ VscpTcpIf m_tcpif; + CCanalSuperWrapper m_csw; - ////@begin TestInterface event handler declarations /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_CONNECT @@ -106,6 +108,7 @@ wxTextCtrl* m_txtServer; wxTextCtrl* m_txtUsername; wxTextCtrl* m_txtPassword; + wxCheckBox* m_chkUseCanalSuperWrapper; wxButton* m_btnConnect; wxButton* m_btnDisConnect; wxTextCtrl* m_txtLog; Modified: trunk/src/vscp/samples/testinterface/vc60.pdb =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-15 10:18:10
|
Revision: 876 http://can.svn.sourceforge.net/can/?rev=876&view=rev Author: akhe Date: 2008-04-15 03:18:01 -0700 (Tue, 15 Apr 2008) Log Message: ----------- Added short description Added Paths: ----------- trunk/src/vscp/samples/testinterface/README Added: trunk/src/vscp/samples/testinterface/README =================================================================== --- trunk/src/vscp/samples/testinterface/README (rev 0) +++ trunk/src/vscp/samples/testinterface/README 2008-04-15 10:18:01 UTC (rev 876) @@ -0,0 +1,3 @@ +This application show how to conect to a VSCP TCP/IP server +using either the direct vscptcpip.cpp class or the indirect +canalsuperwrapper.cpp class. \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-15 10:09:11
|
Revision: 875 http://can.svn.sourceforge.net/can/?rev=875&view=rev Author: akhe Date: 2008-04-15 03:08:59 -0700 (Tue, 15 Apr 2008) Log Message: ----------- Added a simple test connection application for the TCP/IP interface Added Paths: ----------- trunk/src/vscp/samples/testinterface/ trunk/src/vscp/samples/testinterface/Makefile trunk/src/vscp/samples/testinterface/VCProjectDebug/ trunk/src/vscp/samples/testinterface/VCProjectDebug/canalsuperwrapper.obj trunk/src/vscp/samples/testinterface/VCProjectDebug/dllwrapper.obj trunk/src/vscp/samples/testinterface/VCProjectDebug/guid.obj trunk/src/vscp/samples/testinterface/VCProjectDebug/testInterface.res trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.idb trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.obj trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.pdb trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterfaceapp.obj trunk/src/vscp/samples/testinterface/VCProjectDebug/vscphelper.obj trunk/src/vscp/samples/testinterface/VCProjectDebug/vscptcpif.obj trunk/src/vscp/samples/testinterface/VCUnicodeDebug/ trunk/src/vscp/samples/testinterface/delivery trunk/src/vscp/samples/testinterface/makefile.vc trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd.bak trunk/src/vscp/samples/testinterface/testInterface.dsp trunk/src/vscp/samples/testinterface/testInterface.dsw trunk/src/vscp/samples/testinterface/testInterface.ncb trunk/src/vscp/samples/testinterface/testInterface.opt trunk/src/vscp/samples/testinterface/testInterface.pjd trunk/src/vscp/samples/testinterface/testInterface.pjd.bak trunk/src/vscp/samples/testinterface/testInterface.plg trunk/src/vscp/samples/testinterface/testInterface.rc trunk/src/vscp/samples/testinterface/testinterface.cpp trunk/src/vscp/samples/testinterface/testinterface.h trunk/src/vscp/samples/testinterface/testinterfaceapp.cpp trunk/src/vscp/samples/testinterface/testinterfaceapp.h trunk/src/vscp/samples/testinterface/vc60.pdb Added: trunk/src/vscp/samples/testinterface/Makefile =================================================================== --- trunk/src/vscp/samples/testinterface/Makefile (rev 0) +++ trunk/src/vscp/samples/testinterface/Makefile 2008-04-15 10:08:59 UTC (rev 875) @@ -0,0 +1,123 @@ +### Begin DialogBlocks generated body +################################################################################ +# Makefile generated by DialogBlocks +# +# Available configurations: +# release +# debug +################################################################################ + +CONFIG=release + +# release +ifeq ($(CONFIG),release) +WXWIN=D:/wxWidgets-2.8.7 +TOOLCHAINNAME=mswu +WXVERSION:=$(shell echo `$(WXWIN)/GCCBuildReleaseMSWUnicode/wx-config --version`) +CXX=g++.exe +RESCOMP=windres.exe +RCFILEOBJ=testInterface_rc.o +RCFILESRC=testInterface.rc +RESOURCEOBJECT= $(OBJECTPATH)/$(RCFILEOBJ) +OUTPUTPATH=GCCRelease +OBJECTPATH=GCCRelease +BUILDPATHS=$(OBJECTPATH) +PROGRAM=testInterface.exe +LIBS=`$(WXWIN)/GCCBuildReleaseMSWUnicode/wx-config --inplace --exec-prefix="$(WXWIN)/GCCBuildReleaseMSWUnicode" --libs` +LINKERFLAGS=-Wl,--subsystem,windows -mwindows +WARNINGFLAGS=-Wall +OPTFLAGS=-O +DEBUGFLAGS= +LIBPATH= +CPPINC=`$(WXWIN)/GCCBuildReleaseMSWUnicode/wx-config --inplace --cxxflags` +GCCFLAGS= +LDFLAGS=$(LIBS) $(LIBPATH) $(LINKERFLAGS) +CPPFLAGS=$(CPPINC) $(GCCFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) +LIBDIRNAME=$(WXWIN)/GCCBuildReleaseMSWUnicode/lib +RESPATH=--include-dir "$(WXWIN)/include" --include-dir "$(WXWIN)/contrib/include" --include-dir "$(WXWIN)/GCCBuildReleaseMSWUnicode/lib/wx/include/msw-unicode-release-static-2.8" +MACPACKAGEINFO= + +# debug +else +WXWIN=D:/wxWidgets-2.8.7 +TOOLCHAINNAME=mswud +WXVERSION:=$(shell echo `$(WXWIN)/GCCBuildDebugMSWUnicode/wx-config --version`) +CXX=g++.exe +RESCOMP=windres.exe +RCFILEOBJ=testInterface_rc.o +RCFILESRC=testInterface.rc +RESOURCEOBJECT= $(OBJECTPATH)/$(RCFILEOBJ) +OUTPUTPATH=GCCDebug +OBJECTPATH=GCCDebug +BUILDPATHS=$(OBJECTPATH) +PROGRAM=testInterface.exe +LIBS=`$(WXWIN)/GCCBuildDebugMSWUnicode/wx-config --inplace --exec-prefix="$(WXWIN)/GCCBuildDebugMSWUnicode" --libs` +LINKERFLAGS=-Wl,--subsystem,windows -mwindows +WARNINGFLAGS=-Wall +OPTFLAGS=-O0 +DEBUGFLAGS=-ggdb +LIBPATH= +CPPINC=`$(WXWIN)/GCCBuildDebugMSWUnicode/wx-config --inplace --cxxflags` +GCCFLAGS= +LDFLAGS=$(LIBS) $(LIBPATH) $(LINKERFLAGS) +CPPFLAGS=$(CPPINC) $(GCCFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) +LIBDIRNAME=$(WXWIN)/GCCBuildDebugMSWUnicode/lib +RESPATH=--include-dir "$(WXWIN)/include" --include-dir "$(WXWIN)/contrib/include" --include-dir "$(WXWIN)/GCCBuildDebugMSWUnicode/lib/wx/include/msw-unicode-debug-static-2.8" +MACPACKAGEINFO= +endif + +OBJECTS=$(OBJECTPATH)/testinterfaceapp.o $(OBJECTPATH)/testinterface.o $(OBJECTPATH)/canalsuperwrapper.o $(OBJECTPATH)/dllwrapper.o $(OBJECTPATH)/vscphelper.o $(RESOURCEOBJECT) + +all: $(BUILDPATHS) $(MACPACKAGEINFO) $(OUTPUTPATH)/$(PROGRAM) + +$(OBJECTPATH): + mkdir -p $(OBJECTPATH) + +clean: + rm -f $(OBJECTPATH)/*.o + rm -f $(OBJECTPATH)/*.res + rm -fr .deps .pch + rm -fr $(PROGRAM).app + rm -f $(OUTPUTPATH)/$(PROGRAM) + +help: + @echo "Usage: make -f Makefile CONFIG=[release|debug] [all|clean|help]" + +$(OUTPUTPATH)/$(PROGRAM): $(OBJECTS) + $(CXX) -o $@ $(OBJECTS) $(LDFLAGS) + + +# Windows only +$(OBJECTPATH)/$(RCFILEOBJ): $(RCFILESRC) + $(RESCOMP) --use-temp-file -i$< -o$@ $(RESPATH) --include-dir . --define NOPCH + +# Mac only +$(OUTPUTPATH)/$(PROGRAM).app/Contents/PkgInfo: $(OUTPUTPATH)/$(PROGRAM) $(INFOPLISTSOURCE) $(ICNSSOURCE) + mkdir -p $(OUTPUTPATH)/$(PROGRAM).app/Contents + mkdir -p $(OUTPUTPATH)/$(PROGRAM).app/Contents/MacOS + mkdir -p $(OUTPUTPATH)/$(PROGRAM).app/Contents/Resources + sed -e "s/IDENTIFIER/$(PROGRAM)/" \ + -e "s/EXECUTABLE/$(PROGRAM)/" \ + -e "s/VERSION/$(WXVERSION)/" \ + $(INFOPLISTSOURCE) >$(OUTPUTPATH)/$(PROGRAM).app/Contents/Info.plist + echo -n "APPL????" >$(OUTPUTPATH)/$(PROGRAM).app/Contents/PkgInfo + ln -f $(OUTPUTPATH)/$(PROGRAM) $(OUTPUTPATH)/$(PROGRAM).app/Contents/MacOS/$(PROGRAM) + cp -f $(ICNSSOURCE) $(ICNSDEST) + +$(OBJECTPATH)/testinterfaceapp.o: testinterfaceapp.cpp testinterfaceapp.h testinterface.h + $(CXX) -c -o $@ $(CPPFLAGS) testinterfaceapp.cpp + +$(OBJECTPATH)/testinterface.o: testinterface.cpp testinterface.h + $(CXX) -c -o $@ $(CPPFLAGS) testinterface.cpp + +$(OBJECTPATH)/canalsuperwrapper.o: ../common/canalsuperwrapper.cpp ../common/vscp.h ../common/vscp_classes.h ../common/vscp_types.h ../common/canal.h ../../common/crc.h ../common/canalsuperwrapper.h ../common/dllwrapper.h ../common/canaldlldef.h ../common/vscptcpif.h ../common/vscphelper.h ../common/guid.h ../../common/dllist.h ../common/devitem.h + $(CXX) -c -o $@ $(CPPFLAGS) ../common/canalsuperwrapper.cpp + +$(OBJECTPATH)/dllwrapper.o: ../common/dllwrapper.cpp ../common/dllwrapper.h ../common/canaldlldef.h ../common/canal.h + $(CXX) -c -o $@ $(CPPFLAGS) ../common/dllwrapper.cpp + +$(OBJECTPATH)/vscphelper.o: ../common/vscphelper.cpp ../common/vscp.h ../common/vscp_classes.h ../common/vscp_types.h ../common/canal.h ../../common/crc.h ../common/vscphelper.h + $(CXX) -c -o $@ $(CPPFLAGS) ../common/vscphelper.cpp + +.PHONY: all clean +### End DialogBlocks generated body Added: trunk/src/vscp/samples/testinterface/VCProjectDebug/canalsuperwrapper.obj =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug/canalsuperwrapper.obj ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/VCProjectDebug/dllwrapper.obj =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug/dllwrapper.obj ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/VCProjectDebug/guid.obj =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug/guid.obj ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/VCProjectDebug/testInterface.res =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug/testInterface.res ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.idb =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.idb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.obj =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.obj ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.pdb =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterface.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterfaceapp.obj =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug/testinterfaceapp.obj ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/VCProjectDebug/vscphelper.obj =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug/vscphelper.obj ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/VCProjectDebug/vscptcpif.obj =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/VCProjectDebug/vscptcpif.obj ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/delivery =================================================================== (Binary files differ) Property changes on: trunk/src/vscp/samples/testinterface/delivery ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/vscp/samples/testinterface/makefile.vc =================================================================== --- trunk/src/vscp/samples/testinterface/makefile.vc (rev 0) +++ trunk/src/vscp/samples/testinterface/makefile.vc 2008-04-15 10:08:59 UTC (rev 875) @@ -0,0 +1,152 @@ +### Begin DialogBlocks generated body +################################################################################ +# Makefile generated by DialogBlocks # +# +# Available configurations: +# debug +# release +# unicodedebug +# unicoderelease +################################################################################ + +CONFIG=debug + +# debug +!if "$(CONFIG)" == "debug" + +WXWIN=D:\wxWidgets-2.8.7 +CXX=cl.exe +RESCOMP=rc.exe +OUTPUTPATH=VCDebug +OBJECTPATH=VCDebug +BUILDPATHS=$(OBJECTPATH) +CPPFLAGS=/DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG +WARNINGFLAGS=/W4 +OPTFLAGS=/MDd /Od /GR /EHsc +DEBUGFLAGS=/Zi +LINKERFLAGS=/nologo /SUBSYSTEM:WINDOWS /machine:i386 /DEBUG +LIBS=wxmsw28d_richtext.lib wxmsw28d_aui.lib wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxmsw28d_adv.lib wxmsw28d_html.lib wxmsw28d_xrc.lib wxbase28d_net.lib wxbase28d_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib +CPPINC=/I"$(WXWIN)/include" /I"$(WXWIN)/contrib/include" /I"$(WXWIN)/lib/vc_lib/mswd" /I"D:\Program\Microsoft Visual Studio\vc98\include" +LIBPATH=/LIBPATH:"$(WXWIN)/lib/vc_lib" /LIBPATH:"D:\Program\Microsoft Visual Studio\vc98\lib" +RESPATH=/I "$(WXWIN)/include" /I "$(WXWIN)/contrib/include" /I "$(WXWIN)/lib/vc_lib/mswd" /I "D:\Program\Microsoft Visual Studio\vc98\include" +PROGRAM=testInterface.exe +RCFILEOBJ=testInterface.res +RCFILESRC=testInterface.rc +# release + +!elseif "$(CONFIG)" == "release" + +WXWIN=D:\wxWidgets-2.8.7 +CXX=cl.exe +RESCOMP=rc.exe +OUTPUTPATH=VCRelease +OBJECTPATH=VCRelease +BUILDPATHS=$(OBJECTPATH) +CPPFLAGS=/DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS +WARNINGFLAGS=/W4 +OPTFLAGS=/MD /O2 /GR /EHsc +DEBUGFLAGS= +LINKERFLAGS=/nologo /SUBSYSTEM:WINDOWS /machine:i386 +LIBS=wxmsw28_richtext.lib wxmsw28_aui.lib wxmsw28_core.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxmsw28_adv.lib wxmsw28_html.lib wxmsw28_xrc.lib wxbase28_net.lib wxbase28_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib +CPPINC=/I"$(WXWIN)/include" /I"$(WXWIN)/contrib/include" /I"$(WXWIN)/lib/vc_lib/msw" /I"D:\Program\Microsoft Visual Studio\vc98\include" +LIBPATH=/LIBPATH:"$(WXWIN)/lib/vc_lib" /LIBPATH:"D:\Program\Microsoft Visual Studio\vc98\lib" +RESPATH=/I "$(WXWIN)/include" /I "$(WXWIN)/contrib/include" /I "$(WXWIN)/lib/vc_lib/msw" /I "D:\Program\Microsoft Visual Studio\vc98\include" +PROGRAM=testInterface.exe +RCFILEOBJ=testInterface.res +RCFILESRC=testInterface.rc +# unicodedebug + +!elseif "$(CONFIG)" == "unicodedebug" + +WXWIN=D:\wxWidgets-2.8.7 +CXX=cl.exe +RESCOMP=rc.exe +OUTPUTPATH=VCUnicodeDebug +OBJECTPATH=VCUnicodeDebug +BUILDPATHS=$(OBJECTPATH) +CPPFLAGS=/DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /D_UNICODE +WARNINGFLAGS=/W4 +OPTFLAGS=/MDd /Od /GR /EHsc +DEBUGFLAGS=/Zi +LINKERFLAGS=/nologo /SUBSYSTEM:WINDOWS /machine:i386 /DEBUG +LIBS=wxmsw28ud_richtext.lib wxmsw28ud_aui.lib wxmsw28ud_core.lib wxbase28ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxmsw28ud_adv.lib wxmsw28ud_html.lib wxmsw28ud_xrc.lib wxbase28ud_net.lib wxbase28ud_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib +CPPINC=/I"$(WXWIN)/include" /I"$(WXWIN)/contrib/include" /I"$(WXWIN)/lib/vc_lib/mswud" /I"D:\Program\Microsoft Visual Studio\vc98\include" +LIBPATH=/LIBPATH:"$(WXWIN)/lib/vc_lib" /LIBPATH:"D:\Program\Microsoft Visual Studio\vc98\lib" +RESPATH=/I "$(WXWIN)/include" /I "$(WXWIN)/contrib/include" /I "$(WXWIN)/lib/vc_lib/mswud" /I "D:\Program\Microsoft Visual Studio\vc98\include" +PROGRAM=testInterface.exe +RCFILEOBJ=testInterface.res +RCFILESRC=testInterface.rc +# unicoderelease + +!else +WXWIN=D:\wxWidgets-2.8.7 +CXX=cl.exe +RESCOMP=rc.exe +OUTPUTPATH=VCUnicodeRelease +OBJECTPATH=VCUnicodeRelease +BUILDPATHS=$(OBJECTPATH) +CPPFLAGS=/DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D_UNICODE +WARNINGFLAGS=/W4 +OPTFLAGS=/MD /O2 /GR /EHsc +DEBUGFLAGS= +LINKERFLAGS=/nologo /SUBSYSTEM:WINDOWS /machine:i386 +LIBS=wxmsw28u_richtext.lib wxmsw28u_aui.lib wxmsw28u_core.lib wxbase28u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxmsw28u_adv.lib wxmsw28u_html.lib wxmsw28u_xrc.lib wxbase28u_net.lib wxbase28u_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib +CPPINC=/I"$(WXWIN)/include" /I"$(WXWIN)/contrib/include" /I"$(WXWIN)/lib/vc_lib/mswu" /I"D:\Program\Microsoft Visual Studio\vc98\include" +LIBPATH=/LIBPATH:"$(WXWIN)/lib/vc_lib" /LIBPATH:"D:\Program\Microsoft Visual Studio\vc98\lib" +RESPATH=/I "$(WXWIN)/include" /I "$(WXWIN)/contrib/include" /I "$(WXWIN)/lib/vc_lib/mswu" /I "D:\Program\Microsoft Visual Studio\vc98\include" +PROGRAM=testInterface.exe +RCFILEOBJ=testInterface.res +RCFILESRC=testInterface.rc +!endif + +OBJECTS=$(OBJECTPATH)\testinterfaceapp.obj $(OBJECTPATH)\testinterface.obj $(OBJECTPATH)\canalsuperwrapper.obj $(OBJECTPATH)\crc.obj $(OBJECTPATH)\dllwrapper.obj $(OBJECTPATH)\guid.obj $(OBJECTPATH)\vscphelper.obj $(OBJECTPATH)\vscptcpif.obj $(OBJECTPATH)\$(RCFILEOBJ) + +all: $(BUILDPATHS) $(OUTPUTPATH)\$(PROGRAM) + +$(OBJECTPATH): + -if not exist $(OBJECTPATH) mkdir $(OBJECTPATH) + +clean: + -if exist $(OBJECTPATH)\*.obj del $(OBJECTPATH)\*.obj + -if exist $(OBJECTPATH)\*.res del $(OBJECTPATH)\*.res + -if exist $(OUTPUTPATH)\$(PROGRAM) del $(OUTPUTPATH)\$(PROGRAM) + -if exist $(OUTPUTPATH)\testInterface.ilk del $(OUTPUTPATH)\testInterface.ilk + -if exist $(OUTPUTPATH)\testInterface.pdb del $(OUTPUTPATH)\testInterface.pdb + +help: + @echo "Usage: make -f makefile.vc CONFIG=[debug|release|unicodedebug|unicoderelease] [all|clean|help]" + +$(OUTPUTPATH)\$(PROGRAM): $(OBJECTS) + @echo link /OUT:$@ $(LIBPATH) $(LINKERFLAGS) $(OBJECTS) $(LIBS) + link /OUT:$@ $(LIBPATH) $(LINKERFLAGS) @<< + $(OBJECTS) $(LIBS) +<< + +$(OBJECTPATH)\$(RCFILEOBJ): $(RCFILESRC) + $(RESCOMP) /fo$@ $(CPPFLAGS) $(RESPATH) $** + +$(OBJECTPATH)\testinterfaceapp.obj: testinterfaceapp.cpp testinterfaceapp.h testinterface.h ..\..\common\vscptcpif.h ..\..\common\canal.h ..\..\common\vscp.h ..\..\common\vscp_classes.h ..\..\common\vscp_types.h ..\..\..\common\crc.h ..\..\common\vscphelper.h + $(CXX) /c /nologo /TP /Fo$@ $(CPPFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) $(CPPINC) testinterfaceapp.cpp + +$(OBJECTPATH)\testinterface.obj: testinterface.cpp testinterface.h ..\..\common\vscptcpif.h ..\..\common\canal.h ..\..\common\vscp.h ..\..\common\vscp_classes.h ..\..\common\vscp_types.h ..\..\..\common\crc.h ..\..\common\vscphelper.h + $(CXX) /c /nologo /TP /Fo$@ $(CPPFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) $(CPPINC) testinterface.cpp + +$(OBJECTPATH)\canalsuperwrapper.obj: ..\..\common\canalsuperwrapper.cpp ..\..\common\vscp.h ..\..\common\vscp_classes.h ..\..\common\vscp_types.h ..\..\common\canal.h ..\..\..\common\crc.h ..\..\common\canalsuperwrapper.h ..\..\common\dllwrapper.h ..\..\common\canaldlldef.h ..\..\common\vscptcpif.h ..\..\common\vscphelper.h ..\..\common\guid.h ..\..\..\common\dllist.h ..\..\common\devitem.h + $(CXX) /c /nologo /TP /Fo$@ $(CPPFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) $(CPPINC) ..\..\common\canalsuperwrapper.cpp + +$(OBJECTPATH)\crc.obj: ..\..\..\common\crc.c ..\..\..\common\crc.h + $(CXX) /c /nologo /TP /Fo$@ $(CPPFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) $(CPPINC) ..\..\..\common\crc.c + +$(OBJECTPATH)\dllwrapper.obj: ..\..\common\dllwrapper.cpp ..\..\common\dllwrapper.h ..\..\common\canaldlldef.h ..\..\common\canal.h + $(CXX) /c /nologo /TP /Fo$@ $(CPPFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) $(CPPINC) ..\..\common\dllwrapper.cpp + +$(OBJECTPATH)\guid.obj: ..\..\common\guid.cpp ..\..\common\guid.h ..\..\common\vscp.h ..\..\common\vscp_classes.h ..\..\common\vscp_types.h ..\..\common\canal.h ..\..\..\common\crc.h + $(CXX) /c /nologo /TP /Fo$@ $(CPPFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) $(CPPINC) ..\..\common\guid.cpp + +$(OBJECTPATH)\vscphelper.obj: ..\..\common\vscphelper.cpp ..\..\common\vscp.h ..\..\common\vscp_classes.h ..\..\common\vscp_types.h ..\..\common\canal.h ..\..\..\common\crc.h ..\..\common\vscphelper.h + $(CXX) /c /nologo /TP /Fo$@ $(CPPFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) $(CPPINC) ..\..\common\vscphelper.cpp + +$(OBJECTPATH)\vscptcpif.obj: ..\..\common\vscptcpif.cpp ..\..\common\canal_macro.h ..\..\common\canal_win32_ipc.h ..\..\common\canal.h ..\..\common\vscptcpif.h ..\..\common\vscp.h ..\..\common\vscp_classes.h ..\..\common\vscp_types.h ..\..\..\common\crc.h ..\..\common\vscphelper.h + $(CXX) /c /nologo /TP /Fo$@ $(CPPFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) $(CPPINC) ..\..\common\vscptcpif.cpp + +### End DialogBlocks generated body Added: trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd =================================================================== --- trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd (rev 0) +++ trunk/src/vscp/samples/testinterface/testInterface-autosave.pjd 2008-04-15 10:08:59 UTC (rev 875) @@ -0,0 +1,1858 @@ +<?xml version="1.0" encoding="UTF-8"?> +<anthemion-project version="1.0.0.0" xmlns="http://www.anthemion.co.uk"> + <header> + <long name="name_counter">0</long> + <string name="html_path">""</string> + <string name="title">""</string> + <string name="author">""</string> + <string name="description">""</string> + <string name="xrc_filename">""</string> + <bool name="convert_images_to_xpm">0</bool> + <bool name="inline_images">0</bool> + <bool name="generate_cpp_for_xrc">0</bool> + <long name="working_mode">1</long> + <bool name="use_help_text_for_tooltips">1</bool> + <bool name="translate_strings">1</bool> + <bool name="make_unicode_strings">1</bool> + <bool name="extract_strings">0</bool> + <string name="user_name">"Ake Hedman"</string> + <string name="copyright_string">"(c) 2008 Ake Hedman, D of Scandinavia"</string> + <string name="resource_prefix">""</string> + <bool name="use_two_step_construction">0</bool> + <bool name="use_enums">0</bool> + <string name="current_platform">"<All platforms>"</string> + <string name="target_wx_version">"2.8.7"</string> + <string name="cpp_header_comment">"///////////////////////////////////////////////////////////////////////////// +// Name: %HEADER-FILENAME% +// Purpose: +// Author: %AUTHOR% +// Modified by: +// Created: %DATE% +// RCS-ID: +// Copyright: %COPYRIGHT% +// Licence: +///////////////////////////////////////////////////////////////////////////// + +"</string> + <string name="cpp_implementation_comment">"///////////////////////////////////////////////////////////////////////////// +// Name: %SOURCE-FILENAME% +// Purpose: +// Author: %AUTHOR% +// Modified by: +// Created: %DATE% +// RCS-ID: +// Copyright: %COPYRIGHT% +// Licence: +///////////////////////////////////////////////////////////////////////////// + +"</string> + <string name="cpp_symbols_file_comment">"///////////////////////////////////////////////////////////////////////////// +// Name: %SYMBOLS-FILENAME% +// Purpose: Symbols file +// Author: %AUTHOR% +// Modified by: +// Created: %DATE% +// RCS-ID: +// Copyright: %COPYRIGHT% +// Licence: +///////////////////////////////////////////////////////////////////////////// + +"</string> + <string name="cpp_header_preamble">""</string> + <string name="cpp_implementation_preamble">"// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +"</string> + <string name="cpp_function_declaration_comment">" /// %BODY% +"</string> + <string name="cpp_function_implementation_comment">" +/*! + * %BODY% + */ + +"</string> + <string name="resource_file_header">"app_resources.h"</string> + <string name="resource_file_implementation">"app_resources.cpp"</string> + <string name="resource_class_name">"AppResources"</string> + <string name="app_file_header">"app.h"</string> + <string name="app_file_implementation">"app.cpp"</string> + <string name="app_class_name">"Application"</string> + <bool name="generate_app_class">0</bool> + <string name="external_symbol_filenames">""</string> + <string name="configuration">"VC++ Unicode Debug"</string> + <string name="source_encoding">"iso-8859-1"</string> + <string name="xrc_encoding">"utf-8"</string> + <string name="project_encoding">"utf-8"</string> + <string name="resource_archive">""</string> + <long name="text_file_type">0</long> + <bool name="use_tabs">0</bool> + <long name="indent_size">4</long> + <string name="whitespace_after_return_type">" "</string> + <string name="resource_xrc_cpp">""</string> + <bool name="use_resource_archive">0</bool> + <bool name="use_generated_xrc_cpp">0</bool> + <bool name="always_generate_xrc">1</bool> + <bool name="use_id_name_for_name">0</bool> + <bool name="archive_xrc_files">1</bool> + <bool name="archive_image_files">1</bool> + <bool name="archive_all_image_files">0</bool> + <bool name="xrc_retain_relative_paths">1</bool> + <bool name="xrc_generate_id_tags">0</bool> + </header> + <data> + <document> + <string name="title">""</string> + <string name="type">"data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <document> + <string name="title">"Configurations"</string> + <string name="type">"config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="template-name">""</string> + <bool name="dirty">1</bool> + <long name="makefile-last-written">-8519680</long> + <string name="Compiler name">""</string> + <string name="Build mode">"Debug"</string> + <string name="Unicode mode">"ANSI"</string> + <string name="Shared mode">"Static"</string> + <string name="Modularity">"Modular"</string> + <string name="GUI mode">"GUI"</string> + <string name="Toolkit">"wxMSW"</string> + <string name="Runtime linking">"Dynamic"</string> + <string name="Use exceptions">"Yes"</string> + <string name="Use ODBC">"No"</string> + <string name="Use OpenGL">"No"</string> + <string name="wxWidgets version">"%WXVERSION%"</string> + <string name="Executable name">"%EXECUTABLE%"</string> + <string name="Program arguments">""</string> + <string name="Working path">"%AUTO%"</string> + <string name="Output path">"%AUTO%"</string> + <string name="Objects path">"%AUTO%"</string> + <string name="Compiler location">"%AUTO%"</string> + <string name="wxWidgets location">"%AUTO%"</string> + <string name="C++ command">"%AUTO%"</string> + <string name="Resource compiler">"%AUTO%"</string> + <string name="Make command">"%AUTO%"</string> + <string name="Project makefile">"%AUTO%"</string> + <string name="wxWidgets makefile">"%AUTO%"</string> + <string name="Compiler bin path">"%AUTO%"</string> + <string name="Compiler include path">"%AUTO%"</string> + <string name="Compiler lib path">"%AUTO%"</string> + <string name="Preprocessor flags">"%AUTO%"</string> + <string name="Optimizations">"%AUTO%"</string> + <string name="Warnings">"%AUTO%"</string> + <string name="Debug flags">"%AUTO%"</string> + <string name="Libraries">"%AUTO%"</string> + <string name="Library path">"%AUTO%"</string> + <string name="Linker flags">"%AUTO%"</string> + <string name="Include path">"%AUTO%"</string> + <string name="Resource flags">"%AUTO%"</string> + <string name="Resource path">"%AUTO%"</string> + <string name="wxWidgets build path">"%AUTO%"</string> + <string name="wxWidgets build command">"%AUTO%"</string> + <string name="wxWidgets clean command">"%AUTO%"</string> + <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <document> + <string name="title">"VC++ Project Release"</string> + <string name="type">"vc-project-config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="template-name">"VC++ Project"</string> + <bool name="dirty">1</bool> + <long name="makefile-last-written">-8519680</long> + <string name="Compiler name">"VC++ Project"</string> + <string name="Build mode">"Release"</string> + <string name="Unicode mode">"Unicode"</string> + <string name="Shared mode">"Static"</string> + <string name="Modularity">"Modular"</string> + <string name="GUI mode">"GUI"</string> + <string name="Toolkit">"wxMSW"</string> + <string name="Runtime linking">"Dynamic"</string> + <string name="Use exceptions">"Yes"</string> + <string name="Use ODBC">"No"</string> + <string name="Use OpenGL">"No"</string> + <string name="Compiler version">"6"</string> + <string name="wxWidgets version">"%WXVERSION%"</string> + <string name="Executable name">"%EXECUTABLE%"</string> + <string name="Program arguments">""</string> + <string name="Working path">"%AUTO%"</string> + <string name="Output path">"%AUTO%"</string> + <string name="Objects path">"%AUTO%"</string> + <string name="Compiler location">"%AUTO%"</string> + <string name="wxWidgets location">"%AUTO%"</string> + <string name="C++ command">"%AUTO%"</string> + <string name="Resource compiler">"%AUTO%"</string> + <string name="Make command">"%AUTO%"</string> + <string name="Project makefile">"%AUTO%"</string> + <string name="wxWidgets makefile">"%AUTO%"</string> + <string name="Compiler bin path">"%AUTO%"</string> + <string name="Compiler include path">"%AUTO%"</string> + <string name="Compiler lib path">"%AUTO%"</string> + <string name="Preprocessor flags">"%AUTO%"</string> + <string name="Optimizations">"%AUTO%"</string> + <string name="Warnings">"%AUTO%"</string> + <string name="Debug flags">"%AUTO%"</string> + <string name="Libraries">"%AUTO%"</string> + <string name="Library path">"%AUTO%"</string> + <string name="Linker flags">"%AUTO%"</string> + <string name="Include path">"%AUTO%"</string> + <string name="Resource flags">"%AUTO%"</string> + <string name="Resource path">"%AUTO%"</string> + <string name="wxWidgets build path">"%AUTO%"</string> + <string name="wxWidgets build command">"%AUTO%"</string> + <string name="wxWidgets clean command">"%AUTO%"</string> + <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="Project make command">"%AUTO%"</string> + <string name="Project build command">"%AUTO%"</string> + <string name="Project rebuild command">"%AUTO%"</string> + <string name="Project clean command">"%AUTO%"</string> + <string name="Project debug command">"%AUTO%"</string> + <string name="Pre-build command">"%AUTO%"</string> + <string name="Post-build command">"%AUTO%"</string> + <string name="Pre-link command">"%AUTO%"</string> + <string name="CFG">""</string> + </document> + <document> + <string name="title">"VC++ Project Debug"</string> + <string name="type">"vc-project-config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="template-name">"VC++ Project"</string> + <bool name="dirty">1</bool> + <long name="makefile-last-written">-8519680</long> + <string name="Compiler name">"VC++ Project"</string> + <string name="Build mode">"Debug"</string> + <string name="Unicode mode">"Unicode"</string> + <string name="Shared mode">"Static"</string> + <string name="Modularity">"Modular"</string> + <string name="GUI mode">"GUI"</string> + <string name="Toolkit">"wxMSW"</string> + <string name="Runtime linking">"Dynamic"</string> + <string name="Use exceptions">"Yes"</string> + <string name="Use ODBC">"No"</string> + <string name="Use OpenGL">"No"</string> + <string name="Compiler version">"6"</string> + <string name="wxWidgets version">"%WXVERSION%"</string> + <string name="Executable name">"%EXECUTABLE%"</string> + <string name="Program arguments">""</string> + <string name="Working path">"%AUTO%"</string> + <string name="Output path">"%AUTO%"</string> + <string name="Objects path">"%AUTO%"</string> + <string name="Compiler location">"%AUTO%"</string> + <string name="wxWidgets location">"%AUTO%"</string> + <string name="C++ command">"%AUTO%"</string> + <string name="Resource compiler">"%AUTO%"</string> + <string name="Make command">"%AUTO%"</string> + <string name="Project makefile">"%AUTO%"</string> + <string name="wxWidgets makefile">"%AUTO%"</string> + <string name="Compiler bin path">"%AUTO%"</string> + <string name="Compiler include path">"%AUTO%"</string> + <string name="Compiler lib path">"%AUTO%"</string> + <string name="Preprocessor flags">"%AUTO%"</string> + <string name="Optimizations">"%AUTO%"</string> + <string name="Warnings">"%AUTO%"</string> + <string name="Debug flags">"%AUTO%"</string> + <string name="Libraries">"%AUTO%"</string> + <string name="Library path">"%AUTO%"</string> + <string name="Linker flags">"%AUTO%"</string> + <string name="Include path">"%AUTO%"</string> + <string name="Resource flags">"%AUTO%"</string> + <string name="Resource path">"%AUTO%"</string> + <string name="wxWidgets build path">"%AUTO%"</string> + <string name="wxWidgets build command">"%AUTO%"</string> + <string name="wxWidgets clean command">"%AUTO%"</string> + <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="Project make command">"%AUTO%"</string> + <string name="Project build command">"%AUTO%"</string> + <string name="Project rebuild command">"%AUTO%"</string> + <string name="Project clean command">"%AUTO%"</string> + <string name="Project debug command">"%AUTO%"</string> + <string name="Pre-build command">"%AUTO%"</string> + <string name="Post-build command">"%AUTO%"</string> + <string name="Pre-link command">"%AUTO%"</string> + <string name="CFG">""</string> + </document> + <document> + <string name="title">"GCC Release"</string> + <string name="type">"gcc-config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="template-name">"GCC"</string> + <bool name="dirty">1</bool> + <long name="makefile-last-written">-8519680</long> + <string name="Compiler name">"GCC"</string> + <string name="Build mode">"Release"</string> + <string name="Unicode mode">"Unicode"</string> + <string name="Shared mode">"Static"</string> + <string name="Modularity">"Modular"</string> + <string name="GUI mode">"GUI"</string> + <string name="Toolkit">"wxMSW"</string> + <string name="Runtime linking">"Dynamic"</string> + <string name="Use exceptions">"Yes"</string> + <string name="Use ODBC">"No"</string> + <string name="Use OpenGL">"No"</string> + <string name="Use wx-config">"Yes"</string> + <string name="Use installed wxWidgets">"No"</string> + <string name="Enable universal binaries">"No"</string> + <string name="wxWidgets version">"%WXVERSION%"</string> + <string name="Executable name">"%EXECUTABLE%"</string> + <string name="Program arguments">""</string> + <string name="Working path">"%AUTO%"</string> + <string name="Output path">"%AUTO%"</string> + <string name="Objects path">"%AUTO%"</string> + <string name="Compiler location">"%AUTO%"</string> + <string name="wxWidgets location">"%AUTO%"</string> + <string name="C++ command">"%AUTO%"</string> + <string name="Resource compiler">"%AUTO%"</string> + <string name="Make command">"%AUTO%"</string> + <string name="Project makefile">"%AUTO%"</string> + <string name="wxWidgets makefile">"%AUTO%"</string> + <string name="Compiler bin path">"%AUTO%"</string> + <string name="Compiler include path">"%AUTO%"</string> + <string name="Compiler lib path">"%AUTO%"</string> + <string name="Preprocessor flags">"%AUTO%"</string> + <string name="Optimizations">"%AUTO%"</string> + <string name="Warnings">"%AUTO%"</string> + <string name="Debug flags">"%AUTO%"</string> + <string name="Libraries">"%AUTO%"</string> + <string name="Library path">"%AUTO%"</string> + <string name="Linker flags">"%AUTO%"</string> + <string name="Include path">"%AUTO%"</string> + <string name="Resource flags">"%AUTO%"</string> + <string name="Resource path">"%AUTO%"</string> + <string name="wxWidgets build path">"%AUTO%"</string> + <string name="wxWidgets build command">"%AUTO%"</string> + <string name="wxWidgets clean command">"%AUTO%"</string> + <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> + </document> + <document> + <string name="title">"GCC Debug"</string> + <string name="type">"gcc-config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="template-name">"GCC"</string> + <bool name="dirty">1</bool> + <long name="makefile-last-written">-8519680</long> + <string name="Compiler name">"GCC"</string> + <string name="Build mode">"Debug"</string> + <string name="Unicode mode">"Unicode"</string> + <string name="Shared mode">"Static"</string> + <string name="Modularity">"Modular"</string> + <string name="GUI mode">"GUI"</string> + <string name="Toolkit">"wxMSW"</string> + <string name="Runtime linking">"Dynamic"</string> + <string name="Use exceptions">"Yes"</string> + <string name="Use ODBC">"No"</string> + <string name="Use OpenGL">"No"</string> + <string name="Use wx-config">"Yes"</string> + <string name="Use installed wxWidgets">"No"</string> + <string name="Enable universal binaries">"No"</string> + <string name="wxWidgets version">"%WXVERSION%"</string> + <string name="Executable name">"%EXECUTABLE%"</string> + <string name="Program arguments">""</string> + <string name="Working path">"%AUTO%"</string> + <string name="Output path">"%AUTO%"</string> + <string name="Objects path">"%AUTO%"</string> + <string name="Compiler location">"%AUTO%"</string> + <string name="wxWidgets location">"%AUTO%"</string> + <string name="C++ command">"%AUTO%"</string> + <string name="Resource compiler">"%AUTO%"</string> + <string name="Make command">"%AUTO%"</string> + <string name="Project makefile">"%AUTO%"</string> + <string name="wxWidgets makefile">"%AUTO%"</string> + <string name="Compiler bin path">"%AUTO%"</string> + <string name="Compiler include path">"%AUTO%"</string> + <string name="Compiler lib path">"%AUTO%"</string> + <string name="Preprocessor flags">"%AUTO%"</string> + <string name="Optimizations">"%AUTO%"</string> + <string name="Warnings">"%AUTO%"</string> + <string name="Debug flags">"%AUTO%"</string> + <string name="Libraries">"%AUTO%"</string> + <string name="Library path">"%AUTO%"</string> + <string name="Linker flags">"%AUTO%"</string> + <string name="Include path">"%AUTO%"</string> + <string name="Resource flags">"%AUTO%"</string> + <string name="Resource path">"%AUTO%"</string> + <string name="wxWidgets build path">"%AUTO%"</string> + <string name="wxWidgets build command">"%AUTO%"</string> + <string name="wxWidgets clean command">"%AUTO%"</string> + <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> + </document> + <document> + <string name="title">"GCC Unicode Debug"</string> + <string name="type">"gcc-config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="template-name">"GCC"</string> + <bool name="dirty">1</bool> + <long name="makefile-last-written">-8519680</long> + <string name="Compiler name">"GCC"</string> + <string name="Build mode">"Debug"</string> + <string name="Unicode mode">"Unicode"</string> + <string name="Shared mode">"Static"</string> + <string name="Modularity">"Modular"</string> + <string name="GUI mode">"GUI"</string> + <string name="Toolkit">"wxMSW"</string> + <string name="Runtime linking">"Dynamic"</string> + <string name="Use exceptions">"Yes"</string> + <string name="Use ODBC">"No"</string> + <string name="Use OpenGL">"No"</string> + <string name="Use wx-config">"Yes"</string> + <string name="Use installed wxWidgets">"No"</string> + <string name="Enable universal binaries">"No"</string> + <string name="wxWidgets version">"%WXVERSION%"</string> + <string name="Executable name">"%EXECUTABLE%"</string> + <string name="Program arguments">""</string> + <string name="Working path">"%AUTO%"</string> + <string name="Output path">"%AUTO%"</string> + <string name="Objects path">"%AUTO%"</string> + <string name="Compiler location">"%AUTO%"</string> + <string name="wxWidgets location">"%AUTO%"</string> + <string name="C++ command">"%AUTO%"</string> + <string name="Resource compiler">"%AUTO%"</string> + <string name="Make command">"%AUTO%"</string> + <string name="Project makefile">"%AUTO%"</string> + <string name="wxWidgets makefile">"%AUTO%"</string> + <string name="Compiler bin path">"%AUTO%"</string> + <string name="Compiler include path">"%AUTO%"</string> + <string name="Compiler lib path">"%AUTO%"</string> + <string name="Preprocessor flags">"%AUTO%"</string> + <string name="Optimizations">"%AUTO%"</string> + <string name="Warnings">"%AUTO%"</string> + <string name="Debug flags">"%AUTO%"</string> + <string name="Libraries">"%AUTO%"</string> + <string name="Library path">"%AUTO%"</string> + <string name="Linker flags">"%AUTO%"</string> + <string name="Include path">"%AUTO%"</string> + <string name="Resource flags">"%AUTO%"</string> + <string name="Resource path">"%AUTO%"</string> + <string name="wxWidgets build path">"%AUTO%"</string> + <string name="wxWidgets build command">"%AUTO%"</string> + <string name="wxWidgets clean command">"%AUTO%"</string> + <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> + </document> + <document> + <string name="title">"GCC Unicode Release"</string> + <string name="type">"gcc-config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="template-name">"GCC"</string> + <bool name="dirty">1</bool> + <long name="makefile-last-written">-8519680</long> + <string name="Compiler name">"GCC"</string> + <string name="Build mode">"Release"</string> + <string name="Unicode mode">"Unicode"</string> + <string name="Shared mode">"Static"</string> + <string name="Modularity">"Modular"</string> + <string name="GUI mode">"GUI"</string> + <string name="Toolkit">"wxMSW"</string> + <string name="Runtime linking">"Dynamic"</string> + <string name="Use exceptions">"Yes"</string> + <string name="Use ODBC">"No"</string> + <string name="Use OpenGL">"No"</string> + <string name="Use wx-config">"Yes"</string> + <string name="Use installed wxWidgets">"No"</string> + <string name="Enable universal binaries">"No"</string> + <string name="wxWidgets version">"%WXVERSION%"</string> + <string name="Executable name">"%EXECUTABLE%"</string> + <string name="Program arguments">""</string> + <string name="Working path">"%AUTO%"</string> + <string name="Output path">"%AUTO%"</string> + <string name="Objects path">"%AUTO%"</string> + <string name="Compiler location">"%AUTO%"</string> + <string name="wxWidgets location">"%AUTO%"</string> + <string name="C++ command">"%AUTO%"</string> + <string name="Resource compiler">"%AUTO%"</string> + <string name="Make command">"%AUTO%"</string> + <string name="Project makefile">"%AUTO%"</string> + <string name="wxWidgets makefile">"%AUTO%"</string> + <string name="Compiler bin path">"%AUTO%"</string> + <string name="Compiler include path">"%AUTO%"</string> + <string name="Compiler lib path">"%AUTO%"</string> + <string name="Preprocessor flags">"%AUTO%"</string> + <string name="Optimizations">"%AUTO%"</string> + <string name="Warnings">"%AUTO%"</string> + <string name="Debug flags">"%AUTO%"</string> + <string name="Libraries">"%AUTO%"</string> + <string name="Library path">"%AUTO%"</string> + <string name="Linker flags">"%AUTO%"</string> + <string name="Include path">"%AUTO%"</string> + <string name="Resource flags">"%AUTO%"</string> + <string name="Resource path">"%AUTO%"</string> + <string name="wxWidgets build path">"%AUTO%"</string> + <string name="wxWidgets build command">"%AUTO%"</string> + <string name="wxWidgets clean command">"%AUTO%"</string> + <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="Command for wx-config">"%AUTO%"</string> + <string name="SDK path">"%AUTO%"</string> + <string name="Minimum OS version">"%AUTO%"</string> + <string name="Info.plist location">"%AUTO%"</string> + <string name="Icns location">"%AUTO%"</string> + </document> + <document> + <string name="title">"VC++ Debug"</string> + <string name="type">"vc-config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="template-name">"VC++"</string> + <bool name="dirty">0</bool> + <long name="makefile-last-written">-8519680</long> + <string name="Compiler name">"VC++"</string> + <string name="Build mode">"Debug"</string> + <string name="Unicode mode">"ANSI"</string> + <string name="Shared mode">"Static"</string> + <string name="Modularity">"Modular"</string> + <string name="GUI mode">"GUI"</string> + <string name="Toolkit">"wxMSW"</string> + <string name="Runtime linking">"Dynamic"</string> + <string name="Use exceptions">"Yes"</string> + <string name="Use ODBC">"No"</string> + <string name="Use OpenGL">"No"</string> + <string name="wxWidgets version">"%WXVERSION%"</string> + <string name="Executable name">"%EXECUTABLE%"</string> + <string name="Program arguments">""</string> + <string name="Working path">"%AUTO%"</string> + <string name="Output path">"%AUTO%"</string> + <string name="Objects path">"%AUTO%"</string> + <string name="Compiler location">"%AUTO%"</string> + <string name="wxWidgets location">"%AUTO%"</string> + <string name="C++ command">"%AUTO%"</string> + <string name="Resource compiler">"%AUTO%"</string> + <string name="Make command">"%AUTO%"</string> + <string name="Project makefile">"%AUTO%"</string> + <string name="wxWidgets makefile">"%AUTO%"</string> + <string name="Compiler bin path">"%AUTO%"</string> + <string name="Compiler include path">"%AUTO%"</string> + <string name="Compiler lib path">"%AUTO%"</string> + <string name="Preprocessor flags">"%AUTO%"</string> + <string name="Optimizations">"%AUTO%"</string> + <string name="Warnings">"%AUTO%"</string> + <string name="Debug flags">"%AUTO%"</string> + <string name="Libraries">"%AUTO%"</string> + <string name="Library path">"%AUTO%"</string> + <string name="Linker flags">"%AUTO%"</string> + <string name="Include path">"%AUTO%"</string> + <string name="Resource flags">"%AUTO%"</string> + <string name="Resource path">"%AUTO%"</string> + <string name="wxWidgets build path">"%AUTO%"</string> + <string name="wxWidgets build command">"%AUTO%"</string> + <string name="wxWidgets clean command">"%AUTO%"</string> + <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="CFG">""</string> + </document> + <document> + <string name="title">"VC++ Release"</string> + <string name="type">"vc-config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="template-name">"VC++"</string> + <bool name="dirty">0</bool> + <long name="makefile-last-written">-8519680</long> + <string name="Compiler name">"VC++"</string> + <string name="Build mode">"Release"</string> + <string name="Unicode mode">"ANSI"</string> + <string name="Shared mode">"Static"</string> + <string name="Modularity">"Modular"</string> + <string name="GUI mode">"GUI"</string> + <string name="Toolkit">"wxMSW"</string> + <string name="Runtime linking">"Dynamic"</string> + <string name="Use exceptions">"Yes"</string> + <string name="Use ODBC">"No"</string> + <string name="Use OpenGL">"No"</string> + <string name="wxWidgets version">"%WXVERSION%"</string> + <string name="Executable name">"%EXECUTABLE%"</string> + <string name="Program arguments">""</string> + <string name="Working path">"%AUTO%"</string> + <string name="Output path">"%AUTO%"</string> + <string name="Objects path">"%AUTO%"</string> + <string name="Compiler location">"%AUTO%"</string> + <string name="wxWidgets location">"%AUTO%"</string> + <string name="C++ command">"%AUTO%"</string> + <string name="Resource compiler">"%AUTO%"</string> + <string name="Make command">"%AUTO%"</string> + <string name="Project makefile">"%AUTO%"</string> + <string name="wxWidgets makefile">"%AUTO%"</string> + <string name="Compiler bin path">"%AUTO%"</string> + <string name="Compiler include path">"%AUTO%"</string> + <string name="Compiler lib path">"%AUTO%"</string> + <string name="Preprocessor flags">"%AUTO%"</string> + <string name="Optimizations">"%AUTO%"</string> + <string name="Warnings">"%AUTO%"</string> + <string name="Debug flags">"%AUTO%"</string> + <string name="Libraries">"%AUTO%"</string> + <string name="Library path">"%AUTO%"</string> + <string name="Linker flags">"%AUTO%"</string> + <string name="Include path">"%AUTO%"</string> + <string name="Resource flags">"%AUTO%"</string> + <string name="Resource path">"%AUTO%"</string> + <string name="wxWidgets build path">"%AUTO%"</string> + <string name="wxWidgets build command">"%AUTO%"</string> + <string name="wxWidgets clean command">"%AUTO%"</string> + <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="CFG">""</string> + </document> + <document> + <string name="title">"VC++ Unicode Debug"</string> + <string name="type">"vc-config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="template-name">"VC++"</string> + <bool name="dirty">0</bool> + <long name="makefile-last-written">-8519680</long> + <string name="Compiler name">"VC++"</string> + <string name="Build mode">"Debug"</string> + <string name="Unicode mode">"Unicode"</string> + <string name="Shared mode">"Static"</string> + <string name="Modularity">"Modular"</string> + <string name="GUI mode">"GUI"</string> + <string name="Toolkit">"wxMSW"</string> + <string name="Runtime linking">"Dynamic"</string> + <string name="Use exceptions">"Yes"</string> + <string name="Use ODBC">"No"</string> + <string name="Use OpenGL">"No"</string> + <string name="wxWidgets version">"%WXVERSION%"</string> + <string name="Executable name">"%EXECUTABLE%"</string> + <string name="Program arguments">""</string> + <string name="Working path">"%AUTO%"</string> + <string name="Output path">"%AUTO%"</string> + <string name="Objects path">"%AUTO%"</string> + <string name="Compiler location">"%AUTO%"</string> + <string name="wxWidgets location">"%AUTO%"</string> + <string name="C++ command">"%AUTO%"</string> + <string name="Resource compiler">"%AUTO%"</string> + <string name="Make command">"%AUTO%"</string> + <string name="Project makefile">"%AUTO%"</string> + <string name="wxWidgets makefile">"%AUTO%"</string> + <string name="Compiler bin path">"%AUTO%"</string> + <string name="Compiler include path">"%AUTO%"</string> + <string name="Compiler lib path">"%AUTO%"</string> + <string name="Preprocessor flags">"%AUTO%"</string> + <string name="Optimizations">"%AUTO%"</string> + <string name="Warnings">"%AUTO%"</string> + <string name="Debug flags">"%AUTO%"</string> + <string name="Libraries">"%AUTO%"</string> + <string name="Library path">"%AUTO%"</string> + <string name="Linker flags">"%AUTO%"</string> + <string name="Include path">"%AUTO%"</string> + <string name="Resource flags">"%AUTO%"</string> + <string name="Resource path">"%AUTO%"</string> + <string name="wxWidgets build path">"%AUTO%"</string> + <string name="wxWidgets build command">"%AUTO%"</string> + <string name="wxWidgets clean command">"%AUTO%"</string> + <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="CFG">""</string> + </document> + <document> + <string name="title">"VC++ Unicode Release"</string> + <string name="type">"vc-config-data-document"</string> + <string name="filename">""</string> + <string name="icon-name">""</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name... [truncated message content] |
From: <ak...@us...> - 2008-04-14 20:56:42
|
Revision: 874 http://can.svn.sourceforge.net/can/?rev=874&view=rev Author: akhe Date: 2008-04-14 13:56:11 -0700 (Mon, 14 Apr 2008) Log Message: ----------- Added description for debian build problem Changed required version fro wxWidgets to 2.8.0 instead of 2.6.0 Modified Paths: -------------- trunk/INSTALL trunk/configure.in trunk/m4/Makefile trunk/src/vscp/common/canal.h trunk/src/vscp/linuxvscpl1/Makefile Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2008-04-13 15:49:02 UTC (rev 873) +++ trunk/INSTALL 2008-04-14 20:56:11 UTC (rev 874) @@ -33,6 +33,10 @@ Solution: On Ubuntu at least install libssl-dev +Complains ‘class wxXmlNode’ has no member named ‘GetNodeContent’ +================================================================ +You ned wxWidgets 2.8.0 or newer. + --------------------------------------------------------------------- Compile errors when issuing Make. This can be due to many things. One cause is tht the wxBase version of the wxWidgets library is used instead of the full library (wxGTK2 library). You can check if this is the cause of the failure by looking in src/canal/cancmd/Makefile. The Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2008-04-13 15:49:02 UTC (rev 873) +++ trunk/configure.in 2008-04-14 20:56:11 UTC (rev 874) @@ -147,9 +147,9 @@ AC_PATH_PROG( WX_CONFIG, ${WXWINDOWS_NAME}, no, ${WXWINDOWS_PATH} ) if test "${WX_CONFIG}" != "no" -a "${CXX}" != "" then -if expr 2.6.0 \> `${WX_CONFIG} --version` >/dev/null +if expr 2.8.0 \> `${WX_CONFIG} --version` >/dev/null then - AC_MSG_ERROR([Your development package for wxWindows is too old, you need at least version 2.6.0. Please upgrade and try again.]) + AC_MSG_ERROR([Your development package for wxWindows is too old, you need at least version 2.8.0. Please upgrade and try again.]) fi Modified: trunk/m4/Makefile =================================================================== --- trunk/m4/Makefile 2008-04-13 15:49:02 UTC (rev 873) +++ trunk/m4/Makefile 2008-04-14 20:56:11 UTC (rev 874) @@ -13,7 +13,7 @@ # PARTICULAR PURPOSE. -SHELL = /bin/bash +SHELL = /bin/sh srcdir = . top_srcdir = .. @@ -80,12 +80,12 @@ STRIP = @STRIP@ VERSION = @VERSION@ WXLIBS = -WX_CONFIG = /usr/local/bin/wx-config +WX_CONFIG = /usr/bin/wx-config YACC = yacc am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ -top_wxbuilddir = /usr/local +top_wxbuilddir = /usr NULL = EXTRA_DIST = \ Modified: trunk/src/vscp/common/canal.h =================================================================== --- trunk/src/vscp/common/canal.h 2008-04-13 15:49:02 UTC (rev 873) +++ trunk/src/vscp/common/canal.h 2008-04-14 20:56:11 UTC (rev 874) @@ -152,8 +152,10 @@ typedef canalStatus * PCANALSTATUS; -// This is the define for the received callback method +// This is the define for the received callback methodi +#ifdef WIN32 typedef void ( __stdcall * LPFNDLL_RECEIVE_CALLBACK) ( canalMsg *pMsg ); +#endif // CAN driver open handle typedef long CANHANDLE; Modified: trunk/src/vscp/linuxvscpl1/Makefile =================================================================== --- trunk/src/vscp/linuxvscpl1/Makefile 2008-04-13 15:49:02 UTC (rev 873) +++ trunk/src/vscp/linuxvscpl1/Makefile 2008-04-14 20:56:11 UTC (rev 874) @@ -8,12 +8,12 @@ top_srcdir = ../../.. top_wxsrcdir = @top_wxsrcdir@ top_builddir = ../../.. -top_wxbuilddir = /usr/local +top_wxbuilddir = /usr CXX = g++ -CXXFLAGS = -g -O2 -I/usr/local/lib/wx/include/gtk2-unicode-debug-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXGTK__ -pthread -fPIC -fPIC +CXXFLAGS = -g -O2 -I/usr/lib/wx/include/base-unicode-release-2.6 -I/usr/include/wx-2.6 -DwxUSE_GUI=0 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -fPIC -fPIC CPPFLAGS = -fPIC -fPIC CFLAGS = -fPIC -LDFLAGS = -L/usr/local/lib -pthread -lwx_gtk2ud_aui-2.8 -lwx_gtk2ud_xrc-2.8 -lwx_gtk2ud_qa-2.8 -lwx_gtk2ud_html-2.8 -lwx_gtk2ud_adv-2.8 -lwx_gtk2ud_core-2.8 -lwx_baseud_xml-2.8 -lwx_baseud_net-2.8 -lwx_baseud-2.8 +LDFLAGS = -pthread -lwx_baseu_xml-2.6 -lwx_baseu_net-2.6 -lwx_baseu-2.6 EXTRALIBS = -pthread -W1,--version-script -lz -ldl -lm -lcrypto DLFLAGS = -g -shared -fPIC TRIP = strip This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-13 15:49:10
|
Revision: 873 http://can.svn.sourceforge.net/can/?rev=873&view=rev Author: akhe Date: 2008-04-13 08:49:02 -0700 (Sun, 13 Apr 2008) Log Message: ----------- Fixed bug in sliding window protocol that made an erronious checksum when two DEL's where received inside a frame Modified Paths: -------------- trunk/firmware/common/vscp_serial.c trunk/firmware/common/vscp_serial.h Modified: trunk/firmware/common/vscp_serial.c =================================================================== --- trunk/firmware/common/vscp_serial.c 2008-04-09 12:58:39 UTC (rev 872) +++ trunk/firmware/common/vscp_serial.c 2008-04-13 15:49:02 UTC (rev 873) @@ -125,6 +125,7 @@ if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE == vs_sub_state ) { // Second DLE => it's a DLE character + vs_checksum ^= DLE; vs_msgbuffer[ vs_buffer_cnt++ ] = DLE; vs_sub_state = VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE; } @@ -173,15 +174,15 @@ rv = TRUE; // Ack the frame if ( ( VSCP_SERIAL_OPCODE_ACK != vs_msgbuffer[ 0 ] ) && - ( VSCP_SERIAL_OPCODE_SENT_ACK != vs_msgbuffer[ 0 ] ) ) { - vs_sendAck( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); + ( VSCP_SERIAL_OPCODE_SENT_ACK != vs_msgbuffer[ 0 ] ) ) { + //vs_sendAck( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); } } else { // Nack the frame if ( ( VSCP_SERIAL_OPCODE_NACK != vs_msgbuffer[ 0 ] ) && ( VSCP_SERIAL_OPCODE_SENT_NACK != vs_msgbuffer[ 0 ] ) ) { - vs_sendNack( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); + //vs_sendNack( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); } } @@ -197,20 +198,20 @@ } break; - default: + default: // Receiving packet if ( VSCP_SERIAL_PROTOCOL_STATE_PACKET == vs_main_state ) { vs_checksum ^= b; - vs_msgbuffer[ vs_buffer_cnt++ ] = b; + vs_msgbuffer[ vs_buffer_cnt++ ] = b; } - break; + break; } // Check for buffer overflow if ( vs_buffer_cnt > VSCP_SERIAL_FRAME_SIZE ) { // Start all over vs_main_state = VSCP_SERIAL_PROTOCOL_STATE_NONE; - vs_sub_state = VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE; + vs_sub_state = VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE; } return rv; @@ -237,48 +238,91 @@ return TRUE; } + /////////////////////////////////////////////////////////////////////////////// -// vs_sendAck -// +// vs_sendResponse +// +// Sent inline so it can be used inside frame feed routine +// -BOOL vs_sendAck( uint8_t channel, uint8_t seqnumber ) +BOOL vs_sendResponse( uint8_t opcode, uint8_t channel, uint8_t seqnumber ) { uint8_t checksum = 0; - vs_buffer_cnt = 0; - // Start of frame - vs_bufferSerialByte( DLE ); - vs_bufferSerialByte( STX ); + if ( !vs_sendSerialByte( DLE ) ) { + return FALSE; + } + if ( !vs_sendSerialByte( STX ) ) { + return FALSE; + } - // ACK Code - vs_bufferSerialByteSubst( &checksum, VSCP_SERIAL_OPCODE_ACK ); + // opcode Code + if ( !vs_sendSerialByte( opcode ) ) { + return FALSE; + } + checksum ^= opcode; // Flags - vs_bufferSerialByteSubst( &checksum, 0 ); + if ( !vs_sendSerialByte( 0 ) ) { + return FALSE; + } + checksum ^= 0; // Channel - vs_bufferSerialByteSubst( &checksum, channel ); + if ( DLE == channel ) { + vs_sendSerialByte( DLE ); + vs_sendSerialByte( DLE ); + checksum ^= DLE; // Only one is used for checksum calculations + } + else { + vs_sendSerialByte( channel ); + checksum ^= channel; + } // Counter - vs_bufferSerialByteSubst( &checksum, seqnumber ); + if ( DLE == seqnumber ) { + vs_sendSerialByte( DLE ); + vs_sendSerialByte( DLE ); + checksum ^= DLE; // Only one is used for checksum calculations + } + else { + vs_sendSerialByte( seqnumber ); + checksum ^= seqnumber; + } // Checksum - vs_bufferSerialByteSubst( &checksum, checksum ); + if ( DLE == checksum ) { + vs_sendSerialByte( DLE ); + vs_sendSerialByte( DLE ); + } + else { + vs_sendSerialByte( checksum ); + } // End of frame - vs_bufferSerialByte( DLE ); - vs_bufferSerialByte( ETX ); + if ( !vs_sendSerialByte( DLE ) ) { + return FALSE; + } + if ( !vs_sendSerialByte( ETX ) ) { + return FALSE; + } - // Send the buffer content - if ( !vs_sendBuffer( vs_msgbuffer, vs_buffer_cnt ) ) { - vs_buffer_cnt = 0; - return FALSE; - } - vs_buffer_cnt = 0; - - return TRUE; + return TRUE; } + +/////////////////////////////////////////////////////////////////////////////// +// vs_sendAck +// +// Sent inline so it can be used inside frame feed routine +// + +BOOL vs_sendAck( uint8_t channel, uint8_t seqnumber ) +{ + return vs_sendResponse( VSCP_SERIAL_OPCODE_ACK, + channel, + seqnumber ); +} /////////////////////////////////////////////////////////////////////////////// // vs_sendNack @@ -286,42 +330,9 @@ BOOL vs_sendNack( uint8_t channel, uint8_t seqnumber ) { - uint8_t checksum = 0; - - vs_buffer_cnt = 0; - - // Start of frame - vs_bufferSerialByte( DLE ); - vs_bufferSerialByte( STX ); - - // ACK Code - vs_bufferSerialByteSubst( &checksum, VSCP_SERIAL_OPCODE_NACK ); - - // Flags - vs_bufferSerialByteSubst( &checksum, 0 ); - - // Channel - vs_bufferSerialByteSubst( &checksum, channel ); - - // Counter - vs_bufferSerialByteSubst( &checksum, seqnumber ); - - // Checksum - vs_bufferSerialByteSubst( &checksum, checksum ); - - // End of frame - vs_bufferSerialByte( DLE ); - vs_bufferSerialByte( ETX ); - - // Send the buffer content - if ( !vs_sendBuffer( vs_msgbuffer, vs_buffer_cnt ) ) { - vs_buffer_cnt = 0; - return FALSE; - } - - vs_buffer_cnt = 0; - - return TRUE; + return vs_sendResponse( VSCP_SERIAL_OPCODE_NACK, + channel, + seqnumber ); } /////////////////////////////////////////////////////////////////////////////// @@ -365,7 +376,7 @@ vs_bufferSerialByteSubst( &checksum, pFrame->data[ i ] ); } - // Checksum + // Checksum - Note: checksum byte(s) sent before checksum calcuulated so OK vs_bufferSerialByteSubst( &checksum, checksum ); // End of frame @@ -401,7 +412,7 @@ // Check pointer - Must be at least command byte if ( NULL == pData ) return FALSE; - count &= 0x0f; // Max 16 bytes + count &= 0x1f; // Max 16 bytes // Start of frame vs_bufferSerialByte( DLE ); @@ -459,7 +470,7 @@ // Check pointer - must at least be error byte if ( NULL == pData ) return FALSE; - count &= 0x0f; // Max 16 bytes + count &= 0x1f; // Max 16 bytes // Start of frame vs_bufferSerialByte( DLE ); @@ -500,6 +511,7 @@ } + /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @@ -562,7 +574,7 @@ int i; if ( pSlide->cntOutstanding >= VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES ) { - return NULL; + return NULL; } for ( i=0; i<VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES; i++ ) { @@ -619,8 +631,9 @@ int i; for ( i=0; i<VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES; i++ ) { - if ( ( channel == pSlide->Frames[ i ].frame.channel ) && - ( seqnumber == pSlide->Frames[ i ].frame.seqnumber ) ) { + if ( ( 0 != pSlide->Frames[ i ].timestamp ) && + ( channel == pSlide->Frames[ i ].frame.channel ) && + ( seqnumber == pSlide->Frames[ i ].frame.seqnumber ) ) { pSlide->Frames[ i ].timestamp = 0; pSlide->Frames[ i ].send_count = 0; pSlide->cntOutstanding--; // Another frame removed Modified: trunk/firmware/common/vscp_serial.h =================================================================== --- trunk/firmware/common/vscp_serial.h 2008-04-09 12:58:39 UTC (rev 872) +++ trunk/firmware/common/vscp_serial.h 2008-04-13 15:49:02 UTC (rev 873) @@ -60,7 +60,7 @@ #define STX 0x01 // Start of 'text' #define ETX 0x02 // End of 'text' -#define VSCP_SERIAL_FRAME_SIZE 27 // Max frame size +#define VSCP_SERIAL_FRAME_SIZE 23 // Max frame size #define VSCP_SERIAL_BUFFER_SIZE VSCP_SERIAL_FRAME_SIZE * 2 // Protocol state machine @@ -146,7 +146,7 @@ Send a character on the serial line. If its better to send a chunk of data just collect data in this routine and - do the actial send with vs_sendFrame. + do the actual send with vs_sendFrame. @param b Byte to send. @return TRUE on success, FALSE on failure. */ @@ -207,6 +207,17 @@ BOOL vs_getFrame( vs_frame *pFrame ); /*! + Send ACK/NACK response + @param opcode Either ACK or NACK opcode. + @param channel Channel number ACK is sent for. + @param seqnumber Id for packet which is ACK'ed + @return TRUE och success. FALSE on failure. +*/ +BOOL vs_sendResponse( uint8_t opcode, + uint8_t channel, + uint8_t seqnumber ); + +/*! Send ACK @param channel Channel number ACK is sent for. @param seqnumber Id for packet whcih is ACK'ed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-09 12:58:58
|
Revision: 872 http://can.svn.sourceforge.net/can/?rev=872&view=rev Author: akhe Date: 2008-04-09 05:58:39 -0700 (Wed, 09 Apr 2008) Log Message: ----------- Fixed bug in serial protocol/sliding Window driver where buffer was not initialized correctly. Modified Paths: -------------- trunk/firmware/common/vscp.h trunk/firmware/common/vscp_serial.c trunk/src/common/libwxctb-0.13/src/gpib.cpp trunk/src/vscp/common/canal.h Property Changed: ---------------- trunk/src/common/libwxctb-0.13/build/ trunk/src/common/libwxctb-0.13/lib/ Modified: trunk/firmware/common/vscp.h =================================================================== --- trunk/firmware/common/vscp.h 2008-04-07 16:12:27 UTC (rev 871) +++ trunk/firmware/common/vscp.h 2008-04-09 12:58:39 UTC (rev 872) @@ -64,8 +64,8 @@ // The node will not try to find a nickname on startup. -#include "vscp_compiler.h" // This file should be in your project folder -#include "vscp_projdefs.h" // This file should be in your project folder +#include <vscp_compiler.h> // This file should be in your project folder +#include <vscp_projdefs.h> // This file should be in your project folder #include <inttypes.h> Modified: trunk/firmware/common/vscp_serial.c =================================================================== --- trunk/firmware/common/vscp_serial.c 2008-04-07 16:12:27 UTC (rev 871) +++ trunk/firmware/common/vscp_serial.c 2008-04-09 12:58:39 UTC (rev 872) @@ -172,11 +172,17 @@ if ( 0 == vs_checksum ) { rv = TRUE; // Ack the frame - vs_sendAck( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); + if ( ( VSCP_SERIAL_OPCODE_ACK != vs_msgbuffer[ 0 ] ) && + ( VSCP_SERIAL_OPCODE_SENT_ACK != vs_msgbuffer[ 0 ] ) ) { + vs_sendAck( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); + } } else { // Nack the frame - vs_sendNack( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); + if ( ( VSCP_SERIAL_OPCODE_NACK != vs_msgbuffer[ 0 ] ) && + ( VSCP_SERIAL_OPCODE_SENT_NACK != vs_msgbuffer[ 0 ] ) ) { + vs_sendNack( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); + } } vs_init(); @@ -225,7 +231,7 @@ pFrame->channel = vs_msgbuffer[ 2 ]; pFrame->seqnumber = vs_msgbuffer[ 3 ]; pFrame->vscpclass = vs_msgbuffer[ 4 ]; - pFrame->vscptype = vs_msgbuffer [5 ]; + pFrame->vscptype = vs_msgbuffer [ 5 ]; memcpy( pFrame->data, ( vs_msgbuffer + 6 ), 16 ); return TRUE; @@ -238,6 +244,8 @@ BOOL vs_sendAck( uint8_t channel, uint8_t seqnumber ) { uint8_t checksum = 0; + + vs_buffer_cnt = 0; // Start of frame vs_bufferSerialByte( DLE ); @@ -245,6 +253,9 @@ // ACK Code vs_bufferSerialByteSubst( &checksum, VSCP_SERIAL_OPCODE_ACK ); + + // Flags + vs_bufferSerialByteSubst( &checksum, 0 ); // Channel vs_bufferSerialByteSubst( &checksum, channel ); @@ -277,12 +288,17 @@ { uint8_t checksum = 0; + vs_buffer_cnt = 0; + // Start of frame vs_bufferSerialByte( DLE ); vs_bufferSerialByte( STX ); // ACK Code vs_bufferSerialByteSubst( &checksum, VSCP_SERIAL_OPCODE_NACK ); + + // Flags + vs_bufferSerialByteSubst( &checksum, 0 ); // Channel vs_bufferSerialByteSubst( &checksum, channel ); @@ -316,6 +332,8 @@ { int i; uint8_t checksum = 0; + + vs_buffer_cnt = 0; // Check pointer if ( NULL == pFrame ) return FALSE; @@ -343,8 +361,8 @@ vs_bufferSerialByteSubst( &checksum, pFrame->vscptype ); // data - for ( i=0; i < ( pFrame->flags & 0x0f ); i++ ) { - vs_bufferSerialByteSubst( &checksum, pFrame->data[ i ] ); + for ( i=0; i < ( pFrame->flags & 0x1f ); i++ ) { + vs_bufferSerialByteSubst( &checksum, pFrame->data[ i ] ); } // Checksum @@ -356,8 +374,8 @@ // Send the buffer content if ( !vs_sendBuffer( vs_msgbuffer, vs_buffer_cnt ) ) { - vs_buffer_cnt = 0; - return FALSE; + vs_buffer_cnt = 0; + return FALSE; } vs_buffer_cnt = 0; @@ -378,6 +396,8 @@ int i; uint8_t checksum = 0; + vs_buffer_cnt = 0; + // Check pointer - Must be at least command byte if ( NULL == pData ) return FALSE; @@ -434,6 +454,8 @@ int i; uint8_t checksum = 0; + vs_buffer_cnt = 0; + // Check pointer - must at least be error byte if ( NULL == pData ) return FALSE; @@ -621,6 +643,7 @@ uint32_t diff; for ( i=0; i<VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES; i++ ) { + // Skip unused positions if ( 0 == pSlide->Frames[ i ].timestamp ) continue; Property changes on: trunk/src/common/libwxctb-0.13/build ___________________________________________________________________ Name: svn:ignore + debug release Property changes on: trunk/src/common/libwxctb-0.13/lib ___________________________________________________________________ Name: svn:ignore + *.dll *.lib *.ilk *.pdb Modified: trunk/src/common/libwxctb-0.13/src/gpib.cpp =================================================================== --- trunk/src/common/libwxctb-0.13/src/gpib.cpp 2008-04-07 16:12:27 UTC (rev 871) +++ trunk/src/common/libwxctb-0.13/src/gpib.cpp 2008-04-09 12:58:39 UTC (rev 872) @@ -222,6 +222,7 @@ int wxGPIB::FindListeners(int board) { + int i; int listeners = 0; if((unsigned int)board > 1) { return -1; @@ -233,7 +234,7 @@ Addr4882_t addrlist[31]; // The range of valid addresses is 1...30, 0 is reservated by the // controller, 31 is not valid - for(int i = 0;i < 30; i++) addrlist[i] = (Addr4882_t) i + 1; + for( i = 0;i < 30; i++) addrlist[i] = (Addr4882_t) i + 1; addrlist[30] = NOADDR; // place to store the results Addr4882_t results[31]; @@ -242,7 +243,7 @@ if(ibsta & ERR) { return -1; } - for(int i=0;i<=30;i++) { + for( i=0;i<=30;i++) { if(results[i]) { listeners |= 1 << results[i]; } Modified: trunk/src/vscp/common/canal.h =================================================================== --- trunk/src/vscp/common/canal.h 2008-04-07 16:12:27 UTC (rev 871) +++ trunk/src/vscp/common/canal.h 2008-04-09 12:58:39 UTC (rev 872) @@ -59,17 +59,17 @@ #define CANAL_MAIN_VERSION 1 #define CANAL_MINOR_VERSION 0 -#define CANAL_SUB_VERSION 6 +#define CANAL_SUB_VERSION 6 // Canal Levels -#define CANAL_LEVEL_STANDARD 1 +#define CANAL_LEVEL_STANDARD 1 #define CANAL_LEVEL_USES_TCPIP 2 // VSCP daemon version information positions #define POS_VSCPD_MAJOR_VERSION 1 #define POS_VSCPD_MINOR_VERSION 2 -#define POS_VSCPD_SUB_VERSION 3 +#define POS_VSCPD_SUB_VERSION 3 // VSCP Daemon client Open types @@ -83,8 +83,8 @@ /// Return types -#define PACKAGE_ACK 0 -#define PACKAGE_NACK 1 +#define PACKAGE_ACK 0 +#define PACKAGE_NACK 1 #define PACKAGE_TIMEOUT -1 #define PACKAGE_UNKNOWN -1 @@ -398,9 +398,9 @@ /// ID flags #define CANAL_IDFLAG_STANDARD 0x00000000 // Standard message id (11-bit) #define CANAL_IDFLAG_EXTENDED 0x00000001 // Extended message id (29-bit) -#define CANAL_IDFLAG_RTR 0x00000002 // RTR-Frame +#define CANAL_IDFLAG_RTR 0x00000002 // RTR-Frame #define CANAL_IDFLAG_ERROR 0x00000004 // This package is an error indication (id holds error code) -#define CANAL_IDFLAG_SEND 0x80000000 // Reserved for use by application software to indicate send +#define CANAL_IDFLAG_SEND 0x80000000 // Reserved for use by application software to indicate send /// Communicaton speeds #define CANAL_BAUD_USER 0 // User specified (In CANAL i/f DLL). @@ -415,116 +415,116 @@ #define CANAL_BAUD_10 9 // 10 Kbit /// Status codes -#define CANAL_STATUS_NONE 0x00000000 -#define CANAL_STATUS_ACTIVE 0x10000000 -#define CANAL_STATUS_PASSIVE 0x40000000 -#define CANAL_STATUS_BUS_OFF 0x80000000 -#define CANAL_STATUS_BUS_WARN 0x40000000 -#define CANAL_STATUS_PHY_FAULT 0x08000000 -#define CANAL_STATUS_PHY_H 0x04000000 -#define CANAL_STATUS_PHY_L 0x02000000 -#define CANAL_STATUS_SLEEPING 0x01000000 -#define CANAL_STATUS_STOPPED 0x00800000 +#define CANAL_STATUS_NONE 0x00000000 +#define CANAL_STATUS_ACTIVE 0x10000000 +#define CANAL_STATUS_PASSIVE 0x40000000 +#define CANAL_STATUS_BUS_OFF 0x80000000 +#define CANAL_STATUS_BUS_WARN 0x40000000 +#define CANAL_STATUS_PHY_FAULT 0x08000000 +#define CANAL_STATUS_PHY_H 0x04000000 +#define CANAL_STATUS_PHY_L 0x02000000 +#define CANAL_STATUS_SLEEPING 0x01000000 +#define CANAL_STATUS_STOPPED 0x00800000 #define CANAL_STATUS_RECIVE_BUFFER_FULL 0x00400000 // Drivers buffer #define CANAL_STATUS_TRANSMIT_BUFFER_FULL 0x00200000 // Drivers buffer /// Error Codes -#define CANAL_ERROR_SUCCESS 0 // All is OK -#define CANAL_ERROR_BAUDRATE 1 // Baudrate error -#define CANAL_ERROR_BUS_OFF 2 // Bus off error +#define CANAL_ERROR_SUCCESS 0 // All is OK +#define CANAL_ERROR_BAUDRATE 1 // Baudrate error +#define CANAL_ERROR_BUS_OFF 2 // Bus off error #define CANAL_ERROR_BUS_PASSIVE 3 // Bus Passive error #define CANAL_ERROR_BUS_WARNING 4 // Bus warning error -#define CANAL_ERROR_CAN_ID 5 // Invalid CAN ID +#define CANAL_ERROR_CAN_ID 5 // Invalid CAN ID #define CANAL_ERROR_CAN_MESSAGE 6 // Invalid CAN message -#define CANAL_ERROR_CHANNEL 7 // Invalid channel +#define CANAL_ERROR_CHANNEL 7 // Invalid channel #define CANAL_ERROR_FIFO_EMPTY 8 // FIFO is empty -#define CANAL_ERROR_FIFO_FULL 9 // FIFI is full -#define CANAL_ERROR_FIFO_SIZE 10 // FIFO size error -#define CANAL_ERROR_FIFO_WAIT 11 -#define CANAL_ERROR_GENERIC 12 // Generic error -#define CANAL_ERROR_HARDWARE 13 // Hardware error -#define CANAL_ERROR_INIT_FAIL 14 // Initialization failed +#define CANAL_ERROR_FIFO_FULL 9 // FIFI is full +#define CANAL_ERROR_FIFO_SIZE 10 // FIFO size error +#define CANAL_ERROR_FIFO_WAIT 11 +#define CANAL_ERROR_GENERIC 12 // Generic error +#define CANAL_ERROR_HARDWARE 13 // Hardware error +#define CANAL_ERROR_INIT_FAIL 14 // Initialization failed #define CANAL_ERROR_INIT_MISSING 15 #define CANAL_ERROR_INIT_READY 16 #define CANAL_ERROR_NOT_SUPPORTED 17 // Not supported -#define CANAL_ERROR_OVERRUN 18 // Overrun -#define CANAL_ERROR_RCV_EMPTY 19 // Receive buffer empty -#define CANAL_ERROR_REGISTER 20 // Register value error -#define CANAL_ERROR_TRM_FULL 21 +#define CANAL_ERROR_OVERRUN 18 // Overrun +#define CANAL_ERROR_RCV_EMPTY 19 // Receive buffer empty +#define CANAL_ERROR_REGISTER 20 // Register value error +#define CANAL_ERROR_TRM_FULL 21 #define CANAL_ERROR_ERRFRM_STUFF 22 // Errorframe: stuff error detected #define CANAL_ERROR_ERRFRM_FORM 23 // Errorframe: form error detected #define CANAL_ERROR_ERRFRM_ACK 24 // Errorframe: acknowledge error #define CANAL_ERROR_ERRFRM_BIT1 25 // Errorframe: bit 1 error #define CANAL_ERROR_ERRFRM_BIT0 26 // Errorframe: bit 0 error #define CANAL_ERROR_ERRFRM_CRC 27 // Errorframe: CRC error -#define CANAL_ERROR_LIBRARY 28 // Unable to load library -#define CANAL_ERROR_PROCADDRESS 29 // Unable get library proc address +#define CANAL_ERROR_LIBRARY 28 // Unable to load library +#define CANAL_ERROR_PROCADDRESS 29 // Unable get library proc address #define CANAL_ERROR_ONLY_ONE_INSTANCE 30 // Only one instance allowed -#define CANAL_ERROR_SUB_DRIVER 31 // Problem with sub driver call -#define CANAL_ERROR_TIMEOUT 32 // Blocking call timeout +#define CANAL_ERROR_SUB_DRIVER 31 // Problem with sub driver call +#define CANAL_ERROR_TIMEOUT 32 // Blocking call timeout #define CANAL_ERROR_NOT_OPEN 33 // The device is not open. #define CANAL_ERROR_PARAMETER 34 // A parameter is invalid. #define CANAL_ERROR_MEMORY 35 // Memory exhausted. #define CANAL_ERROR_INTERNAL 36 // Some kind of internal program error -#define CANAL_ERROR_COMMUNICATION 37 // Some kind of communication error +#define CANAL_ERROR_COMMUNICATION 37 // Some kind of communication error // CANAL commands sent over the pipe interface (depricated) -#define CANAL_COMMAND_NOOP 0 // No command -#define CANAL_COMMAND_OPEN 1 // Open channel -#define CANAL_COMMAND_CLOSE 2 // Close channel -#define CANAL_COMMAND_SEND 3 // Send message -#define CANAL_COMMAND_RECEIVE 4 // Receive message -#define CANAL_COMMAND_CHECKDATA 5 // Check if data is available -#define CANAL_COMMAND_BAUDRATE 6 // Set Baudrate -#define CANAL_COMMAND_STATUS 7 // Get status -#define CANAL_COMMAND_STATISTICS 8 // Get statistics -#define CANAL_COMMAND_FILTER 9 // Set filter -#define CANAL_COMMAND_MASK 10 // Set mask -#define CANAL_COMMAND_VERSION 11 // CANAL version -#define CANAL_COMMAND_DLL_VERSION 12 // CANAL DLL version -#define CANAL_COMMAND_VENDOR_STRING 13 // CANAL vendor string -#define CANAL_COMMAND_LEVEL 14 // CANAL Level bitarray +#define CANAL_COMMAND_NOOP 0 // No command +#define CANAL_COMMAND_OPEN 1 // Open channel +#define CANAL_COMMAND_CLOSE 2 // Close channel +#define CANAL_COMMAND_SEND 3 // Send message +#define CANAL_COMMAND_RECEIVE 4 // Receive message +#define CANAL_COMMAND_CHECKDATA 5 // Check if data is available +#define CANAL_COMMAND_BAUDRATE 6 // Set Baudrate +#define CANAL_COMMAND_STATUS 7 // Get status +#define CANAL_COMMAND_STATISTICS 8 // Get statistics +#define CANAL_COMMAND_FILTER 9 // Set filter +#define CANAL_COMMAND_MASK 10 // Set mask +#define CANAL_COMMAND_VERSION 11 // CANAL version +#define CANAL_COMMAND_DLL_VERSION 12 // CANAL DLL version +#define CANAL_COMMAND_VENDOR_STRING 13 // CANAL vendor string +#define CANAL_COMMAND_LEVEL 14 // CANAL Level bitarray // CANAL responses sent over the pipe interface (depricated) -#define CANAL_RESPONSE_NONE 0 // -#define CANAL_RESPONSE_SUCCESS 1 // OK message -#define CANAL_RESPONSE_ERROR 2 // ERROR message -#define CANAL_RESPONSE_MESSAGE 3 // Response to read +#define CANAL_RESPONSE_NONE 0 // +#define CANAL_RESPONSE_SUCCESS 1 // OK message +#define CANAL_RESPONSE_ERROR 2 // ERROR message +#define CANAL_RESPONSE_MESSAGE 3 // Response to read // CANAL error codes sent over the client interface // on error responses -#define CANAL_IFERROR_GENERAL 128 // General error -#define CANAL_IFERROR_UNKNOWN_COMMAND 129 -#define CANAL_IFERROR_CHANNEL_OPEN 130 -#define CANAL_IFERROR_CHANNEL_CLOSED 131 -#define CANAL_IFERROR_SEND_SUCCESS 132 +#define CANAL_IFERROR_GENERAL 128 // General error +#define CANAL_IFERROR_UNKNOWN_COMMAND 129 +#define CANAL_IFERROR_CHANNEL_OPEN 130 +#define CANAL_IFERROR_CHANNEL_CLOSED 131 +#define CANAL_IFERROR_SEND_SUCCESS 132 #define CANAL_IFERROR_SEND_MSG_ALLOCATON 133 -#define CANAL_IFERROR_BUFFER_EMPTY 134 -#define CANAL_IFERROR_BUFFER_FULL 135 -#define CANAL_IFERROR_READ_FAILURE 136 -#define CANAL_IFERROR_SEND_STORAGE 137 +#define CANAL_IFERROR_BUFFER_EMPTY 134 +#define CANAL_IFERROR_BUFFER_FULL 135 +#define CANAL_IFERROR_READ_FAILURE 136 +#define CANAL_IFERROR_SEND_STORAGE 137 // * * * TCP/IP FAST mode interface constants // FAST mode primary states -#define CANAL_BINARY_FRAME_TYPE_VSCP 0 // VSCP event -#define CANAL_BINARY_FRAME_TYPE_ERROR 1 // ACK/NACK/errors +#define CANAL_BINARY_FRAME_TYPE_VSCP 0 // VSCP event +#define CANAL_BINARY_FRAME_TYPE_ERROR 1 // ACK/NACK/errors #define CANAL_BINARY_FRAME_TYPE_COMMAND 2 // Command frame -#define CANAL_BINARY_FRAME_TYPE_CAN 3 // CAN Frame +#define CANAL_BINARY_FRAME_TYPE_CAN 3 // CAN Frame -#define CANAL_BINARY_COMMAND_NOOP 0 // No operation -#define CANAL_BINARY_COMMAND_READ 1 // Read one frame -#define CANAL_BINARY_COMMAND_CLOSE 2 // Close communication channel +#define CANAL_BINARY_COMMAND_NOOP 0 // No operation +#define CANAL_BINARY_COMMAND_READ 1 // Read one frame +#define CANAL_BINARY_COMMAND_CLOSE 2 // Close communication channel // FAST error codes -#define CANAL_BINARY_ERROR_NONE 0 // OK -#define CANAL_BINARY_ERROR_GENERAL 1 // General error -#define CANAL_BINARY_ERROR_TO_SMALL 2 // Packet smaller then min packet -#define CANAL_BINARY_ERROR_FORMAT 3 // Packet have bad format +#define CANAL_BINARY_ERROR_NONE 0 // OK +#define CANAL_BINARY_ERROR_GENERAL 1 // General error +#define CANAL_BINARY_ERROR_TO_SMALL 2 // Packet smaller then min packet +#define CANAL_BINARY_ERROR_FORMAT 3 // Packet have bad format #define CANAL_BINARY_ERROR_UNKNOW_FRAME 4 // Unknown frame type -#define CANAL_BINARY_ERROR_MEMORY 5 // No room for event -#define CANAL_BINARY_ERROR_NO_DATA 6 // No data available +#define CANAL_BINARY_ERROR_MEMORY 5 // No room for event +#define CANAL_BINARY_ERROR_NO_DATA 6 // No data available #define CANAL_BINARY_ERROR_INVALID_CMD 7 // Command not recognized. // Filter mask settings This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-07 16:12:38
|
Revision: 871 http://can.svn.sourceforge.net/can/?rev=871&view=rev Author: akhe Date: 2008-04-07 09:12:27 -0700 (Mon, 07 Apr 2008) Log Message: ----------- cbt 0.13 lib packed up from tar as it should be Added Paths: ----------- trunk/src/common/libwxctb-0.13/Doxyfile.linux trunk/src/common/libwxctb-0.13/build/ trunk/src/common/libwxctb-0.13/build/GNUmakefile trunk/src/common/libwxctb-0.13/build/README trunk/src/common/libwxctb-0.13/build/buildall.bat trunk/src/common/libwxctb-0.13/build/buildall.sh trunk/src/common/libwxctb-0.13/build/makefile.bcc trunk/src/common/libwxctb-0.13/build/makefile.gcc trunk/src/common/libwxctb-0.13/build/makefile.vc trunk/src/common/libwxctb-0.13/build/makefile.wat trunk/src/common/libwxctb-0.13/build/wxctb.bkl trunk/src/common/libwxctb-0.13/include/ trunk/src/common/libwxctb-0.13/include/wx/ trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/ trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/ctb.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/fifo.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/getopt.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/gpib.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/iobase.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/kbhit.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/linux/ trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/linux/serport.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/linux/timer.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/serport.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/serportx.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/timer.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/win32/ trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/win32/getopt.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/win32/gpib-32.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/win32/serport.h trunk/src/common/libwxctb-0.13/include/wx/ctb-0.13/win32/timer.h trunk/src/common/libwxctb-0.13/lib/ trunk/src/common/libwxctb-0.13/lib/gpib32.lib trunk/src/common/libwxctb-0.13/python/ trunk/src/common/libwxctb-0.13/python/module/ trunk/src/common/libwxctb-0.13/python/module/linux/ trunk/src/common/libwxctb-0.13/python/module/linux/ctb.py trunk/src/common/libwxctb-0.13/python/module/linux/wxctb.py trunk/src/common/libwxctb-0.13/python/module/win32/ trunk/src/common/libwxctb-0.13/python/samples/ trunk/src/common/libwxctb-0.13/python/src/ trunk/src/common/libwxctb-0.13/python/src/ctb.html trunk/src/common/libwxctb-0.13/python/src/ctb.py trunk/src/common/libwxctb-0.13/python/src/gpib.i trunk/src/common/libwxctb-0.13/python/src/iobase.i trunk/src/common/libwxctb-0.13/python/src/kbhit.i trunk/src/common/libwxctb-0.13/python/src/linux/ trunk/src/common/libwxctb-0.13/python/src/linux/makepy.sh trunk/src/common/libwxctb-0.13/python/src/linux/serport.i trunk/src/common/libwxctb-0.13/python/src/linux/timer.i trunk/src/common/libwxctb-0.13/python/src/linux/wxctb.i trunk/src/common/libwxctb-0.13/python/src/linux/wxctb.py trunk/src/common/libwxctb-0.13/python/src/linux/wxctb_wrap.cxx trunk/src/common/libwxctb-0.13/python/src/serportx.i trunk/src/common/libwxctb-0.13/python/src/win32/ trunk/src/common/libwxctb-0.13/python/src/win32/makepy.bat trunk/src/common/libwxctb-0.13/python/src/win32/serport.i trunk/src/common/libwxctb-0.13/python/src/win32/timer.i trunk/src/common/libwxctb-0.13/python/src/win32/wxctb.i trunk/src/common/libwxctb-0.13/samples/ trunk/src/common/libwxctb-0.13/samples/ctbtest.cpp trunk/src/common/libwxctb-0.13/src/ trunk/src/common/libwxctb-0.13/src/fifo.cpp trunk/src/common/libwxctb-0.13/src/getopt.cpp trunk/src/common/libwxctb-0.13/src/gpib.cpp trunk/src/common/libwxctb-0.13/src/iobase.cpp trunk/src/common/libwxctb-0.13/src/kbhit.cpp trunk/src/common/libwxctb-0.13/src/linux/ trunk/src/common/libwxctb-0.13/src/linux/serport.cpp trunk/src/common/libwxctb-0.13/src/linux/timer.cpp trunk/src/common/libwxctb-0.13/src/win32/ trunk/src/common/libwxctb-0.13/src/win32/getopt.cpp trunk/src/common/libwxctb-0.13/src/win32/serport.cpp trunk/src/common/libwxctb-0.13/src/win32/timer.cpp trunk/src/common/libwxctb-0.13/website/ Removed Paths: ------------- trunk/src/common/libwxctb-0.13/libwxctb-0.13.tar Added: trunk/src/common/libwxctb-0.13/Doxyfile.linux =================================================================== --- trunk/src/common/libwxctb-0.13/Doxyfile.linux (rev 0) +++ trunk/src/common/libwxctb-0.13/Doxyfile.linux 2008-04-07 16:12:27 UTC (rev 871) @@ -0,0 +1,238 @@ +# Doxyfile 1.4.2 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = libwxctb +PROJECT_NUMBER = 0.12 +OUTPUT_DIRECTORY = docs +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 4 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = NO +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = src \ + src/linux \ + include/wx/ctb-0.12 \ + include/wx/ctb-0.12/linux +FILE_PATTERNS = *.cpp \ + *.h +RECURSIVE = NO +EXCLUDE = docs \ + samples \ + lib \ + build +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = samples +EXAMPLE_PATTERNS = *.cpp +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = NO +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = YES +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = YES +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = word/ctb +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = NO +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO Added: trunk/src/common/libwxctb-0.13/build/GNUmakefile =================================================================== --- trunk/src/common/libwxctb-0.13/build/GNUmakefile (rev 0) +++ trunk/src/common/libwxctb-0.13/build/GNUmakefile 2008-04-07 16:12:27 UTC (rev 871) @@ -0,0 +1,269 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.1.9 (http://bakefile.sourceforge.net) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# 'install' program location +INSTALL = install + +# Location where the package is installed by 'make install' +prefix = /usr/local + +# +AR = ar + +# +RANLIB = ranlib + +# C++ compiler +CXX = g++ + +# Standard flags for C++ +CXXFLAGS = + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS = + +# Standard linker flags +LDFLAGS = + +# Set to 1 to build debug version [0,1] +DEBUG = 0 + +# +GPIB = 0 + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +CPPDEPS = -MT$@ -MF`echo $@ | sed -e 's,\.o$$,.d,'` -MD +WXCTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -D_THREAD_SAFE -pthread \ + $(__OPTIMIZE_FLAG) -I../include $(CPPFLAGS) $(CXXFLAGS) +WXCTB_LIB_OBJECTS = \ + $(OUTPUT)/wxctb_lib_fifo.o \ + $(OUTPUT)/wxctb_lib_getopt.o \ + $(OUTPUT)/wxctb_lib_iobase.o \ + $(OUTPUT)/wxctb_lib_serport.o \ + $(OUTPUT)/wxctb_lib_timer.o \ + $(__GPIBSRC_OBJECTS) +WXCTB_DLL_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -D_THREAD_SAFE -pthread \ + $(__OPTIMIZE_FLAG) -I../include -fPIC -DPIC $(CPPFLAGS) $(CXXFLAGS) +WXCTB_DLL_OBJECTS = \ + $(OUTPUT)/wxctb_dll_fifo.o \ + $(OUTPUT)/wxctb_dll_getopt.o \ + $(OUTPUT)/wxctb_dll_iobase.o \ + $(OUTPUT)/wxctb_dll_serport.o \ + $(OUTPUT)/wxctb_dll_timer.o \ + $(__GPIBSRC_OBJECTS_1) +CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_16_17) $(____DEBUG_1) \ + -DGPIB=$(GPIB) -I../include $(CPPFLAGS) $(CXXFLAGS) +CTBTEST_OBJECTS = \ + $(OUTPUT)/ctbtest_ctbtest.o + +### Conditionally set variables: ### + +ifeq ($(DEBUG),0) +OUTPUT = release +endif +ifeq ($(DEBUG),1) +OUTPUT = debug +endif +ifeq ($(DEBUG),1) +ifeq ($(GPIB),0) +LIBFLAG = d +endif +endif +ifeq ($(DEBUG),0) +ifeq ($(GPIB),1) +LIBFLAG = -gpib +endif +endif +ifeq ($(DEBUG),1) +ifeq ($(GPIB),1) +LIBFLAG = d-gpib +endif +endif +ifeq ($(GPIB),1) +GPIBFLAG = _gpib +endif +ifeq ($(GPIB),1) +__GPIBSRC_OBJECTS = \ + $(OUTPUT)/wxctb_lib_gpib.o +endif +ifeq ($(GPIB),1) +__GPIBSRC_OBJECTS_1 = \ + $(OUTPUT)/wxctb_dll_gpib.o +endif +ifeq ($(DEBUG),0) +____DEBUG_16_17 = -O2 +endif +ifeq ($(DEBUG),1) +____DEBUG_16_17 = -O0 +endif +ifeq ($(DEBUG),0) +__OPTIMIZE_FLAG = -O0 +endif +ifeq ($(DEBUG),1) +__OPTIMIZE_FLAG = -O2 +endif +ifeq ($(DEBUG),0) +____DEBUG = -DNDEBUG +endif +ifeq ($(DEBUG),1) +____DEBUG = +endif +ifeq ($(GPIB),1) +__SYSLIB2_p = -lgpib +endif +ifeq ($(DEBUG),0) +____DEBUG_1 = +endif +ifeq ($(DEBUG),1) +____DEBUG_1 = -g +endif + + +all: $(OUTPUT) +$(OUTPUT): + @mkdir -p $(OUTPUT) + +### Targets: ### + +all: ../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a ../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.so $(OUTPUT)/ctbtest tip-linux + +install: all install_wxctb_lib install_wxctb_dll + $(INSTALL) -d $(prefix)/include/wx/ctb-0.13 + for f in expect.h fifo.h getopt.h gpib.h iobase.h linux/gpib.h linux/serport.h linux/timer.h match.h serport.h serportx.h timer.h; do \ + if test ! -d $(prefix)/include/wx/ctb-0.13/`dirname $$f` ; then \ + $(INSTALL) -d $(prefix)/include/wx/ctb-0.13/`dirname $$f`; \ + fi; \ + $(INSTALL) -m 644 ../include/wx/ctb-0.13//$$f $(prefix)/include/wx/ctb-0.13/$$f; \ + done + +uninstall: + +clean: + rm -f $(OUTPUT)/*.o + rm -f $(OUTPUT)/*.d + rm -f ../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a + rm -f ../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.so + rm -f ../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.so + rm -f $(OUTPUT)/ctbtest + +tarball: + (cd ..; tar -cvzf wxctb-0.13.tar.gz \ + --exclude=ctbtest \ + --exclude=ctbtest.exe \ + --exclude=*.a \ + --exclude=*.d \ + --exclude=debug \ + --exclude=*.dll \ + --exclude=docs \ + --exclude=*.ilk \ + --exclude=*.log \ + --exclude=*.o* \ + --exclude=*.pdb \ + --exclude=*.pyc \ + --exclude=release \ + --exclude=*.so \ + --exclude=SVN* \ + --exclude=.svn \ + --exclude=*.gz \ + --exclude=*~ \ + --exclude=*.___\ + --exclude=*.o* ./) + +../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a: $(WXCTB_LIB_OBJECTS) + rm -f $@ + $(AR) rcu $@ $(WXCTB_LIB_OBJECTS) + $(RANLIB) $@ + +install_wxctb_lib: + $(INSTALL) -d $(prefix)/lib + $(INSTALL) -m 644 ../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a $(prefix)/lib + +../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.so: $(WXCTB_DLL_OBJECTS) + $(CXX) -shared -fPIC -o $@ $(WXCTB_DLL_OBJECTS) $(LDFLAGS) $(____DEBUG_1) -pthread -L../lib -lpthread $(__SYSLIB2_p) + +install_wxctb_dll: + $(INSTALL) -d $(prefix)/lib + $(INSTALL) -m 644 ../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.so $(prefix)/lib + install -c ../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.so $(prefix)/lib + +$(OUTPUT)/ctbtest: $(CTBTEST_OBJECTS) ../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a + $(CXX) -o $@ $(CTBTEST_OBJECTS) $(LDFLAGS) $(____DEBUG_1) -L../lib ../lib/libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a -lpthread $(__SYSLIB2_p) + +tip-linux: + @echo " " + @echo "================================================================" + @echo " The building of wxctb is finished. On Linux you'll now" + @echo " have to run (as root):" + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) install" + @echo " " + @echo " to install the libraries in $(prefix)/lib" + @echo " and the header files in $(prefix)/include/wx/ctb-0.13" + @echo " " + @echo " Don't forget to run ldconfig (also as root)" + @echo " " + @echo " wxctb comes with no guarantees and doesn't claim" + @echo " to be suitable for any purpose." + @echo "================================================================" + @echo " " + +$(OUTPUT)/wxctb_lib_fifo.o: ./../src/fifo.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_lib_getopt.o: ./../src/getopt.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_lib_iobase.o: ./../src/iobase.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_lib_serport.o: ./../src/linux/serport.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_lib_timer.o: ./../src/linux/timer.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_lib_gpib.o: ./../src/gpib.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_dll_fifo.o: ./../src/fifo.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_dll_getopt.o: ./../src/getopt.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_dll_iobase.o: ./../src/iobase.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_dll_serport.o: ./../src/linux/serport.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_dll_timer.o: ./../src/linux/timer.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/wxctb_dll_gpib.o: ./../src/gpib.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctbtest_ctbtest.o: ./../samples/ctbtest.cpp + $(CXX) -c -o $@ $(CTBTEST_CXXFLAGS) $(CPPDEPS) $< + +.PHONY: all install uninstall clean install_wxctb_lib install_wxctb_dll + + +# Dependencies tracking: +-include $(OUTPUT)/*.d Added: trunk/src/common/libwxctb-0.13/build/README =================================================================== --- trunk/src/common/libwxctb-0.13/build/README (rev 0) +++ trunk/src/common/libwxctb-0.13/build/README 2008-04-07 16:12:27 UTC (rev 871) @@ -0,0 +1,144 @@ + wxCTB component info + -------------------- + + Website: http://wxcode.sourceforge.net/components/wxctb + Version: 0.13 + + or for additional support and tools: + http://www.iftools.com/extras.en.html + + + Linux GCC compiliation + ---------------------------------------------------------------- + + Type 'make DEBUG=x GPIB=x' or 'make -f GNUmakefile DEBUG=x GPIB=x' + + You can also type: ./buildall.sh in the build folder to compile + and link all variants (debug/release with and without gpib support) + and install the headers and libs in the allocated space. + Note! You must root, to do this, or just input: + sudo ./buildall.sh + + + Microsoft Visual C++ compilation + ---------------------------------------------------------------- + + Type 'nmake -f makefile.vc DEBUG=x GPIB=x' + + To create all libs (debug/release with and without gpib support) + just input: ./buildall.bat in the build folder. + + + Borland C++ 5.0/5.5 compilation + ---------------------------------------------------------------- + + Type 'make -f makefile.bcc DEBUG=x GPIB=x' + + + + Watcom C++ 10.6/11 and OpenWatcom compilation + ---------------------------------------------------------------- + + Type 'wmake -f makefile.wat' + + + Python support + -------------- + + Since version 0.9 ctb also includes a python module ctb.py. + To build the python module by yourself, your system has to satisfy + the following requirements: + + - the SWIG program, you get it at http://www.swig.org/ (for linux, + take a look in your favorite distribution package manager). + The current ctb module was build with SWIG version 1.3.29 (linux) + and version 1.3.25 (Windows) + - the develop files for python (means the header and the library + files). I tested it with Python 2.3 and 2.4. + - if you want to communicate via GPIB, a GPIB installation (GPIB + controller and software, for instance a Nation Instruments or + Keithley card). On Linux the libgpib. + + Like the building of the wxctb C++ library, you also can choose + between GPIB and non GPIB (default) support. + + Compile the python module + + Linux + cd in the python/src/linux folder and type: + ./makepy.sh USE_GPIB + or + ./makepy.sh + if you don't need any GPIB support + + Windows + cd in the python/src/windows folder. Open the makepy.bat with your + favorite editor and set the commented enviroment variables. See the + makepy.bat file for more information, how you can do that. + After that, just type: + + ./makepy.sh USE_GPIB + (for GPIB support) or + ./makepy.sh + if you don't need any GPIB support + + At last set the python modul path to the wxctb-0.12/python/module + path. + On linux: + + export PYTHONPATH=somepath/wxctb-0.12/python/module/linux + + On Windows: + + set PYTHONPATH=drive:\somepath\wxctb-0.12\python\module\win32 + + + ChangeLog + --------- + 0.13 + - remove the expect and match mechanism. They didn't work very + well, and a future implementation should be done as a + independent library. If someone missed this functions, please + let me know. + + 0.12 + - more documentation for doxygen + - replace the ugly GetSettingsAsString methods by a more intuitive + one. + - wxGPIB::Read now checks the MAV bit before reading. This resolves + some stderr stuff on linux. + + 0.11 + - the gpib sources are no longer depending on the OS. They are + identical for linux and windows. + - add the current version to the ctb include path, so you can + handle a parallel installation of different versions. + For instance: The header path wx/ctb is replaced by wx/ctb-0.11 + + 0.10 + - replace the former gpib async io access with the standard + NI-488 functions (ibrd,ibwrt). To avoid blocking, the internal + gpib timeout was set to the lowest value, whereas the wxIOBase + methods handles the timeout in a global and transparent manner. + - add a FindListener method in the wxGPIB class to look for all + connected gpib devices (listeners). + - The Read and Readv method of the python wxIOBase class returns + additional zero bytes, fixed. + + 0.9 + - added python support for both, serial and gpib + + 0.8 + - added bakefile support + + 0.7 + - added GPIB (Nation Instruments GPIB cards) support + + + Authors' info + ------------- + + Joachim Buermann jbu...@if... + + Thanks to the following people for their hints and patches: + - Added: trunk/src/common/libwxctb-0.13/build/buildall.bat =================================================================== --- trunk/src/common/libwxctb-0.13/build/buildall.bat (rev 0) +++ trunk/src/common/libwxctb-0.13/build/buildall.bat 2008-04-07 16:12:27 UTC (rev 871) @@ -0,0 +1,9 @@ +nmake -a -f makefile.vc GPIB=0 DEBUG=0 +nmake -a -f makefile.vc GPIB=0 DEBUG=0 wxinstall +nmake -a -f makefile.vc GPIB=1 DEBUG=0 +nmake -a -f makefile.vc GPIB=1 DEBUG=0 wxinstall +nmake -a -f makefile.vc GPIB=0 DEBUG=1 +nmake -a -f makefile.vc GPIB=0 DEBUG=1 wxinstall +nmake -a -f makefile.vc GPIB=1 DEBUG=1 +nmake -a -f makefile.vc GPIB=1 DEBUG=1 wxinstall + Added: trunk/src/common/libwxctb-0.13/build/buildall.sh =================================================================== --- trunk/src/common/libwxctb-0.13/build/buildall.sh (rev 0) +++ trunk/src/common/libwxctb-0.13/build/buildall.sh 2008-04-07 16:12:27 UTC (rev 871) @@ -0,0 +1,18 @@ +#!/bin/bash + +# Release without GPIB +make clean +make DEBUG=0 GPIB=0 +sudo make DEBUG=0 GPIB=0 install +# Debug without GPIB +make clean +make DEBUG=1 GPIB=0 +sudo make DEBUG=1 GPIB=0 install +# Release with GPIB +make clean +make DEBUG=0 GPIB=1 +sudo make DEBUG=0 GPIB=1 install +# Debug with GPIB +make clean +make DEBUG=1 GPIB=1 +sudo make DEBUG=1 GPIB=1 install Added: trunk/src/common/libwxctb-0.13/build/makefile.bcc =================================================================== --- trunk/src/common/libwxctb-0.13/build/makefile.bcc (rev 0) +++ trunk/src/common/libwxctb-0.13/build/makefile.bcc 2008-04-07 16:12:27 UTC (rev 871) @@ -0,0 +1,265 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.1.9 (http://bakefile.sourceforge.net) +# Do not modify, all changes will be overwritten! +# ========================================================================= + +.autodepend + +!ifndef BCCDIR +!ifndef MAKEDIR +!error Your Borland compiler does not define MAKEDIR. Please define the BCCDIR variable, e.g. BCCDIR=d:\bc4 +!endif +BCCDIR = $(MAKEDIR)\.. +!endif + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# C++ compiler +!ifndef CXX +CXX = bcc32 +!endif + +# Standard flags for C++ +!ifndef CXXFLAGS +CXXFLAGS = +!endif + +# Standard preprocessor flags (common for CC and CXX) +!ifndef CPPFLAGS +CPPFLAGS = -a8 -g0 +!endif + +# Standard linker flags +!ifndef LDFLAGS +LDFLAGS = +!endif + +# Set to 1 to build debug version [0,1] +!ifndef DEBUG +DEBUG = 0 +!endif + +# +!ifndef GPIB +GPIB = 0 +!endif + +# +!ifndef WXDIR +WXDIR = $(WXWIN) +!endif + +# +!ifndef INSTALLDIR +INSTALLDIR = $(WXWIN) +!endif + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +WXCTB_LIB_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) -tWM \ + $(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS) +WXCTB_LIB_OBJECTS = \ + $(OUTPUT)\wxctb_lib_fifo.obj \ + $(OUTPUT)\wxctb_lib_getopt.obj \ + $(OUTPUT)\wxctb_lib_iobase.obj \ + $(OUTPUT)\wxctb_lib_serport.obj \ + $(OUTPUT)\wxctb_lib_timer.obj \ + $(____GPIBSRC_FILENAMES_OBJECTS) +WXCTB_DLL_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) -tWM \ + $(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS) +WXCTB_DLL_OBJECTS = \ + $(OUTPUT)\wxctb_dll_fifo.obj \ + $(OUTPUT)\wxctb_dll_getopt.obj \ + $(OUTPUT)\wxctb_dll_iobase.obj \ + $(OUTPUT)\wxctb_dll_serport.obj \ + $(OUTPUT)\wxctb_dll_timer.obj \ + $(____GPIBSRC_FILENAMES_1_OBJECTS) +CTBTEST_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_24_25) \ + $(____DEBUG_2) -DGPIB=$(GPIB) -I..\include $(CPPFLAGS) $(CXXFLAGS) +CTBTEST_OBJECTS = \ + $(OUTPUT)\ctbtest_ctbtest.obj + +### Conditionally set variables: ### + +!if "$(DEBUG)" == "0" +OUTPUT = release +!endif +!if "$(DEBUG)" == "1" +OUTPUT = debug +!endif +!if "$(WXDIR)" == "" +INSTALLDIR = ..\lib +!endif +!if "$(DEBUG)" == "1" && "$(GPIB)" == "0" +LIBFLAG = d +!endif +!if "$(DEBUG)" == "0" && "$(GPIB)" == "1" +LIBFLAG = -gpib +!endif +!if "$(DEBUG)" == "1" && "$(GPIB)" == "1" +LIBFLAG = d-gpib +!endif +!if "$(GPIB)" == "1" +GPIBFLAG = _gpib +!endif +!if "$(GPIB)" == "1" +____GPIBSRC_FILENAMES_OBJECTS = \ + $(OUTPUT)\wxctb_lib_gpib.obj +!endif +!if "$(GPIB)" == "1" +____GPIBSRC_FILENAMES_1_OBJECTS = \ + $(OUTPUT)\wxctb_dll_gpib.obj +!endif +!if "$(DEBUG)" == "0" +____DEBUG_24_25 = -O2 +!endif +!if "$(DEBUG)" == "1" +____DEBUG_24_25 = -Od +!endif +!if "$(DEBUG)" == "0" +__OPTIMIZE_FLAG = -Od +!endif +!if "$(DEBUG)" == "1" +__OPTIMIZE_FLAG = -O2 +!endif +!if "$(DEBUG)" == "0" +____DEBUG = -DNDEBUG +!endif +!if "$(DEBUG)" == "1" +____DEBUG = +!endif +!if "$(GPIB)" == "1" +__SYSLIB2_p = gpib32.lib +!endif +!if "$(DEBUG)" == "0" +____DEBUG_2 = -v- +!endif +!if "$(DEBUG)" == "1" +____DEBUG_2 = -v +!endif + + +all: $(OUTPUT) +$(OUTPUT): + -if not exist $(OUTPUT) mkdir $(OUTPUT) + +### Targets: ### + +all: ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll $(OUTPUT)\ctbtest.exe tip-win32 + +clean: + -if exist $(OUTPUT)\*.obj del $(OUTPUT)\*.obj + -if exist $(OUTPUT)\*.res del $(OUTPUT)\*.res + -if exist $(OUTPUT)\*.csm del $(OUTPUT)\*.csm + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.tds del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.tds + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.ilc del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.ilc + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.ild del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.ild + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.ilf del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.ilf + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.ils del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.ils + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib + -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe + -if exist $(OUTPUT)\ctbtest.tds del $(OUTPUT)\ctbtest.tds + -if exist $(OUTPUT)\ctbtest.ilc del $(OUTPUT)\ctbtest.ilc + -if exist $(OUTPUT)\ctbtest.ild del $(OUTPUT)\ctbtest.ild + -if exist $(OUTPUT)\ctbtest.ilf del $(OUTPUT)\ctbtest.ilf + -if exist $(OUTPUT)\ctbtest.ils del $(OUTPUT)\ctbtest.ils + +..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib: $(WXCTB_LIB_OBJECTS) + if exist $@ del $@ + tlib /a /p4096 $@ @&&| + $(WXCTB_LIB_OBJECTS) +| + +..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll: $(WXCTB_DLL_OBJECTS) + ilink32 -Tpd -q $(LDFLAGS) -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(____DEBUG_2) -L..\lib @&&| + c0d32.obj $(WXCTB_DLL_OBJECTS),$@,, winmm.lib $(__SYSLIB2_p) import32.lib cw32mt.lib,, +| + implib -f ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13 $@ + +$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib + ilink32 -Tpe -q $(LDFLAGS) -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(____DEBUG_2) -L..\lib @&&| + c0x32.obj $(CTBTEST_OBJECTS),$@,, ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib winmm.lib $(__SYSLIB2_p) import32.lib cw32.lib,, +| + +wxinstall: + @copy ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib $(INSTALLDIR)\lib\borland_lib + @copy ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll $(INSTALLDIR)\lib\borland_lib + + @if not exist $(INSTALLDIR)\include\wx\ctb-0.13\win32 mkdir $(INSTALLDIR)\include\wx\ctb-0.13\win32 + @copy ..\include\wx\ctb-0.13\*.h $(INSTALLDIR)\include\wx\ctb-0.13 + @copy ..\include\wx\ctb-0.13\win32\*.h $(INSTALLDIR)\include\wx\ctb-0.13\win32 + +tip-win32: + @echo " " + @echo "================================================================" + @echo " The building of wxctb is finished. If you have an installed " + @echo " wxWidget package (WXWIN must be defined in the enviroment), " + @echo " you'll now have to run: " + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " + @echo " " + @echo " to install the libraries in: " + @echo " $(INSTALLDIR)\lib\borland_lib " + @echo " and the header files in" + @echo " $(INSTALLDIR)\wx\ctb-0.13" + @echo " " + @echo " If you are using another compiler (Borland, Watcom, mingw,...) " + @echo " take a look in the README in this directory! " + @echo " " + @echo " wxctb comes with no guarantees and doesn't claim " + @echo " to be suitable for any purpose. " + @echo "================================================================" + @echo " " + +$(OUTPUT)\wxctb_lib_fifo.obj: .\..\src\fifo.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_lib_getopt.obj: .\..\src\getopt.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_lib_iobase.obj: .\..\src\iobase.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_lib_serport.obj: .\..\src\win32\serport.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_lib_timer.obj: .\..\src\win32\timer.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_lib_gpib.obj: .\..\src\gpib.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_fifo.obj: .\..\src\fifo.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_getopt.obj: .\..\src\getopt.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_iobase.obj: .\..\src\iobase.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_serport.obj: .\..\src\win32\serport.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_timer.obj: .\..\src\win32\timer.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_gpib.obj: .\..\src\gpib.cpp + $(CXX) -q -c -P -o$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\ctbtest_ctbtest.obj: .\..\samples\ctbtest.cpp + $(CXX) -q -c -P -o$@ $(CTBTEST_CXXFLAGS) $** + Added: trunk/src/common/libwxctb-0.13/build/makefile.gcc =================================================================== --- trunk/src/common/libwxctb-0.13/build/makefile.gcc (rev 0) +++ trunk/src/common/libwxctb-0.13/build/makefile.gcc 2008-04-07 16:12:27 UTC (rev 871) @@ -0,0 +1,235 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.1.9 (http://bakefile.sourceforge.net) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# C++ compiler +CXX = g++ + +# Standard flags for C++ +CXXFLAGS = + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS = + +# Standard linker flags +LDFLAGS = + +# Set to 1 to build debug version [0,1] +DEBUG = 0 + +# +GPIB = 0 + +# +WXDIR = $(WXWIN) + +# +INSTALLDIR = $(WXWIN) + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +CPPDEPS = -MT$@ -MF$@.d -MD +WXCTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -mthreads $(__OPTIMIZE_FLAG) \ + -I..\include $(CPPFLAGS) $(CXXFLAGS) +WXCTB_LIB_OBJECTS = \ + $(OUTPUT)\wxctb_lib_fifo.o \ + $(OUTPUT)\wxctb_lib_getopt.o \ + $(OUTPUT)\wxctb_lib_iobase.o \ + $(OUTPUT)\wxctb_lib_serport.o \ + $(OUTPUT)\wxctb_lib_timer.o \ + $(____GPIBSRC_FILENAMES_OBJECTS) +WXCTB_DLL_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -mthreads $(__OPTIMIZE_FLAG) \ + -I..\include $(CPPFLAGS) $(CXXFLAGS) +WXCTB_DLL_OBJECTS = \ + $(OUTPUT)\wxctb_dll_fifo.o \ + $(OUTPUT)\wxctb_dll_getopt.o \ + $(OUTPUT)\wxctb_dll_iobase.o \ + $(OUTPUT)\wxctb_dll_serport.o \ + $(OUTPUT)\wxctb_dll_timer.o \ + $(____GPIBSRC_FILENAMES_1_OBJECTS) +CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_16_17) $(____DEBUG_1) \ + -DGPIB=$(GPIB) -I..\include $(CPPFLAGS) $(CXXFLAGS) +CTBTEST_OBJECTS = \ + $(OUTPUT)\ctbtest_ctbtest.o + +### Conditionally set variables: ### + +ifeq ($(DEBUG),0) +OUTPUT = release +endif +ifeq ($(DEBUG),1) +OUTPUT = debug +endif +ifeq ($(WXDIR),) +INSTALLDIR = ..\lib +endif +ifeq ($(DEBUG),1) +ifeq ($(GPIB),0) +LIBFLAG = d +endif +endif +ifeq ($(DEBUG),0) +ifeq ($(GPIB),1) +LIBFLAG = -gpib +endif +endif +ifeq ($(DEBUG),1) +ifeq ($(GPIB),1) +LIBFLAG = d-gpib +endif +endif +ifeq ($(GPIB),1) +GPIBFLAG = _gpib +endif +ifeq ($(GPIB),1) +____GPIBSRC_FILENAMES_OBJECTS = \ + $(OUTPUT)\wxctb_lib_gpib.o +endif +ifeq ($(GPIB),1) +____GPIBSRC_FILENAMES_1_OBJECTS = \ + $(OUTPUT)\wxctb_dll_gpib.o +endif +ifeq ($(DEBUG),0) +____DEBUG_16_17 = -O2 +endif +ifeq ($(DEBUG),1) +____DEBUG_16_17 = -O0 +endif +ifeq ($(DEBUG),0) +__OPTIMIZE_FLAG = -O0 +endif +ifeq ($(DEBUG),1) +__OPTIMIZE_FLAG = -O2 +endif +ifeq ($(DEBUG),0) +____DEBUG = -DNDEBUG +endif +ifeq ($(DEBUG),1) +____DEBUG = +endif +ifeq ($(GPIB),1) +__SYSLIB2_p = -lgpib32 +endif +ifeq ($(DEBUG),0) +____DEBUG_1 = +endif +ifeq ($(DEBUG),1) +____DEBUG_1 = -g +endif + + +all: $(OUTPUT) +$(OUTPUT): + -if not exist $(OUTPUT) mkdir $(OUTPUT) + +### Targets: ### + +all: ..\lib\libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll $(OUTPUT)\ctbtest.exe tip-win32 + +clean: + -if exist $(OUTPUT)\*.o del $(OUTPUT)\*.o + -if exist $(OUTPUT)\*.d del $(OUTPUT)\*.d + -if exist ..\lib\libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a del ..\lib\libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll + -if exist ..\lib\libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a del ..\lib\libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a + -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe + +..\lib\libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a: $(WXCTB_LIB_OBJECTS) + if exist $@ del $@ + ar rcu $@ $(WXCTB_LIB_OBJECTS) + ranlib $@ + +..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll: $(WXCTB_DLL_OBJECTS) + $(CXX) -shared -fPIC -o $@ $(WXCTB_DLL_OBJECTS) $(LDFLAGS) $(____DEBUG_1) -mthreads -Wl,--out-implib,..\lib\libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a -L..\lib -lwinmm $(__SYSLIB2_p) + +$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a + $(CXX) -o $@ $(CTBTEST_OBJECTS) $(LDFLAGS) $(____DEBUG_1) -L..\lib ..\lib\libwxctb$(LIBFLAG)$(GPIBFLAG)-0.13.a -lwinmm $(__SYSLIB2_p) + +wxinstall: + @copy ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib $(INSTALLDIR)\lib\mingw_lib + @copy ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll $(INSTALLDIR)\lib\mingw_lib + + @if not exist $(INSTALLDIR)\include\wx\ctb-0.13\win32 mkdir $(INSTALLDIR)\include\wx\ctb-0.13\win32 + @copy ..\include\wx\ctb-0.13\*.h $(INSTALLDIR)\include\wx\ctb-0.13 + @copy ..\include\wx\ctb-0.13\win32\*.h $(INSTALLDIR)\include\wx\ctb-0.13\win32 + +tip-win32: + @echo " " + @echo "================================================================" + @echo " The building of wxctb is finished. If you have an installed " + @echo " wxWidget package (WXWIN must be defined in the enviroment), " + @echo " you'll now have to run: " + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " + @echo " " + @echo " to install the libraries in: " + @echo " $(INSTALLDIR)\lib\mingw_lib " + @echo " and the header files in" + @echo " $(INSTALLDIR)\wx\ctb-0.13" + @echo " " + @echo " If you are using another compiler (Borland, Watcom, mingw,...) " + @echo " take a look in the README in this directory! " + @echo " " + @echo " wxctb comes with no guarantees and doesn't claim " + @echo " to be suitable for any purpose. " + @echo "================================================================" + @echo " " + +$(OUTPUT)\wxctb_lib_fifo.o: ./../src/fifo.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_lib_getopt.o: ./../src/getopt.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_lib_iobase.o: ./../src/iobase.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_lib_serport.o: ./../src/win32/serport.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_lib_timer.o: ./../src/win32/timer.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_lib_gpib.o: ./../src/gpib.cpp + $(CXX) -c -o $@ $(WXCTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_dll_fifo.o: ./../src/fifo.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_dll_getopt.o: ./../src/getopt.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_dll_iobase.o: ./../src/iobase.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_dll_serport.o: ./../src/win32/serport.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_dll_timer.o: ./../src/win32/timer.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\wxctb_dll_gpib.o: ./../src/gpib.cpp + $(CXX) -c -o $@ $(WXCTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctbtest_ctbtest.o: ./../samples/ctbtest.cpp + $(CXX) -c -o $@ $(CTBTEST_CXXFLAGS) $(CPPDEPS) $< + +.PHONY: all clean + + +# Dependencies tracking: +-include $(OUTPUT)/*.d Added: trunk/src/common/libwxctb-0.13/build/makefile.vc =================================================================== --- trunk/src/common/libwxctb-0.13/build/makefile.vc (rev 0) +++ trunk/src/common/libwxctb-0.13/build/makefile.vc 2008-04-07 16:12:27 UTC (rev 871) @@ -0,0 +1,254 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.1.9 (http://bakefile.sourceforge.net) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# C++ compiler +CXX = cl + +# Standard flags for C++ +CXXFLAGS = + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS = + +# Standard linker flags +LDFLAGS = + +# Set to 1 to build debug version [0,1] +DEBUG = 0 + +# +GPIB = 0 + +# +WXDIR = $(WXWIN) + +# +INSTALLDIR = $(WXWIN) + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +WXCTB_LIB_CXXFLAGS = /MT$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \ + $(______DEBUG) /Fd..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.pdb \ + $(__OPTIMIZE_FLAG) /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS) +WXCTB_LIB_OBJECTS = \ + $(OUTPUT)\wxctb_lib_fifo.obj \ + $(OUTPUT)\wxctb_lib_getopt.obj \ + $(OUTPUT)\wxctb_lib_iobase.obj \ + $(OUTPUT)\wxctb_lib_serport.obj \ + $(OUTPUT)\wxctb_lib_timer.obj \ + $(____GPIBSRC_FILENAMES_OBJECTS) +WXCTB_DLL_CXXFLAGS = /MT$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \ + $(______DEBUG) /Fd..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.pdb \ + $(__OPTIMIZE_FLAG) /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS) +WXCTB_DLL_OBJECTS = \ + $(OUTPUT)\wxctb_dll_fifo.obj \ + $(OUTPUT)\wxctb_dll_getopt.obj \ + $(OUTPUT)\wxctb_dll_iobase.obj \ + $(OUTPUT)\wxctb_dll_serport.obj \ + $(OUTPUT)\wxctb_dll_timer.obj \ + $(____GPIBSRC_FILENAMES_1_OBJECTS) +CTBTEST_CXXFLAGS = /MD$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_30_31) \ + $(____DEBUG_2) $(______DEBUG) /Fd$(OUTPUT)\ctbtest.pdb /DGPIB=$(GPIB) \ + /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS) +CTBTEST_OBJECTS = \ + $(OUTPUT)\ctbtest_ctbtest.obj + +### Conditionally set variables: ### + +!if "$(DEBUG)" == "0" +OUTPUT = release +!endif +!if "$(DEBUG)" == "1" +OUTPUT = debug +!endif +!if "$(WXDIR)" == "" +INSTALLDIR = ..\lib +!endif +!if "$(DEBUG)" == "1" && "$(GPIB)" == "0" +LIBFLAG = d +!endif +!if "$(DEBUG)" == "0" && "$(GPIB)" == "1" +LIBFLAG = -gpib +!endif +!if "$(DEBUG)" == "1" && "$(GPIB)" == "1" +LIBFLAG = d-gpib +!endif +!if "$(GPIB)" == "1" +GPIBFLAG = _gpib +!endif +!if "$(GPIB)" == "1" +____GPIBSRC_FILENAMES_OBJECTS = \ + $(OUTPUT)\wxctb_lib_gpib.obj +!endif +!if "$(GPIB)" == "1" +____GPIBSRC_FILENAMES_1_OBJECTS = \ + $(OUTPUT)\wxctb_dll_gpib.obj +!endif +!if "$(DEBUG)" == "0" +____DEBUG_30_31 = /O2 +!endif +!if "$(DEBUG)" == "1" +____DEBUG_30_31 = /Od +!endif +!if "$(DEBUG)" == "0" +__OPTIMIZE_FLAG = /Od +!endif +!if "$(DEBUG)" == "1" +__OPTIMIZE_FLAG = /O2 +!endif +!if "$(DEBUG)" == "0" +____DEBUG = /DNDEBUG +!endif +!if "$(DEBUG)" == "1" +____DEBUG = +!endif +!if "$(DEBUG)" == "0" +____DEBUG_2 = +!endif +!if "$(DEBUG)" == "1" +____DEBUG_2 = /Zi +!endif +!if "$(DEBUG)" == "0" +____DEBUG_3 = +!endif +!if "$(DEBUG)" == "1" +____DEBUG_3 = /DEBUG +!endif +!if "$(DEBUG)" == "0" +______DEBUG = +!endif +!if "$(DEBUG)" == "1" +______DEBUG = /D_DEBUG +!endif +!if "$(DEBUG)" == "0" +____DEBUG_4 = +!endif +!if "$(DEBUG)" == "1" +____DEBUG_4 = d +!endif +!if "$(GPIB)" == "1" +__SYSLIB2_p = gpib32.lib +!endif + + +all: $(OUTPUT) +$(OUTPUT): + -if not exist $(OUTPUT) mkdir $(OUTPUT) + +### Targets: ### + +all: ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll $(OUTPUT)\ctbtest.exe tip-win32 + +clean: + -if exist $(OUTPUT)\*.obj del $(OUTPUT)\*.obj + -if exist $(OUTPUT)\*.res del $(OUTPUT)\*.res + -if exist $(OUTPUT)\*.pch del $(OUTPUT)\*.pch + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.ilk del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.ilk + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.pdb del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.pdb + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib + -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe + -if exist $(OUTPUT)\ctbtest.ilk del $(OUTPUT)\ctbtest.ilk + -if exist $(OUTPUT)\ctbtest.pdb del $(OUTPUT)\ctbtest.pdb + +..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib: $(WXCTB_LIB_OBJECTS) + if exist $@ del $@ + link /LIB /NOLOGO /OUT:$@ @<< + $(WXCTB_LIB_OBJECTS) +<< + +..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll: $(WXCTB_DLL_OBJECTS) + link /DLL /NOLOGO /OUT:$@ $(LDFLAGS) $(____DEBUG_3) /LIBPATH:..\lib @<< + $(WXCTB_DLL_OBJECTS) winmm.lib $(__SYSLIB2_p) /IMPLIB:..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib +<< + +$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib + link /NOLOGO /OUT:$@ $(LDFLAGS) $(____DEBUG_3) /LIBPATH:..\lib @<< + $(CTBTEST_OBJECTS) ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib winmm.lib $(__SYSLIB2_p) +<< + +wxinstall: + @copy ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib $(INSTALLDIR)\lib\vc_lib + @copy ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll $(INSTALLDIR)\lib\vc_lib + + @if not exist $(INSTALLDIR)\include\wx\ctb-0.13\win32 mkdir $(INSTALLDIR)\include\wx\ctb-0.13\win32 + @copy ..\include\wx\ctb-0.13\*.h $(INSTALLDIR)\include\wx\ctb-0.13 + @copy ..\include\wx\ctb-0.13\win32\*.h $(INSTALLDIR)\include\wx\ctb-0.13\win32 + +tip-win32: + @echo " " + @echo "================================================================" + @echo " The building of wxctb is finished. If you have an installed " + @echo " wxWidget package (WXWIN must be defined in the enviroment), " + @echo " you'll now have to run: " + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " + @echo " " + @echo " to install the libraries in: " + @echo " $(INSTALLDIR)\lib\vc_lib " + @echo " and the header files in" + @echo " $(INSTALLDIR)\wx\ctb-0.13" + @echo " " + @echo " If you are using another compiler (Borland, Watcom, mingw,...) " + @echo " take a look in the README in this directory! " + @echo " " + @echo " wxctb comes with no guarantees and doesn't claim " + @echo " to be suitable for any purpose. " + @echo "================================================================" + @echo " " + +$(OUTPUT)\wxctb_lib_fifo.obj: .\..\src\fifo.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_lib_getopt.obj: .\..\src\getopt.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_lib_iobase.obj: .\..\src\iobase.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_lib_serport.obj: .\..\src\win32\serport.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_lib_timer.obj: .\..\src\win32\timer.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_lib_gpib.obj: .\..\src\gpib.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_LIB_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_fifo.obj: .\..\src\fifo.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_getopt.obj: .\..\src\getopt.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_iobase.obj: .\..\src\iobase.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_serport.obj: .\..\src\win32\serport.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_timer.obj: .\..\src\win32\timer.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\wxctb_dll_gpib.obj: .\..\src\gpib.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WXCTB_DLL_CXXFLAGS) $** + +$(OUTPUT)\ctbtest_ctbtest.obj: .\..\samples\ctbtest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTBTEST_CXXFLAGS) $** + Added: trunk/src/common/libwxctb-0.13/build/makefile.wat =================================================================== --- trunk/src/common/libwxctb-0.13/build/makefile.wat (rev 0) +++ trunk/src/common/libwxctb-0.13/build/makefile.wat 2008-04-07 16:12:27 UTC (rev 871) @@ -0,0 +1,283 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.1.9 (http://bakefile.sourceforge.net) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# C++ compiler +CXX = wpp386 + +# Standard flags for C++ +CXXFLAGS = + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS = + +# Standard linker flags +LDFLAGS = + +# Set to 1 to build debug version [0,1] +DEBUG = 0 + +# +GPIB = 0 + +# +WXDIR = $(%WXWIN) + +# +INSTALLDIR = $(%WXWIN) + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +# Speed up compilation a bit: +!ifdef __LOADDLL__ +! loaddll wcc wccd +! loaddll wccaxp wccdaxp +! loaddll wcc386 wccd386 +! loaddll wpp wppdi86 +! loaddll wppaxp wppdaxp +! loaddll wpp386 wppd386 +! loaddll wlink wlink +! loaddll wlib wlibd +!endif + +# We need these variables in some bakefile-made rules: +WATCOM_CWD = $+ $(%cdrive):$(%cwd) $- + +### Conditionally set variables: ### + +OUTPUT = +!ifeq DEBUG 0 +OUTPUT = release +!endif +!ifeq DEBUG 1 +OUTPUT = debug +!endif +INSTALLDIR = +!ifeq WXDIR +INSTALLDIR = ..\lib +!endif +LIBFLAG = +!ifeq DEBUG 1 +!ifeq GPIB 0 +LIBFLAG = d +!endif +!endif +!ifeq DEBUG 0 +!ifeq GPIB 1 +LIBFLAG = -gpib +!endif +!endif +!ifeq DEBUG 1 +!ifeq GPIB 1 +LIBFLAG = d-gpib +!endif +!endif +GPIBFLAG = +!ifeq GPIB 1 +GPIBFLAG = _gpib +!endif +____GPIBSRC_FILENAMES_OBJECTS = +!ifeq GPIB 1 +____GPIBSRC_FILENAMES_OBJECTS = & + $(OUTPUT)\wxctb_lib_gpib.obj +!endif +____GPIBSRC_FILENAMES_1_OBJECTS = +!ifeq GPIB 1 +____GPIBSRC_FILENAMES_1_OBJECTS = & + $(OUTPUT)\wxctb_dll_gpib.obj +!endif +____DEBUG_20_21 = +!ifeq DEBUG 0 +____DEBUG_20_21 = -ot -ox +!endif +!ifeq DEBUG 1 +____DEBUG_20_21 = -od +!endif +__OPTIMIZE_FLAG = +!ifeq DEBUG 0 +__OPTIMIZE_FLAG = -od +!endif +!ifeq DEBUG 1 +__OPTIMIZE_FLAG = -ot -ox +!endif +____DEBUG = +!ifeq DEBUG 0 +____DEBUG = -dNDEBUG +!endif +!ifeq DEBUG 1 +____DEBUG = +!endif +____DEBUG_0 = +!ifeq DEBUG 0 +____DEBUG_0 = -d0 +!endif +!ifeq DEBUG 1 +____DEBUG_0 = -d2 +!endif +____DEBUG_2 = +!ifeq DEBUG 0 +____DEBUG_2 = +!endif +!ifeq DEBUG 1 +____DEBUG_2 = debug all +!endif +__SYSLIB2_p = +!ifeq GPIB 1 +__SYSLIB2_p = gpib32.lib +!endif + +### Variables: ### + +WXCTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_0) -bm $(__OPTIMIZE_FLAG) & + -i=..\include $(CPPFLAGS) $(CXXFLAGS) +WXCTB_LIB_OBJECTS = & + $(OUTPUT)\wxctb_lib_fifo.obj & + $(OUTPUT)\wxctb_lib_getopt.obj & + $(OUTPUT)\wxctb_lib_iobase.obj & + $(OUTPUT)\wxctb_lib_serport.obj & + $(OUTPUT)\wxctb_lib_timer.obj & + $(____GPIBSRC_FILENAMES_OBJECTS) +WXCTB_DLL_CXXFLAGS = -bd $(____DEBUG) $(____DEBUG_0) -bm $(__OPTIMIZE_FLAG) & + -i=..\include $(CPPFLAGS) $(CXXFLAGS) +WXCTB_DLL_OBJECTS = & + $(OUTPUT)\wxctb_dll_fifo.obj & + $(OUTPUT)\wxctb_dll_getopt.obj & + $(OUTPUT)\wxctb_dll_iobase.obj & + $(OUTPUT)\wxctb_dll_serport.obj & + $(OUTPUT)\wxctb_dll_timer.obj & + $(____GPIBSRC_FILENAMES_1_OBJECTS) +CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_20_21) $(____DEBUG_0) & + -dGPIB=$(GPIB) -i=..\include $(CPPFLAGS) $(CXXFLAGS) +CTBTEST_OBJECTS = & + $(OUTPUT)\ctbtest_ctbtest.obj + + +all : $(OUTPUT) +$(OUTPUT) : + -if not exist $(OUTPUT) mkdir $(OUTPUT) + +### Targets: ### + +all : .SYMBOLIC ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll $(OUTPUT)\ctbtest.exe tip-win32 + +clean : .SYMBOLIC + -if exist $(OUTPUT)\*.obj del $(OUTPUT)\*.obj + -if exist $(OUTPUT)\*.res del $(OUTPUT)\*.res + -if exist $(OUTPUT)\*.lbc del $(OUTPUT)\*.lbc + -if exist $(OUTPUT)\*.ilk del $(OUTPUT)\*.ilk + -if exist $(OUTPUT)\*.pch del $(OUTPUT)\*.pch + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll + -if exist ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib del ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib + -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe + +..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib : $(WXCTB_LIB_OBJECTS) + @%create $(OUTPUT)\wxctb_lib.lbc + @for %i in ($(WXCTB_LIB_OBJECTS)) do @%append $(OUTPUT)\wxctb_lib.lbc +%i + wlib -q -p4096 -n -b $^@ @$(OUTPUT)\wxctb_lib.lbc + +..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll : $(WXCTB_DLL_OBJECTS) + @%create $(OUTPUT)\wxctb_dll.lbc + @%append $(OUTPUT)\wxctb_dll.lbc option quiet + @%append $(OUTPUT)\wxctb_dll.lbc name $^@ + @%append $(OUTPUT)\wxctb_dll.lbc option caseexact + @%append $(OUTPUT)\wxctb_dll.lbc $(LDFLAGS) $(____DEBUG_2) libpath ..\lib + @for %i in ($(WXCTB_DLL_OBJECTS)) do @%append $(OUTPUT)\wxctb_dll.lbc file %i + @for %i in ( winmm.lib $(__SYSLIB2_p)) do @%append $(OUTPUT)\wxctb_dll.lbc library %i + @%append $(OUTPUT)\wxctb_dll.lbc + @%append $(OUTPUT)\wxctb_dll.lbc system nt_dll + wlink @$(OUTPUT)\wxctb_dll.lbc + wlib -q -n -b ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib +$^@ + +$(OUTPUT)\ctbtest.exe : $(CTBTEST_OBJECTS) ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib + @%create $(OUTPUT)\ctbtest.lbc + @%append $(OUTPUT)\ctbtest.lbc option quiet + @%append $(OUTPUT)\ctbtest.lbc name $^@ + @%append $(OUTPUT)\ctbtest.lbc option caseexact + @%append $(OUTPUT)\ctbtest.lbc $(LDFLAGS) $(____DEBUG_2) libpath ..\lib + @for %i in ($(CTBTEST_OBJECTS)) do @%append $(OUTPUT)\ctbtest.lbc file %i + @for %i in ( ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib winmm.lib $(__SYSLIB2_p)) do @%append $(OUTPUT)\ctbtest.lbc library %i + @%append $(OUTPUT)\ctbtest.lbc + wlink @$(OUTPUT)\ctbtest.lbc + +wxinstall : + @copy ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.lib $(INSTALLDIR)\lib\watcom_lib + @copy ..\lib\wxctb$(LIBFLAG)$(GPIBFLAG)-0.13.dll $(INSTALLDIR)\lib\watcom_lib + + @if not exist $(INSTALLDIR)\include\wx\ctb-0.13\win32 mkdir $(INSTALLDIR)\include\wx\ctb-0.13\win32 + @copy ..\include\wx\ctb-0.13\*.h $(INSTALLDIR)\include\wx\ctb-0.13 + @copy ..\include\wx\ctb-0.13\win32\*.h $(INSTALLDIR)\include\wx\ctb-0.13\win32 + +tip-win32 : + @echo " ... [truncated message content] |
From: <ak...@us...> - 2008-04-07 16:04:59
|
Revision: 870 http://can.svn.sourceforge.net/can/?rev=870&view=rev Author: akhe Date: 2008-04-07 09:04:56 -0700 (Mon, 07 Apr 2008) Log Message: ----------- Added version 0.13 of the cbt libwxctb-0.13 (ver 0.8 will be left for some timer) Added Paths: ----------- trunk/src/common/libwxctb-0.13/ trunk/src/common/libwxctb-0.13/libwxctb-0.13.tar Added: trunk/src/common/libwxctb-0.13/libwxctb-0.13.tar =================================================================== (Binary files differ) Property changes on: trunk/src/common/libwxctb-0.13/libwxctb-0.13.tar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-04-06 19:57:00
|
Revision: 869 http://can.svn.sourceforge.net/can/?rev=869&view=rev Author: akhe Date: 2008-04-06 12:56:56 -0700 (Sun, 06 Apr 2008) Log Message: ----------- Fixed some minor bugs Cleaned up canal.h Modified Paths: -------------- trunk/firmware/arm/str/cantest_str75x_iar/cantest.dep trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.dbgdt trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.wsdt trunk/firmware/common/vscp_serial.c trunk/firmware/common/vscp_serial.h trunk/src/vscp/common/canal.h Modified: trunk/firmware/arm/str/cantest_str75x_iar/cantest.dep =================================================================== --- trunk/firmware/arm/str/cantest_str75x_iar/cantest.dep 2008-03-14 08:05:37 UTC (rev 868) +++ trunk/firmware/arm/str/cantest_str75x_iar/cantest.dep 2008-04-06 19:56:56 UTC (rev 869) @@ -6,202 +6,201 @@ <configuration> <name>Debug</name> <outputs> - <file>$PROJ_DIR$\str75x_lib\inc\75x_can.h</file> - <file>$TOOLKIT_DIR$\lib\dl4t_tl_in.a</file> - <file>$PROJ_DIR$\Debug\Obj\main.o</file> - <file>$PROJ_DIR$\Debug\Exe\cantest.hex</file> - <file>$PROJ_DIR$\Debug\Obj\main.pbi</file> - <file>$PROJ_DIR$\str75x_lib\inc\75x_type.h</file> - <file>$PROJ_DIR$\Debug\Obj\75x_mrcc.pbi</file> - <file>$TOOLKIT_DIR$\lib\shs_l.a</file> + <file>$PROJ_DIR$\75x_conf.h</file> <file>$PROJ_DIR$\Debug\Obj\75x_init.o</file> - <file>$PROJ_DIR$\Debug\Obj\75x_it.pbi</file> - <file>$PROJ_DIR$\Debug\Obj\cantest.pbd</file> - <file>$PROJ_DIR$\Debug\Obj\75x_mrcc.o</file> - <file>$PROJ_DIR$\Debug\Obj\75x_lib.o</file> + <file>$TOOLKIT_DIR$\lib\dl4t_tl_in.a</file> <file>$PROJ_DIR$\Debug\Obj\75x_gpio.pbi</file> - <file>$PROJ_DIR$\linker\STR75x_FLASH.icf</file> - <file>$PROJ_DIR$\Debug\Obj\75x_can.pbi</file> - <file>$PROJ_DIR$\str75x_lib\src\75x_can.c</file> - <file>$PROJ_DIR$\Debug\Obj\75x_can.o</file> - <file>$PROJ_DIR$\Debug\Obj\75x_lib.pbi</file> - <file>$PROJ_DIR$\Debug\Obj\75x_eic.pbi</file> <file>$PROJ_DIR$\str75x_lib\src\75x_gpio.c</file> + <file>$TOOLKIT_DIR$\lib\shs_l.a</file> + <file>$PROJ_DIR$\Debug\Obj\75x_mrcc.pbi</file> <file>$PROJ_DIR$\Debug\Exe\cantest.out</file> - <file>$PROJ_DIR$\str75x_lib\inc\75x_eic.h</file> - <file>$PROJ_DIR$\Debug\Obj\75x_eic.o</file> + <file>$PROJ_DIR$\str75x_lib\inc\75x_type.h</file> + <file>$PROJ_DIR$\Debug\Obj\main.pbi</file> + <file>$PROJ_DIR$\linker\STR75x_FLASH.icf</file> + <file>$PROJ_DIR$\Debug\Obj\75x_lib.o</file> + <file>$PROJ_DIR$\Debug\Obj\75x_it.pbi</file> + <file>$PROJ_DIR$\main.c</file> + <file>$PROJ_DIR$\Startup\75x_vect.s</file> + <file>$PROJ_DIR$\str75x_lib\src\75x_can.c</file> + <file>$PROJ_DIR$\str75x_lib\inc\75x_can.h</file> <file>$PROJ_DIR$\str75x_lib\inc\75x_lib.h</file> - <file>$PROJ_DIR$\str75x_lib\inc\75x_gpio.h</file> + <file>$PROJ_DIR$\Debug\Obj\75x_mrcc.o</file> + <file>$PROJ_DIR$\str75x_lib\src\75x_mrcc.c</file> + <file>$PROJ_DIR$\Debug\Obj\75x_vect.o</file> <file>$PROJ_DIR$\str75x_lib\inc\75x_map.h</file> <file>$PROJ_DIR$\str75x_lib\inc\75x_mrcc.h</file> + <file>$PROJ_DIR$\Debug\Obj\cantest.pbd</file> + <file>$PROJ_DIR$\Debug\Obj\75x_eic.o</file> + <file>$PROJ_DIR$\75x_it.c</file> + <file>$PROJ_DIR$\Startup\75x_init.s</file> + <file>$PROJ_DIR$\Debug\Exe\cantest.hex</file> + <file>$PROJ_DIR$\str75x_lib\inc\75x_gpio.h</file> <file>$TOOLKIT_DIR$\lib\rt4t_al.a</file> - <file>$PROJ_DIR$\Debug\Obj\75x_it.o</file> + <file>$PROJ_DIR$\str75x_lib\inc\75x_eic.h</file> + <file>$PROJ_DIR$\Debug\Obj\75x_eic.pbi</file> + <file>$PROJ_DIR$\Debug\Obj\main.o</file> <file>$PROJ_DIR$\str75x_lib\src\75x_eic.c</file> - <file>$PROJ_DIR$\main.c</file> - <file>$PROJ_DIR$\Debug\Obj\75x_vect.o</file> - <file>$PROJ_DIR$\75x_conf.h</file> - <file>$PROJ_DIR$\Startup\75x_vect.s</file> + <file>$PROJ_DIR$\Debug\Obj\75x_it.o</file> + <file>$PROJ_DIR$\Debug\Obj\75x_lib.pbi</file> <file>$PROJ_DIR$\str75x_lib\src\75x_lib.c</file> - <file>$PROJ_DIR$\Startup\75x_init.s</file> - <file>$PROJ_DIR$\str75x_lib\src\75x_mrcc.c</file> - <file>$PROJ_DIR$\75x_it.c</file> - <file>$PROJ_DIR$\..\..\..\common\vscp_serial.c</file> <file>$PROJ_DIR$\Debug\Obj\75x_gpio.o</file> + <file>$PROJ_DIR$\Debug\Obj\75x_can.o</file> + <file>$PROJ_DIR$\Debug\Obj\75x_can.pbi</file> </outputs> <file> - <name>[ROOT_NODE]</name> + <name>$PROJ_DIR$\str75x_lib\src\75x_gpio.c</name> <outputs> <tool> - <name>ILINK</name> - <file> 21</file> + <name>BICOMP</name> + <file> 3</file> </tool> + <tool> + <name>ICCARM</name> + <file> 37</file> + </tool> </outputs> - </file> - <file> - <name>$PROJ_DIR$\Debug\Obj\cantest.pbd</name> <inputs> <tool> - <name>BILINK</name> - <file> 15 19 13 9 18 6 4</file> + <name>BICOMP</name> + <file> 28 21 0 8 22</file> </tool> + <tool> + <name>ICCARM</name> + <file> 28 21 0 8 22</file> + </tool> </inputs> </file> <file> - <name>$PROJ_DIR$\str75x_lib\src\75x_can.c</name> + <name>$PROJ_DIR$\Debug\Exe\cantest.out</name> <outputs> <tool> - <name>BICOMP</name> - <file> 15</file> + <name>OBJCOPY</name> + <file> 27</file> </tool> - <tool> - <name>ICCARM</name> - <file> 17</file> - </tool> </outputs> <inputs> <tool> - <name>BICOMP</name> - <file> 0 26 33 5 27</file> + <name>ILINK</name> + <file> 10 38 24 37 1 34 11 18 20 32 5 29 2</file> </tool> - <tool> - <name>ICCARM</name> - <file> 0 26 33 5 27</file> - </tool> </inputs> </file> <file> - <name>$PROJ_DIR$\str75x_lib\src\75x_gpio.c</name> + <name>$PROJ_DIR$\main.c</name> <outputs> <tool> <name>BICOMP</name> - <file> 13</file> + <file> 9</file> </tool> <tool> <name>ICCARM</name> - <file> 40</file> + <file> 32</file> </tool> </outputs> <inputs> <tool> <name>BICOMP</name> - <file> 25 26 33 5 27</file> + <file> 17 21 0 8 22 16 28 30</file> </tool> <tool> <name>ICCARM</name> - <file> 25 26 33 5 27</file> + <file> 17 21 0 8 22 16 28 30</file> </tool> </inputs> </file> <file> - <name>$PROJ_DIR$\Debug\Exe\cantest.out</name> + <name>$PROJ_DIR$\Startup\75x_vect.s</name> <outputs> <tool> - <name>OBJCOPY</name> - <file> 3</file> + <name>AARM</name> + <file> 20</file> </tool> </outputs> - <inputs> - <tool> - <name>ILINK</name> - <file> 14 17 23 40 8 29 12 11 32 2 7 28 1</file> - </tool> - </inputs> </file> <file> - <name>$PROJ_DIR$\str75x_lib\src\75x_eic.c</name> + <name>$PROJ_DIR$\str75x_lib\src\75x_can.c</name> <outputs> <tool> <name>BICOMP</name> - <file> 19</file> + <file> 39</file> </tool> <tool> <name>ICCARM</name> - <file> 23</file> + <file> 38</file> </tool> </outputs> <inputs> <tool> <name>BICOMP</name> - <file> 22 26 33 5</file> + <file> 16 21 0 8 22</file> </tool> <tool> <name>ICCARM</name> - <file> 22 26 33 5</file> + <file> 16 21 0 8 22</file> </tool> </inputs> </file> <file> - <name>$PROJ_DIR$\main.c</name> + <name>$PROJ_DIR$\str75x_lib\src\75x_mrcc.c</name> <outputs> <tool> <name>BICOMP</name> - <file> 4</file> + <file> 6</file> </tool> <tool> <name>ICCARM</name> - <file> 2</file> + <file> 18</file> </tool> </outputs> <inputs> <tool> <name>BICOMP</name> - <file> 24 26 33 5 27 0 25 22</file> + <file> 22 21 0 8</file> </tool> <tool> <name>ICCARM</name> - <file> 24 26 33 5 27 0 25 22</file> + <file> 22 21 0 8</file> </tool> </inputs> </file> <file> - <name>$PROJ_DIR$\Startup\75x_vect.s</name> + <name>$PROJ_DIR$\Debug\Obj\cantest.pbd</name> + <inputs> + <tool> + <name>BILINK</name> + <file> 39 31 3 12 35 6 9</file> + </tool> + </inputs> + </file> + <file> + <name>[ROOT_NODE]</name> <outputs> <tool> - <name>AARM</name> - <file> 32</file> + <name>ILINK</name> + <file> 7</file> </tool> </outputs> </file> <file> - <name>$PROJ_DIR$\str75x_lib\src\75x_lib.c</name> + <name>$PROJ_DIR$\75x_it.c</name> <outputs> <tool> <name>BICOMP</name> - <file> 18</file> + <file> 12</file> </tool> <tool> <name>ICCARM</name> - <file> 12</file> + <file> 34</file> </tool> </outputs> <inputs> <tool> <name>BICOMP</name> - <file> 24 26 33 5 27 0 25 22</file> + <file> 17 21 0 8 22 16 28 30</file> </tool> <tool> <name>ICCARM</name> - <file> 24 26 33 5 27 0 25 22</file> + <file> 17 21 0 8 22 16 28 30</file> </tool> </inputs> </file> @@ -210,53 +209,53 @@ <outputs> <tool> <name>AARM</name> - <file> 8</file> + <file> 1</file> </tool> </outputs> </file> <file> - <name>$PROJ_DIR$\str75x_lib\src\75x_mrcc.c</name> + <name>$PROJ_DIR$\str75x_lib\src\75x_eic.c</name> <outputs> <tool> <name>BICOMP</name> - <file> 6</file> + <file> 31</file> </tool> <tool> <name>ICCARM</name> - <file> 11</file> + <file> 24</file> </tool> </outputs> <inputs> <tool> <name>BICOMP</name> - <file> 27 26 33 5</file> + <file> 30 21 0 8</file> </tool> <tool> <name>ICCARM</name> - <file> 27 26 33 5</file> + <file> 30 21 0 8</file> </tool> </inputs> </file> <file> - <name>$PROJ_DIR$\75x_it.c</name> + <name>$PROJ_DIR$\str75x_lib\src\75x_lib.c</name> <outputs> <tool> <name>BICOMP</name> - <file> 9</file> + <file> 35</file> </tool> <tool> <name>ICCARM</name> - <file> 29</file> + <file> 11</file> </tool> </outputs> <inputs> <tool> <name>BICOMP</name> - <file> 24 26 33 5 27 0 25 22</file> + <file> 17 21 0 8 22 16 28 30</file> </tool> <tool> <name>ICCARM</name> - <file> 24 26 33 5 27 0 25 22</file> + <file> 17 21 0 8 22 16 28 30</file> </tool> </inputs> </file> Modified: trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.dbgdt =================================================================== --- trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.dbgdt 2008-03-14 08:05:37 UTC (rev 868) +++ trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.dbgdt 2008-04-06 19:56:56 UTC (rev 869) @@ -27,7 +27,7 @@ - <Wnd3> + <Wnd0> <Tabs> <Tab> <Identity>TabID-14394-3889</Identity> @@ -43,7 +43,7 @@ </Tab> </Tabs> - <SelectedTab>0</SelectedTab></Wnd3><Wnd4> + <SelectedTab>0</SelectedTab></Wnd0><Wnd1> <Tabs> <Tab> <Identity>TabID-25142-3892</Identity> @@ -55,7 +55,7 @@ </Tab> </Tabs> - <SelectedTab>0</SelectedTab></Wnd4><Wnd5> + <SelectedTab>0</SelectedTab></Wnd1><Wnd2> <Tabs> <Tab> <Identity>TabID-3123-3895</Identity> @@ -65,20 +65,20 @@ </Tab> </Tabs> - <SelectedTab>0</SelectedTab></Wnd5></Windows> + <SelectedTab>0</SelectedTab></Wnd2></Windows> <Editor> - <Pane><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\main.c</Filename><XPos>0</XPos><YPos>287</YPos><SelStart>7812</SelStart><SelEnd>7812</SelEnd></Tab><ActiveTab>0</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str73x_iar\main.c</Filename><XPos>0</XPos><YPos>116</YPos><SelStart>1620</SelStart><SelEnd>1620</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\str75x_lib\src\75x_can.c</Filename><XPos>0</XPos><YPos>443</YPos><SelStart>21143</SelStart><SelEnd>21143</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\Startup\75x_init.s</Filename><XPos>0</XPos><YPos>91</YPos><SelStart>4272</SelStart><SelEnd>4272</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\common\vscp_serial.h</Filename><XPos>0</XPos><YPos>139</YPos><SelStart>3033</SelStart><SelEnd>3033</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\common\vscp_serial.c</Filename><XPos>0</XPos><YPos>110</YPos><SelStart>8871</SelStart><SelEnd>8871</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\pic\can4vscp_232\project\main.c</Filename><XPos>0</XPos><YPos>449</YPos><SelStart>10491</SelStart><SelEnd>10727</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\pic\can4vscp_232\project\serint.c</Filename><XPos>0</XPos><YPos>252</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor> + <Pane><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\main.c</Filename><XPos>0</XPos><YPos>287</YPos><SelStart>7822</SelStart><SelEnd>7822</SelEnd></Tab><ActiveTab>0</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str73x_iar\main.c</Filename><XPos>0</XPos><YPos>116</YPos><SelStart>1620</SelStart><SelEnd>1620</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\str75x_lib\src\75x_can.c</Filename><XPos>0</XPos><YPos>443</YPos><SelStart>21143</SelStart><SelEnd>21143</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\Startup\75x_init.s</Filename><XPos>0</XPos><YPos>91</YPos><SelStart>4272</SelStart><SelEnd>4272</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\common\vscp_serial.h</Filename><XPos>0</XPos><YPos>139</YPos><SelStart>3033</SelStart><SelEnd>3033</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\common\vscp_serial.c</Filename><XPos>0</XPos><YPos>110</YPos><SelStart>8871</SelStart><SelEnd>8871</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\pic\can4vscp_232\project\main.c</Filename><XPos>0</XPos><YPos>449</YPos><SelStart>10491</SelStart><SelEnd>10727</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\pic\can4vscp_232\project\serint.c</Filename><XPos>0</XPos><YPos>252</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor> <Positions> - <Top><Row0><Sizes><Toolbar-01353cd8><key>iaridepm.enu1</key></Toolbar-01353cd8></Sizes></Row0><Row1><Sizes><Toolbar-09daed18><key>debuggergui.enu1</key></Toolbar-09daed18></Sizes></Row1></Top><Left><Row0><Sizes><Wnd4><Rect><Top>-2</Top><Left>-2</Left><Bottom>498</Bottom><Right>198</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>195313</sizeHorzCX><sizeHorzCY>290698</sizeHorzCY><sizeVertCX>195313</sizeVertCX><sizeVertCY>726744</sizeVertCY></Rect></Wnd4></Sizes></Row0></Left><Right><Row0><Sizes><Wnd5><Rect><Top>-2</Top><Left>-2</Left><Bottom>498</Bottom><Right>198</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>195313</sizeHorzCX><sizeHorzCY>290698</sizeHorzCY><sizeVertCX>195313</sizeVertCX><sizeVertCY>726744</sizeVertCY></Rect></Wnd5></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>122</Bottom><Right>1026</Right><x>-2</x><y>-2</y><xscreen>1028</xscreen><yscreen>124</yscreen><sizeHorzCX>1003906</sizeHorzCX><sizeHorzCY>180233</sizeHorzCY><sizeVertCX>195313</sizeVertCX><sizeVertCY>290698</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions> + <Top><Row0><Sizes><Toolbar-01353bf8><key>iaridepm.enu1</key></Toolbar-01353bf8></Sizes></Row0><Row1><Sizes><Toolbar-05a17050><key>debuggergui.enu1</key></Toolbar-05a17050></Sizes></Row1></Top><Left><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>498</Bottom><Right>198</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>195313</sizeHorzCX><sizeHorzCY>290698</sizeHorzCY><sizeVertCX>195313</sizeVertCX><sizeVertCY>726744</sizeVertCY></Rect></Wnd1></Sizes></Row0></Left><Right><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>498</Bottom><Right>198</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>195313</sizeHorzCX><sizeHorzCY>290698</sizeHorzCY><sizeVertCX>195313</sizeVertCX><sizeVertCY>726744</sizeVertCY></Rect></Wnd2></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>122</Bottom><Right>1026</Right><x>-2</x><y>-2</y><xscreen>1028</xscreen><yscreen>124</yscreen><sizeHorzCX>1003906</sizeHorzCX><sizeHorzCY>180233</sizeHorzCY><sizeVertCX>195313</sizeVertCX><sizeVertCY>290698</sizeVertCY></Rect></Wnd0></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions> </Desktop> </Project> Modified: trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.wsdt =================================================================== --- trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.wsdt 2008-03-14 08:05:37 UTC (rev 868) +++ trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.wsdt 2008-04-06 19:56:56 UTC (rev 869) @@ -25,7 +25,7 @@ <Windows> - <Wnd2> + <Wnd0> <Tabs> <Tab> <Identity>TabID-32711-27921</Identity> @@ -37,7 +37,7 @@ </Tab> </Tabs> - <SelectedTab>0</SelectedTab></Wnd2><Wnd3> + <SelectedTab>0</SelectedTab></Wnd0><Wnd1> <Tabs> <Tab> <Identity>TabID-18303-27987</Identity> @@ -47,20 +47,20 @@ </Tab> <Tab><Identity>TabID-7248-23799</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs> - <SelectedTab>0</SelectedTab></Wnd3></Windows> + <SelectedTab>0</SelectedTab></Wnd1></Windows> <Editor> - <Pane><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\main.c</Filename><XPos>0</XPos><YPos>287</YPos><SelStart>7812</SelStart><SelEnd>7812</SelEnd></Tab><ActiveTab>0</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str73x_iar\main.c</Filename><XPos>0</XPos><YPos>116</YPos><SelStart>1620</SelStart><SelEnd>1620</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\str75x_lib\src\75x_can.c</Filename><XPos>0</XPos><YPos>443</YPos><SelStart>21143</SelStart><SelEnd>21143</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\Startup\75x_init.s</Filename><XPos>0</XPos><YPos>91</YPos><SelStart>4272</SelStart><SelEnd>4272</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\common\vscp_serial.h</Filename><XPos>0</XPos><YPos>139</YPos><SelStart>3033</SelStart><SelEnd>3033</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\common\vscp_serial.c</Filename><XPos>0</XPos><YPos>110</YPos><SelStart>8871</SelStart><SelEnd>8871</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\pic\can4vscp_232\project\main.c</Filename><XPos>0</XPos><YPos>449</YPos><SelStart>10491</SelStart><SelEnd>10727</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\pic\can4vscp_232\project\serint.c</Filename><XPos>0</XPos><YPos>252</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor> + <Pane><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\main.c</Filename><XPos>0</XPos><YPos>287</YPos><SelStart>7822</SelStart><SelEnd>7822</SelEnd></Tab><ActiveTab>0</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str73x_iar\main.c</Filename><XPos>0</XPos><YPos>116</YPos><SelStart>1620</SelStart><SelEnd>1620</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\str75x_lib\src\75x_can.c</Filename><XPos>0</XPos><YPos>443</YPos><SelStart>21143</SelStart><SelEnd>21143</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\arm\str\cantest_str75x_iar\Startup\75x_init.s</Filename><XPos>0</XPos><YPos>91</YPos><SelStart>4272</SelStart><SelEnd>4272</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\common\vscp_serial.h</Filename><XPos>0</XPos><YPos>139</YPos><SelStart>3033</SelStart><SelEnd>3033</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\common\vscp_serial.c</Filename><XPos>0</XPos><YPos>110</YPos><SelStart>8871</SelStart><SelEnd>8871</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\pic\can4vscp_232\project\main.c</Filename><XPos>0</XPos><YPos>449</YPos><SelStart>10491</SelStart><SelEnd>10727</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>D:\development\vscp\firmware\pic\can4vscp_232\project\serint.c</Filename><XPos>0</XPos><YPos>252</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor> <Positions> - <Top><Row0><Sizes><Toolbar-01353cd8><key>iaridepm.enu1</key></Toolbar-01353cd8></Sizes></Row0><Row1><Sizes/></Row1></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>446</Bottom><Right>282</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>195313</sizeHorzCX><sizeHorzCY>290698</sizeHorzCY><sizeVertCX>277344</sizeVertCX><sizeVertCY>651163</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1026</Right><x>-2</x><y>-2</y><xscreen>1028</xscreen><yscreen>200</yscreen><sizeHorzCX>1003906</sizeHorzCX><sizeHorzCY>290698</sizeHorzCY><sizeVertCX>195313</sizeVertCX><sizeVertCY>290698</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions> + <Top><Row0><Sizes><Toolbar-01353bf8><key>iaridepm.enu1</key></Toolbar-01353bf8></Sizes></Row0><Row1><Sizes/></Row1></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>446</Bottom><Right>282</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>195313</sizeHorzCX><sizeHorzCY>290698</sizeHorzCY><sizeVertCX>277344</sizeVertCX><sizeVertCY>651163</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1026</Right><x>-2</x><y>-2</y><xscreen>1028</xscreen><yscreen>200</yscreen><sizeHorzCX>1003906</sizeHorzCX><sizeHorzCY>290698</sizeHorzCY><sizeVertCX>195313</sizeVertCX><sizeVertCY>290698</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions> </Desktop> </Workspace> Modified: trunk/firmware/common/vscp_serial.c =================================================================== --- trunk/firmware/common/vscp_serial.c 2008-03-14 08:05:37 UTC (rev 868) +++ trunk/firmware/common/vscp_serial.c 2008-04-06 19:56:56 UTC (rev 869) @@ -491,7 +491,9 @@ // vs_initSlidingWndFrames // -void vs_initSlidingWndFrames( vs_swStruct *pSlide ) +void vs_initSlidingWndFrames( vs_swStruct *pSlide, + uint32_t timeout, + uint8_t resend ) { int i; @@ -500,8 +502,9 @@ pSlide->Frames[ i ].send_count = 0; } - vs_cntSlidingWndFrames = 0; - + pSlide->cntOutstanding = 0; + pSlide->maxresend = resend; + pSlide->maxtime = timeout; } @@ -527,13 +530,35 @@ return NULL; } +/////////////////////////////////////////////////////////////////////////////// +// vs_findFreeFlyingFrame +// +vs_swFrameStruct * +vs_findFreeFlyingFrame( vs_swStruct *pSlide ) +{ + int i; + + if ( pSlide->cntOutstanding >= VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES ) { + return NULL; + } + + for ( i=0; i<VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES; i++ ) { + if ( ( 0 == pSlide->Frames[ i ].timestamp ) && + ( 0 == pSlide->Frames[ i ].send_count ) ) { + return &( pSlide->Frames[ i ] ); + } + } + + return NULL; +} + /////////////////////////////////////////////////////////////////////////////// // vs_addSlidingWndFrame // BOOL vs_addSlidingWndFrame( vs_swStruct *pSlide, - vs_swFrameStruct *pFrame, + vs_frame *pFrame, uint32_t now ) { int i; @@ -548,7 +573,7 @@ if ( 0 == pSlide->Frames[ i ].timestamp ) { memcpy( &pSlide->Frames[ i ].frame, pFrame, - sizeof( vs_swStruct ) ); + sizeof( vs_frame ) ); pSlide->Frames[ i ].timestamp = now; pSlide->Frames[ i ].send_count = 0; pSlide->cntOutstanding++; // Another frame added @@ -576,7 +601,7 @@ ( seqnumber == pSlide->Frames[ i ].frame.seqnumber ) ) { pSlide->Frames[ i ].timestamp = 0; pSlide->Frames[ i ].send_count = 0; - pSlide->cntOutstanding++; // Another frame removed + pSlide->cntOutstanding--; // Another frame removed return TRUE; } } @@ -596,7 +621,10 @@ uint32_t diff; for ( i=0; i<VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES; i++ ) { - diff = pSlide->Frames[ i ].timestamp - now; + // Skip unused positions + if ( 0 == pSlide->Frames[ i ].timestamp ) continue; + + diff = now - pSlide->Frames[ i ].timestamp; if ( diff > pSlide->maxtime ) { if ( pSlide->Frames[ i ].send_count > pSlide->maxresend ) { // Abort sending of this frame Modified: trunk/firmware/common/vscp_serial.h =================================================================== --- trunk/firmware/common/vscp_serial.h 2008-03-14 08:05:37 UTC (rev 868) +++ trunk/firmware/common/vscp_serial.h 2008-04-06 19:56:56 UTC (rev 869) @@ -263,14 +263,44 @@ #ifdef VSCP_SERIAL_ENABLE_SLIDING_WINDOWS +/*! + Initialize the sliding window structure. + @param pSlide Pointer to the sliding window struccture. + @param timeout Timeout value in milliseconds. + @param resend Number of times to resend a frame before giving up. +*/ +void vs_initSlidingWndFrames( vs_swStruct *pSlide, + uint32_t timeout, + uint8_t resend ); /*! + Find a specific frame + @param pSlide Pointer to the sliding window struccture. + @param channel The channel for the frame. + @param seqnumber Rge sequency number for the frame. + @return Found frame structure or NULL if not found. +*/ +vs_swFrameStruct * +vs_findFlyingFrame( vs_swStruct *pSlide, + uint8_t channel, + uint8_t seqnumber ); + +/*! + Find a position that is not used. + @param pSlide Pointer to the sliding window struccture + @return Frame structure or NULL if no free location found. +*/ + +vs_swFrameStruct * +vs_findFreeFlyingFrame( vs_swStruct *pSlide ); + +/*! Add sliding window frame Frames get added to the structure while waiting for ACK's for them. */ BOOL vs_addSlidingWndFrame( vs_swStruct *pSlide, - vs_swFrameStruct *pFrame, + vs_frame *pFrame, uint32_t now ); /*! Modified: trunk/src/vscp/common/canal.h =================================================================== --- trunk/src/vscp/common/canal.h 2008-03-14 08:05:37 UTC (rev 868) +++ trunk/src/vscp/common/canal.h 2008-04-06 19:56:56 UTC (rev 869) @@ -390,14 +390,17 @@ // * * * * Constants * * * * /// CANAL Open i/f flags -#define CANAL_NONBLOCK 1 // read/write are none blocking +#define CANAL_NONBLOCK 1 + +// read/write are none blocking + /// ID flags -#define CANAL_IDFLAG_STANDARD 0x00000000 // Standard message id (11-bit) -#define CANAL_IDFLAG_EXTENDED 0x00000001 // Extended message id (29-bit) -#define CANAL_IDFLAG_RTR 0x00000002 // RTR-Frame -#define CANAL_IDFLAG_ERROR 0x00000004 // This package is an error indication (id holds error code) -#define CANAL_IDFLAG_SEND 0x80000000 // Reserved for use by application software to indicate send +#define CANAL_IDFLAG_STANDARD 0x00000000 // Standard message id (11-bit) +#define CANAL_IDFLAG_EXTENDED 0x00000001 // Extended message id (29-bit) +#define CANAL_IDFLAG_RTR 0x00000002 // RTR-Frame +#define CANAL_IDFLAG_ERROR 0x00000004 // This package is an error indication (id holds error code) +#define CANAL_IDFLAG_SEND 0x80000000 // Reserved for use by application software to indicate send /// Communicaton speeds #define CANAL_BAUD_USER 0 // User specified (In CANAL i/f DLL). @@ -413,91 +416,91 @@ /// Status codes #define CANAL_STATUS_NONE 0x00000000 -#define CANAL_STATUS_ACTIVE 0x10000000 -#define CANAL_STATUS_PASSIVE 0x40000000 -#define CANAL_STATUS_BUS_OFF 0x80000000 -#define CANAL_STATUS_BUS_WARN 0x40000000 -#define CANAL_STATUS_PHY_FAULT 0x08000000 -#define CANAL_STATUS_PHY_H 0x04000000 -#define CANAL_STATUS_PHY_L 0x02000000 -#define CANAL_STATUS_SLEEPING 0x01000000 -#define CANAL_STATUS_STOPPED 0x00800000 -#define CANAL_STATUS_RECIVE_BUFFER_FULL 0x00400000 // Drivers buffer -#define CANAL_STATUS_TRANSMIT_BUFFER_FULL 0x00200000 // Drivers buffer +#define CANAL_STATUS_ACTIVE 0x10000000 +#define CANAL_STATUS_PASSIVE 0x40000000 +#define CANAL_STATUS_BUS_OFF 0x80000000 +#define CANAL_STATUS_BUS_WARN 0x40000000 +#define CANAL_STATUS_PHY_FAULT 0x08000000 +#define CANAL_STATUS_PHY_H 0x04000000 +#define CANAL_STATUS_PHY_L 0x02000000 +#define CANAL_STATUS_SLEEPING 0x01000000 +#define CANAL_STATUS_STOPPED 0x00800000 +#define CANAL_STATUS_RECIVE_BUFFER_FULL 0x00400000 // Drivers buffer +#define CANAL_STATUS_TRANSMIT_BUFFER_FULL 0x00200000 // Drivers buffer /// Error Codes -#define CANAL_ERROR_SUCCESS 0 // All is OK -#define CANAL_ERROR_BAUDRATE 1 // Baudrate error -#define CANAL_ERROR_BUS_OFF 2 // Bus off error -#define CANAL_ERROR_BUS_PASSIVE 3 // Bus Passive error -#define CANAL_ERROR_BUS_WARNING 4 // Bus warning error -#define CANAL_ERROR_CAN_ID 5 // Invalid CAN ID -#define CANAL_ERROR_CAN_MESSAGE 6 // Invalid CAN message -#define CANAL_ERROR_CHANNEL 7 // Invalid channel -#define CANAL_ERROR_FIFO_EMPTY 8 // FIFO is empty -#define CANAL_ERROR_FIFO_FULL 9 // FIFI is full -#define CANAL_ERROR_FIFO_SIZE 10 // FIFO size error -#define CANAL_ERROR_FIFO_WAIT 11 -#define CANAL_ERROR_GENERIC 12 // Generic error -#define CANAL_ERROR_HARDWARE 13 // Hardware error -#define CANAL_ERROR_INIT_FAIL 14 // Initialization failed -#define CANAL_ERROR_INIT_MISSING 15 -#define CANAL_ERROR_INIT_READY 16 -#define CANAL_ERROR_NOT_SUPPORTED 17 // Not supported -#define CANAL_ERROR_OVERRUN 18 // Overrun -#define CANAL_ERROR_RCV_EMPTY 19 // Receive buffer empty -#define CANAL_ERROR_REGISTER 20 // Register value error -#define CANAL_ERROR_TRM_FULL 21 -#define CANAL_ERROR_ERRFRM_STUFF 22 // Errorframe: stuff error detected -#define CANAL_ERROR_ERRFRM_FORM 23 // Errorframe: form error detected -#define CANAL_ERROR_ERRFRM_ACK 24 // Errorframe: acknowledge error -#define CANAL_ERROR_ERRFRM_BIT1 25 // Errorframe: bit 1 error -#define CANAL_ERROR_ERRFRM_BIT0 26 // Errorframe: bit 0 error -#define CANAL_ERROR_ERRFRM_CRC 27 // Errorframe: CRC error -#define CANAL_ERROR_LIBRARY 28 // Unable to load library -#define CANAL_ERROR_PROCADDRESS 29 // Unable get library proc address -#define CANAL_ERROR_ONLY_ONE_INSTANCE 30 // Only one instance allowed -#define CANAL_ERROR_SUB_DRIVER 31 // Problem with sub driver call -#define CANAL_ERROR_TIMEOUT 32 // Blocking call timeout -#define CANAL_ERROR_NOT_OPEN 33 // The device is not open. -#define CANAL_ERROR_PARAMETER 34 // A parameter is invalid. -#define CANAL_ERROR_MEMORY 35 // Memory exhausted. +#define CANAL_ERROR_SUCCESS 0 // All is OK +#define CANAL_ERROR_BAUDRATE 1 // Baudrate error +#define CANAL_ERROR_BUS_OFF 2 // Bus off error +#define CANAL_ERROR_BUS_PASSIVE 3 // Bus Passive error +#define CANAL_ERROR_BUS_WARNING 4 // Bus warning error +#define CANAL_ERROR_CAN_ID 5 // Invalid CAN ID +#define CANAL_ERROR_CAN_MESSAGE 6 // Invalid CAN message +#define CANAL_ERROR_CHANNEL 7 // Invalid channel +#define CANAL_ERROR_FIFO_EMPTY 8 // FIFO is empty +#define CANAL_ERROR_FIFO_FULL 9 // FIFI is full +#define CANAL_ERROR_FIFO_SIZE 10 // FIFO size error +#define CANAL_ERROR_FIFO_WAIT 11 +#define CANAL_ERROR_GENERIC 12 // Generic error +#define CANAL_ERROR_HARDWARE 13 // Hardware error +#define CANAL_ERROR_INIT_FAIL 14 // Initialization failed +#define CANAL_ERROR_INIT_MISSING 15 +#define CANAL_ERROR_INIT_READY 16 +#define CANAL_ERROR_NOT_SUPPORTED 17 // Not supported +#define CANAL_ERROR_OVERRUN 18 // Overrun +#define CANAL_ERROR_RCV_EMPTY 19 // Receive buffer empty +#define CANAL_ERROR_REGISTER 20 // Register value error +#define CANAL_ERROR_TRM_FULL 21 +#define CANAL_ERROR_ERRFRM_STUFF 22 // Errorframe: stuff error detected +#define CANAL_ERROR_ERRFRM_FORM 23 // Errorframe: form error detected +#define CANAL_ERROR_ERRFRM_ACK 24 // Errorframe: acknowledge error +#define CANAL_ERROR_ERRFRM_BIT1 25 // Errorframe: bit 1 error +#define CANAL_ERROR_ERRFRM_BIT0 26 // Errorframe: bit 0 error +#define CANAL_ERROR_ERRFRM_CRC 27 // Errorframe: CRC error +#define CANAL_ERROR_LIBRARY 28 // Unable to load library +#define CANAL_ERROR_PROCADDRESS 29 // Unable get library proc address +#define CANAL_ERROR_ONLY_ONE_INSTANCE 30 // Only one instance allowed +#define CANAL_ERROR_SUB_DRIVER 31 // Problem with sub driver call +#define CANAL_ERROR_TIMEOUT 32 // Blocking call timeout +#define CANAL_ERROR_NOT_OPEN 33 // The device is not open. +#define CANAL_ERROR_PARAMETER 34 // A parameter is invalid. +#define CANAL_ERROR_MEMORY 35 // Memory exhausted. #define CANAL_ERROR_INTERNAL 36 // Some kind of internal program error -#define CANAL_ERROR_COMMUNICATION 37 // Some kind of communication error +#define CANAL_ERROR_COMMUNICATION 37 // Some kind of communication error -// CANAL commands sent over the pipe interface -#define CANAL_COMMAND_NOOP 0 // No command -#define CANAL_COMMAND_OPEN 1 // Open channel -#define CANAL_COMMAND_CLOSE 2 // Close channel -#define CANAL_COMMAND_SEND 3 // Send message -#define CANAL_COMMAND_RECEIVE 4 // Receive message -#define CANAL_COMMAND_CHECKDATA 5 // Check if data is available -#define CANAL_COMMAND_BAUDRATE 6 // Set Baudrate -#define CANAL_COMMAND_STATUS 7 // Get status -#define CANAL_COMMAND_STATISTICS 8 // Get statistics -#define CANAL_COMMAND_FILTER 9 // Set filter -#define CANAL_COMMAND_MASK 10 // Set mask -#define CANAL_COMMAND_VERSION 11 // CANAL version -#define CANAL_COMMAND_DLL_VERSION 12 // CANAL DLL version -#define CANAL_COMMAND_VENDOR_STRING 13 // CANAL vendor string -#define CANAL_COMMAND_LEVEL 14 // CANAL Level bitarray +// CANAL commands sent over the pipe interface (depricated) +#define CANAL_COMMAND_NOOP 0 // No command +#define CANAL_COMMAND_OPEN 1 // Open channel +#define CANAL_COMMAND_CLOSE 2 // Close channel +#define CANAL_COMMAND_SEND 3 // Send message +#define CANAL_COMMAND_RECEIVE 4 // Receive message +#define CANAL_COMMAND_CHECKDATA 5 // Check if data is available +#define CANAL_COMMAND_BAUDRATE 6 // Set Baudrate +#define CANAL_COMMAND_STATUS 7 // Get status +#define CANAL_COMMAND_STATISTICS 8 // Get statistics +#define CANAL_COMMAND_FILTER 9 // Set filter +#define CANAL_COMMAND_MASK 10 // Set mask +#define CANAL_COMMAND_VERSION 11 // CANAL version +#define CANAL_COMMAND_DLL_VERSION 12 // CANAL DLL version +#define CANAL_COMMAND_VENDOR_STRING 13 // CANAL vendor string +#define CANAL_COMMAND_LEVEL 14 // CANAL Level bitarray -// CANAL responses sent over the pipe interface -#define CANAL_RESPONSE_NONE 0 // -#define CANAL_RESPONSE_SUCCESS 1 // OK message -#define CANAL_RESPONSE_ERROR 2 // ERROR message -#define CANAL_RESPONSE_MESSAGE 3 // Response to read +// CANAL responses sent over the pipe interface (depricated) +#define CANAL_RESPONSE_NONE 0 // +#define CANAL_RESPONSE_SUCCESS 1 // OK message +#define CANAL_RESPONSE_ERROR 2 // ERROR message +#define CANAL_RESPONSE_MESSAGE 3 // Response to read // CANAL error codes sent over the client interface // on error responses -#define CANAL_IFERROR_GENERAL 128 // General error +#define CANAL_IFERROR_GENERAL 128 // General error #define CANAL_IFERROR_UNKNOWN_COMMAND 129 #define CANAL_IFERROR_CHANNEL_OPEN 130 #define CANAL_IFERROR_CHANNEL_CLOSED 131 #define CANAL_IFERROR_SEND_SUCCESS 132 -#define CANAL_IFERROR_SEND_MSG_ALLOCATON 133 +#define CANAL_IFERROR_SEND_MSG_ALLOCATON 133 #define CANAL_IFERROR_BUFFER_EMPTY 134 -#define CANAL_IFERROR_BUFFER_FULL 135 +#define CANAL_IFERROR_BUFFER_FULL 135 #define CANAL_IFERROR_READ_FAILURE 136 #define CANAL_IFERROR_SEND_STORAGE 137 @@ -505,24 +508,24 @@ // * * * TCP/IP FAST mode interface constants // FAST mode primary states -#define CANAL_BINARY_FRAME_TYPE_VSCP 0 // VSCP event -#define CANAL_BINARY_FRAME_TYPE_ERROR 1 // ACK/NACK/errors -#define CANAL_BINARY_FRAME_TYPE_COMMAND 2 // Command frame -#define CANAL_BINARY_FRAME_TYPE_CAN 3 // CAN Frame +#define CANAL_BINARY_FRAME_TYPE_VSCP 0 // VSCP event +#define CANAL_BINARY_FRAME_TYPE_ERROR 1 // ACK/NACK/errors +#define CANAL_BINARY_FRAME_TYPE_COMMAND 2 // Command frame +#define CANAL_BINARY_FRAME_TYPE_CAN 3 // CAN Frame #define CANAL_BINARY_COMMAND_NOOP 0 // No operation #define CANAL_BINARY_COMMAND_READ 1 // Read one frame -#define CANAL_BINARY_COMMAND_CLOSE 2 // Close communication channel +#define CANAL_BINARY_COMMAND_CLOSE 2 // Close communication channel // FAST error codes #define CANAL_BINARY_ERROR_NONE 0 // OK -#define CANAL_BINARY_ERROR_GENERAL 1 // General error -#define CANAL_BINARY_ERROR_TO_SMALL 2 // Packet smaller then min packet +#define CANAL_BINARY_ERROR_GENERAL 1 // General error +#define CANAL_BINARY_ERROR_TO_SMALL 2 // Packet smaller then min packet #define CANAL_BINARY_ERROR_FORMAT 3 // Packet have bad format -#define CANAL_BINARY_ERROR_UNKNOW_FRAME 4 // Unknown frame type +#define CANAL_BINARY_ERROR_UNKNOW_FRAME 4 // Unknown frame type #define CANAL_BINARY_ERROR_MEMORY 5 // No room for event -#define CANAL_BINARY_ERROR_NO_DATA 6 // No data available -#define CANAL_BINARY_ERROR_INVALID_CMD 7 // Command not recognized. +#define CANAL_BINARY_ERROR_NO_DATA 6 // No data available +#define CANAL_BINARY_ERROR_INVALID_CMD 7 // Command not recognized. // Filter mask settings #define CANUSB_ACCEPTANCE_FILTER_ALL 0x00000000 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-03-14 08:05:42
|
Revision: 868 http://can.svn.sourceforge.net/can/?rev=868&view=rev Author: akhe Date: 2008-03-14 01:05:37 -0700 (Fri, 14 Mar 2008) Log Message: ----------- Fixed some bugs in VSCP serial routines. Fixed bug in str75x CAN library Modified Paths: -------------- trunk/firmware/arm/str/cantest_str75x_iar/str75x_lib/src/75x_can.c trunk/firmware/arm/str/common/str75x_lib/src/75x_can.c trunk/firmware/common/inttypes.h trunk/firmware/common/vscp_serial.c trunk/firmware/common/vscp_serial.h trunk/src/common/com_win32.cpp trunk/src/vscp/common/canal.h Property Changed: ---------------- trunk/src/vscp/ trunk/src/vscp/vscpworks/ Modified: trunk/firmware/arm/str/cantest_str75x_iar/str75x_lib/src/75x_can.c =================================================================== --- trunk/firmware/arm/str/cantest_str75x_iar/str75x_lib/src/75x_can.c 2008-03-01 15:26:59 UTC (rev 867) +++ trunk/firmware/arm/str/cantest_str75x_iar/str75x_lib/src/75x_can.c 2008-03-14 08:05:37 UTC (rev 868) @@ -417,9 +417,11 @@ } else { - /* extended ID*/ - CAN->sMsgObj[0].A1R = EXT_FIXED_ID_ARB_L(pCanMsg->Id); - CAN->sMsgObj[0].A2R = (CAN->sMsgObj[0].A2R & 0xE000) | EXT_FIXED_ID_ARB_H(pCanMsg->Id); + /* extended ID AKHE*/ + //CAN->sMsgObj[0].A1R = EXT_FIXED_ID_ARB_L(pCanMsg->Id); + //CAN->sMsgObj[0].A2R = (CAN->sMsgObj[0].A2R & 0xE000) | EXT_FIXED_ID_ARB_H(pCanMsg->Id); + CAN->sMsgObj[0].A1R = pCanMsg->Id & 0xffff; + CAN->sMsgObj[0].A2R = (CAN->sMsgObj[0].A2R & 0xE000) | ( ( pCanMsg->Id >> 16 ) & 0xffff); } CAN->sMsgObj[0].MCR = (CAN->sMsgObj[0].MCR & 0xFEF0) | CAN_MCR_NEWDAT | CAN_MCR_TXRQST | pCanMsg->Dlc; @@ -483,11 +485,12 @@ } else { - /* extended ID*/ + /* extended ID AKHE*/ pCanMsg->IdType = CAN_EXT_ID; - pCanMsg->Id = ((CAN->sMsgObj[1].A2R >> 2) & 0x07FF); - pCanMsg->Id |= ((u32)CAN->sMsgObj[1].A1R << 11); - pCanMsg->Id |= (((u32)CAN->sMsgObj[1].A2R & 0x0003) << 27); + //pCanMsg->Id = ((CAN->sMsgObj[1].A2R >> 2) & 0x07FF); + //pCanMsg->Id |= ((u32)CAN->sMsgObj[1].A1R << 11); + //pCanMsg->Id |= (((u32)CAN->sMsgObj[1].A2R & 0x0003) << 27); + pCanMsg->Id = CAN->sMsgObj[1].A1R + ( ( CAN->sMsgObj[1].A2R & 0x1fff ) >> 16 ); } pCanMsg->Dlc = CAN->sMsgObj[1].MCR & 0x0F; @@ -559,9 +562,11 @@ } else { - /* extended ID*/ - CAN->sMsgObj[0].A1R = EXT_FIXED_ID_ARB_L(pCanMsg->Id); - CAN->sMsgObj[0].A2R = ((CAN->sMsgObj[0].A2R) & 0xE000) | EXT_FIXED_ID_ARB_H(pCanMsg->Id); + /* extended ID AKHE*/ + //CAN->sMsgObj[0].A1R = EXT_FIXED_ID_ARB_L(pCanMsg->Id); + //CAN->sMsgObj[0].A2R = ((CAN->sMsgObj[0].A2R) & 0xE000) | EXT_FIXED_ID_ARB_H(pCanMsg->Id); + CAN->sMsgObj[0].A1R = pCanMsg->Id & 0xffff; + CAN->sMsgObj[0].A2R = (CAN->sMsgObj[0].A2R & 0xE000) | ( ( pCanMsg->Id >> 16 ) & 0xffff); } CAN->sMsgObj[0].MCR = (CAN->sMsgObj[0].MCR & 0xFCF0) | pCanMsg->Dlc; @@ -614,9 +619,10 @@ { /* extended ID*/ pCanMsg->IdType = CAN_EXT_ID; - pCanMsg->Id = ((CAN->sMsgObj[1].A2R >> 2) & 0x07FF); - pCanMsg->Id |= ((u32)CAN->sMsgObj[1].A1R << 11); - pCanMsg->Id |= (((u32)CAN->sMsgObj[1].A2R & 0x0003) << 27); + //pCanMsg->Id = ((CAN->sMsgObj[1].A2R >> 2) & 0x07FF); + //pCanMsg->Id |= ((u32)CAN->sMsgObj[1].A1R << 11); + //pCanMsg->Id |= (((u32)CAN->sMsgObj[1].A2R & 0x0003) << 27); + pCanMsg->Id = CAN->sMsgObj[1].A1R + ( ( CAN->sMsgObj[1].A2R & 0x1fff ) >> 16 ); } pCanMsg->Dlc = CAN->sMsgObj[1].MCR & 0x0F; Modified: trunk/firmware/arm/str/common/str75x_lib/src/75x_can.c =================================================================== --- trunk/firmware/arm/str/common/str75x_lib/src/75x_can.c 2008-03-01 15:26:59 UTC (rev 867) +++ trunk/firmware/arm/str/common/str75x_lib/src/75x_can.c 2008-03-14 08:05:37 UTC (rev 868) @@ -490,7 +490,7 @@ //pCanMsg->Id = ((CAN->sMsgObj[1].A2R >> 2) & 0x07FF); //pCanMsg->Id |= ((u32)CAN->sMsgObj[1].A1R << 11); //pCanMsg->Id |= (((u32)CAN->sMsgObj[1].A2R & 0x0003) << 27); - pCanMsg->Id = CAN->sMsgObj[1].A1R + ( ( CAN->sMsgObj[1].A2R & 0x1fff ) >> 16 ); + pCanMsg->Id = CAN->sMsgObj[1].A1R + ( ( CAN->sMsgObj[1].A2R & 0x1fff ) >> 16 ); } pCanMsg->Dlc = CAN->sMsgObj[1].MCR & 0x0F; @@ -585,8 +585,8 @@ /* extended ID Fixed AKHE */ //CAN->sMsgObj[0].A1R = EXT_FIXED_ID_ARB_L(pCanMsg->Id); //CAN->sMsgObj[0].A2R = ((CAN->sMsgObj[0].A2R) & 0xE000) | EXT_FIXED_ID_ARB_H(pCanMsg->Id); - CAN->sMsgObj[0].A1R = pCanMsg->Id & 0xffff; - CAN->sMsgObj[0].A2R = (CAN->sMsgObj[0].A2R & 0xE000) | ( ( pCanMsg->Id >> 16 ) & 0xffff); + CAN->sMsgObj[0].A1R = pCanMsg->Id & 0xffff; + CAN->sMsgObj[0].A2R = (CAN->sMsgObj[0].A2R & 0xE000) | ( ( pCanMsg->Id >> 16 ) & 0xffff); } CAN->sMsgObj[0].MCR = (CAN->sMsgObj[0].MCR & 0xFCF0) | pCanMsg->Dlc; @@ -642,7 +642,7 @@ //pCanMsg->Id = ((CAN->sMsgObj[1].A2R >> 2) & 0x07FF); //pCanMsg->Id |= ((u32)CAN->sMsgObj[1].A1R << 11); //pCanMsg->Id |= (((u32)CAN->sMsgObj[1].A2R & 0x0003) << 27); - pCanMsg->Id = CAN->sMsgObj[1].A1R + ( ( CAN->sMsgObj[1].A2R & 0x1fff ) >> 16 ); + pCanMsg->Id = CAN->sMsgObj[1].A1R + ( ( CAN->sMsgObj[1].A2R & 0x1fff ) >> 16 ); } pCanMsg->Dlc = CAN->sMsgObj[1].MCR & 0x0F; Modified: trunk/firmware/common/inttypes.h =================================================================== --- trunk/firmware/common/inttypes.h 2008-03-01 15:26:59 UTC (rev 867) +++ trunk/firmware/common/inttypes.h 2008-03-14 08:05:37 UTC (rev 868) @@ -44,5 +44,4 @@ - #endif Modified: trunk/firmware/common/vscp_serial.c =================================================================== --- trunk/firmware/common/vscp_serial.c 2008-03-01 15:26:59 UTC (rev 867) +++ trunk/firmware/common/vscp_serial.c 2008-03-14 08:05:37 UTC (rev 868) @@ -38,150 +38,173 @@ * ****************************************************************************** */ +#include <stdio.h> +#include <string.h> #include "vscp.h" +#include "vscp_projdefs.h" #include "vscp_serial.h" #include "crc.h" // Globals -uint8_t main_state; // state for the state machine -uint8_t sub_state; // substate for the state machine -uint8_t msgbuffer[15]; // Buffer for current event -uint8_t buffer_cnt; // Character count for buffer -uint8_t checksum; // Packet checksum +uint8_t vs_main_state; // state for the state machine +uint8_t vs_sub_state; // substate for the state machine +uint8_t vs_msgbuffer[ VSCP_SERIAL_BUFFER_SIZE ]; // Buffer for current event +uint8_t vs_buffer_cnt; // Character count for buffer +uint8_t vs_checksum; // Packet checksum -#ifdef VSCP_SERIAL_ENABLE_FLYING_WINDOWS +#ifdef VSCP_SERIAL_ENABLE_SLIDING_WINDOWS // Flying windows frames -uint8_t cntFlyFrames; // Number of outstanding flying frames +uint8_t vs_cntSlidingWndFrames; // Number of outstanding sliding window frames // Array with info about outstanding flying window frames -vscp_serial_flyStruct idFlyFrames[ VSCP_SERIAL_MAX_FLYING_WINDOWS ]; +//vscp_serial_SlidingWndStruct slidingWndFrames[ VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES ]; #endif + /////////////////////////////////////////////////////////////////////////////// // vs_sendchar_subst // -BOOL vs_sendchar_subst( uint8_t b ) +void vs_bufferSerialByte( uint8_t b ) { + if ( vs_buffer_cnt >= VSCP_SERIAL_BUFFER_SIZE ) return; + vs_msgbuffer[ vs_buffer_cnt++ ] = b; +} + + +/////////////////////////////////////////////////////////////////////////////// +// vs_sendchar_subst +// + +BOOL vs_bufferSerialByteSubst( uint8_t *pcsum, uint8_t b ) +{ if ( DLE == b ) { - if ( !vscp_serial_sendchar( DLE ) return FALSE; - if ( !vscp_serial_sendchar( DLE ) return FALSE; + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( DLE ); + *pcsum ^= DLE; // Only one is used for checksum calculations } else { - if ( !vscp_serial_sendchar( b ) return FALSE; + vs_bufferSerialByte( b ); + *pcsum ^= b; } return TRUE; } + /////////////////////////////////////////////////////////////////////////////// // vscp_serial_init // -void vs__init( void ) +void vs_init( void ) { - main_state = VSCP_SERIAL_PROTOCOL_STATE_NONE; - sub_state = VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE; - buffer_cnt = 0; - checksum = 0; + vs_main_state = VSCP_SERIAL_PROTOCOL_STATE_NONE; + vs_sub_state = VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE; + vs_buffer_cnt = 0; + vs_checksum = 0; } /////////////////////////////////////////////////////////////////////////////// // vscp_serial_feed // -BOOL vs__feed( uint8_t b ) +BOOL vs_feed( uint8_t b ) { BOOL rv = FALSE; switch ( b ) { case DLE: // escape - if ( VSCP_SERIAL_PROTOCOL_STATE_NONE == main_state ) { - main_substate = VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE; + if ( VSCP_SERIAL_PROTOCOL_STATE_NONE == vs_main_state ) { + vs_sub_state = VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE; } - else if ( VSCP_SERIAL_PROTOCOL_STATE_PACKET == main_state ) { + else if ( VSCP_SERIAL_PROTOCOL_STATE_PACKET == vs_main_state ) { - if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE == main_substate ) ) { + if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE == vs_sub_state ) { // Second DLE => it's a DLE character - msgbuffer[ buffer_cnt++ ] = DLE; - main_substate = VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE; + vs_msgbuffer[ vs_buffer_cnt++ ] = DLE; + vs_sub_state = VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE; } + else { + vs_sub_state = VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE; + } } break; case STX: // start - if ( ( VSCP_SERIAL_PROTOCOL_STATE_NONE == main_state ) { + if ( VSCP_SERIAL_PROTOCOL_STATE_NONE == vs_main_state ) { - if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE == main_substate ) ) { + if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE == vs_sub_state ) { // Here if waiting for packet and escape has been received. // Start to receive a package - vscp_serial_init(); + vs_init(); + vs_main_state = VSCP_SERIAL_PROTOCOL_STATE_PACKET; } } - else if ( VSCP_SERIAL_PROTOCOL_STATE_PACKET == main_state ) { + else if ( VSCP_SERIAL_PROTOCOL_STATE_PACKET == vs_main_state ) { - if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE == main_substate ) ) { + if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE == vs_sub_state ) { // DLE STX in package - Start all over - vscp_serial_init(); + vs_init(); } - else if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE == main_substate ) ) { + else if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE == vs_sub_state ) { // Just a stray STX - checksum ^= b; - msgbuffer[ buffer_cnt++ ] = b; + vs_checksum ^= b; + vs_msgbuffer[ vs_buffer_cnt++ ] = b; } } break; case ETX: // End - if ( ( VSCP_SERIAL_PROTOCOL_STATE_PACKET == main_state ) { + if ( VSCP_SERIAL_PROTOCOL_STATE_PACKET == vs_main_state ) { - if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE == main_substate ) { + if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE == vs_sub_state ) { + // DLE ETX in package - We have received a packet // Check the packet checksum and return OK - vscp_serial_init(); - - if ( 0 == checksum ) + if ( 0 == vs_checksum ) { rv = TRUE; // Ack the frame - vscp_serial_send_ack( msgbuffer[ 2 ], msgbuffer[ 3 ] ); + vs_sendAck( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); } else { // Nack the frame - vscp_serial_send_ack( msgbuffer[ 2 ], msgbuffer[ 3 ] ); + vs_sendNack( vs_msgbuffer[ 2 ], vs_msgbuffer[ 3 ] ); } + + vs_init(); } - else if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE == main_substate ) { + else if ( VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE == vs_sub_state ) { // Just a stray ETX - checksum ^= b; - msgbuffer[ buffer_cnt++ ] = b; + vs_checksum ^= b; + vs_msgbuffer[ vs_buffer_cnt++ ] = b; } } break; - default; + default: // Receiving packet - if ( VSCP_SERIAL_PROTOCOL_STATE_PACKET == main_state ) { - checksum ^= b; - msgbuffer[ buffer_cnt++ ] = b; + if ( VSCP_SERIAL_PROTOCOL_STATE_PACKET == vs_main_state ) { + vs_checksum ^= b; + vs_msgbuffer[ vs_buffer_cnt++ ] = b; } break; } // Check for buffer overflow - if ( buffer_cnt > VSCP_SWERIAL_FRAME_SIZE ) { + if ( vs_buffer_cnt > VSCP_SERIAL_FRAME_SIZE ) { // Start all over - main_state = VSCP_SERIAL_PROTOCOL_STATE_NONE; - sub_state = VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE; + vs_main_state = VSCP_SERIAL_PROTOCOL_STATE_NONE; + vs_sub_state = VSCP_SERIAL_PROTOCOL_SUBSTATE_NONE; } return rv; @@ -189,139 +212,408 @@ /////////////////////////////////////////////////////////////////////////////// -// vscp_serial_send_ACK +// vs_getFrame // -void vs__get_frame( vscp_serial_frame *pFrame ) +BOOL vs_getFrame( vs_frame *pFrame ) { // Check pointer if ( NULL == pFrame ) return FALSE; - pFrame->opcode = msgbuffer[ 0 ]; - pFrame->flags = msgbuffer[ 1 ]; - pFrame->channel = msgbuffer[ 2 ]; - pFrame->counter = msgbuffer[ 3 ]; - pFrame->vscpclass = msgbuffer[ 4 ]; - pFrame->vscptype = msgbuffer [5 ]; - memcpy( pFrame->data, ( msgbuffer + 6 ), 16 ); + pFrame->opcode = vs_msgbuffer[ 0 ]; + pFrame->flags = vs_msgbuffer[ 1 ]; + pFrame->channel = vs_msgbuffer[ 2 ]; + pFrame->seqnumber = vs_msgbuffer[ 3 ]; + pFrame->vscpclass = vs_msgbuffer[ 4 ]; + pFrame->vscptype = vs_msgbuffer [5 ]; + memcpy( pFrame->data, ( vs_msgbuffer + 6 ), 16 ); + + return TRUE; } /////////////////////////////////////////////////////////////////////////////// -// vscp_serial_send_ACK +// vs_sendAck // -BOOL vs__send_ack( uint8_t channel, uint8_t counter ) +BOOL vs_sendAck( uint8_t channel, uint8_t seqnumber ) { uint8_t checksum = 0; // Start of frame - if ( !vs_sendchar_subst( DLE ) return FALSE; - vscp_serial_sendchar( STX ); + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( STX ); // ACK Code - if ( !vs_sendchar_subst( VSCP_SERIAL_ACK ) return FALSE; - checksum ^= VSCP_SERIAL_ACK; + vs_bufferSerialByteSubst( &checksum, VSCP_SERIAL_OPCODE_ACK ); // Channel - if ( !vs_sendchar_subst( channel ) return FALSE; - checksum ^= channel; + vs_bufferSerialByteSubst( &checksum, channel ); // Counter - if ( !vs_sendchar_subst( counter ) return FALSE; - checksum ^= counter; + vs_bufferSerialByteSubst( &checksum, seqnumber ); // Checksum - if ( !vs_sendchar_subst( checksum ) return FALSE; + vs_bufferSerialByteSubst( &checksum, checksum ); // End of frame - if ( !vs_sendchar_subst( DLE ) return FALSE; - if ( !vs_sendchar_subst( ETX ) return FALSE; + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( ETX ); + // Send the buffer content + if ( !vs_sendBuffer( vs_msgbuffer, vs_buffer_cnt ) ) { + vs_buffer_cnt = 0; + return FALSE; + } + vs_buffer_cnt = 0; + return TRUE; } /////////////////////////////////////////////////////////////////////////////// -// vscp_serial_send_NACK +// vs_sendNack // -BOOL vs__send_nack( uint8_t channel, uint8_t counter ) +BOOL vs_sendNack( uint8_t channel, uint8_t seqnumber ) { uint8_t checksum = 0; // Start of frame - if ( !vs_sendchar_subst( DLE ) return FALSE; - if ( !vs_sendchar_subst( STX ) return FALSE; + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( STX ); // ACK Code - if ( !vs_sendchar_subst( VSCP_SERIAL_NACK ) return FALSE; - checksum ^= VSCP_SERIAL_NACK; + vs_bufferSerialByteSubst( &checksum, VSCP_SERIAL_OPCODE_NACK ); // Channel - if ( !vs_sendchar_subst( channel ) return FALSE; - checksum ^= channel; + vs_bufferSerialByteSubst( &checksum, channel ); // Counter - if ( !vs_sendchar_subst( counter ) return FALSE; - checksum ^= counter; + vs_bufferSerialByteSubst( &checksum, seqnumber ); // Checksum - if ( !vs_sendchar_subst( checksum ) return FALSE; + vs_bufferSerialByteSubst( &checksum, checksum ); // End of frame - if ( !vs_sendchar_subst( DLE ) return FALSE; - if ( !vs_sendchar_subst( ETX ) return FALSE; + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( ETX ); + // Send the buffer content + if ( !vs_sendBuffer( vs_msgbuffer, vs_buffer_cnt ) ) { + vs_buffer_cnt = 0; + return FALSE; + } + + vs_buffer_cnt = 0; + return TRUE; } /////////////////////////////////////////////////////////////////////////////// -// vscp_serial_send_frame +// vs_sendFrame // -BOOL vs__send_frame( vscp_serial_frame *pFrame ) +BOOL vs_sendFrame( vs_frame *pFrame ) { + int i; uint8_t checksum = 0; // Check pointer if ( NULL == pFrame ) return FALSE; // Start of frame - if ( !vs_sendchar_subst( DLE ) return FALSE; - if ( !vs_sendchar_subst( STX ) return FALSE; + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( STX ); // Operation - if ( !vs_sendchar_subst( pFrame->opcode ) return FALSE; - checksum ^= pFrame->opcode; + vs_bufferSerialByteSubst( &checksum, pFrame->opcode ); // Flags - if ( !vs_sendchar_subst( pFrame->flags ) return FALSE; - checksum ^= pFrame->flags; + vs_bufferSerialByteSubst( &checksum, pFrame->flags ); // Channel - if ( !vs_sendchar_subst( pFrame->channel ) return FALSE; - checksum ^= pFrame->channel; + vs_bufferSerialByteSubst( &checksum, pFrame->channel ); // Counter - if ( !vs_sendchar_subst( pFrame->counter ) return FALSE; - checksum ^= pFrame->counter; + vs_bufferSerialByteSubst( &checksum, pFrame->seqnumber ); // VSCP Class - if ( !vs_sendchar_subst( pFrame->vscpclass ) return FALSE; - checksum ^= pFrame->vscpclass; + vs_bufferSerialByteSubst( &checksum, pFrame->vscpclass ); // VSCP type - if ( !vs_sendchar_subst( pFrame->vscptype ) return FALSE; - checksum ^= pFrame->vscptype; + vs_bufferSerialByteSubst( &checksum, pFrame->vscptype ); // data - for ( int i=0; i<(pFrame->flags & 0x0f); i++ ) { - if ( !vs_sendchar_subst( pFrame->data[ i ] ) return FALSE; - checksum ^= pFrame->data[ i ]; + for ( i=0; i < ( pFrame->flags & 0x0f ); i++ ) { + vs_bufferSerialByteSubst( &checksum, pFrame->data[ i ] ); } + + // Checksum + vs_bufferSerialByteSubst( &checksum, checksum ); // End of frame - if ( !vs_sendchar_subst( DLE ) return FALSE; - if ( !vs_sendchar_subst( ETX ) return FALSE; + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( ETX ); + // Send the buffer content + if ( !vs_sendBuffer( vs_msgbuffer, vs_buffer_cnt ) ) { + vs_buffer_cnt = 0; + return FALSE; + } + + vs_buffer_cnt = 0; + return TRUE; -} \ No newline at end of file +} + + +/////////////////////////////////////////////////////////////////////////////// +// vs_sendCommandFrame +// + +BOOL vs_sendCommandFrame( uint8_t channel, + uint8_t seqnumber, + uint8_t count, + uint8_t *pData ) +{ + int i; + uint8_t checksum = 0; + + // Check pointer - Must be at least command byte + if ( NULL == pData ) return FALSE; + + count &= 0x0f; // Max 16 bytes + + // Start of frame + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( STX ); + + // ACK Code + vs_bufferSerialByteSubst( &checksum, VSCP_SERIAL_OPCODE_ERROR ); + + // Flags: Data byte count + vs_bufferSerialByteSubst( &checksum, count ); + + // Channel + vs_bufferSerialByteSubst( &checksum, channel ); + + // Counter + vs_bufferSerialByteSubst( &checksum, seqnumber ); + + for ( i = 0; i<count; i++ ) { + vs_bufferSerialByteSubst( &checksum, pData[ i ] ); + } + + // Checksum + vs_bufferSerialByteSubst( &checksum, checksum ); + + // End of frame + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( ETX ); + + // Send the buffer content + if ( !vs_sendBuffer( vs_msgbuffer, vs_buffer_cnt ) ) { + vs_buffer_cnt = 0; + return FALSE; + } + + vs_buffer_cnt = 0; + + return TRUE; +} + + +/////////////////////////////////////////////////////////////////////////////// +// vs_sendErrorFrame +// + +BOOL vs_sendErrorFrame( uint8_t channel, + uint8_t seqnumber, + uint8_t count, + uint8_t *pData ) +{ + int i; + uint8_t checksum = 0; + + // Check pointer - must at least be error byte + if ( NULL == pData ) return FALSE; + + count &= 0x0f; // Max 16 bytes + + // Start of frame + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( STX ); + + // ACK Code + vs_bufferSerialByteSubst( &checksum, VSCP_SERIAL_OPCODE_ERROR ); + + // Flags: Data byte count + vs_bufferSerialByteSubst( &checksum, count ); + + // Channel + vs_bufferSerialByteSubst( &checksum, channel ); + + // Counter + vs_bufferSerialByteSubst( &checksum, seqnumber ); + + for ( i = 0; i<count; i++ ) { + vs_bufferSerialByteSubst( &checksum, pData[ i ] ); + } + + // Checksum + vs_bufferSerialByteSubst( &checksum, checksum ); + + // End of frame + vs_bufferSerialByte( DLE ); + vs_bufferSerialByte( ETX ); + + // Send the buffer content + if ( !vs_sendBuffer( vs_msgbuffer, vs_buffer_cnt ) ) { + vs_buffer_cnt = 0; + return FALSE; + } + + vs_buffer_cnt = 0; + + return TRUE; +} + + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + + + +#ifdef VSCP_SERIAL_ENABLE_SLIDING_WINDOWS + + +/////////////////////////////////////////////////////////////////////////////// +// vs_initSlidingWndFrames +// + +void vs_initSlidingWndFrames( vs_swStruct *pSlide ) +{ + int i; + + for ( i=0; i<VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES; i++ ) { + pSlide->Frames[ i ].timestamp = 0; + pSlide->Frames[ i ].send_count = 0; + } + + vs_cntSlidingWndFrames = 0; + +} + + + +/////////////////////////////////////////////////////////////////////////////// +// vs_findFlyingFrame +// + +vs_swFrameStruct * +vs_findFlyingFrame( vs_swStruct *pSlide, + uint8_t channel, + uint8_t seqnumber ) +{ + int i; + + for ( i=0; i<VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES; i++ ) { + if ( ( channel == pSlide->Frames[ i ].frame.channel ) && + ( seqnumber == pSlide->Frames[ i ].frame.seqnumber ) ) { + return &( pSlide->Frames[ i ] ); + } + } + + return NULL; +} + + +/////////////////////////////////////////////////////////////////////////////// +// vs_addSlidingWndFrame +// + +BOOL vs_addSlidingWndFrame( vs_swStruct *pSlide, + vs_swFrameStruct *pFrame, + uint32_t now ) +{ + int i; + + // Check pointer + if ( NULL == pSlide ) return FALSE; + + // Check if there is room for another frame + if ( pSlide->cntOutstanding >= VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES ) return FALSE; + + for ( i=0; i<VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES; i++ ) { + if ( 0 == pSlide->Frames[ i ].timestamp ) { + memcpy( &pSlide->Frames[ i ].frame, + pFrame, + sizeof( vs_swStruct ) ); + pSlide->Frames[ i ].timestamp = now; + pSlide->Frames[ i ].send_count = 0; + pSlide->cntOutstanding++; // Another frame added + return TRUE; + } + } + + // No room for a new frame found - strange!!! + return FALSE; +} + + +/////////////////////////////////////////////////////////////////////////////// +// vs_removeSlidingWndFrame +// + +BOOL vs_removeSlidingWndFrame( vs_swStruct *pSlide, + uint8_t channel, + uint8_t seqnumber ) +{ + int i; + + for ( i=0; i<VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES; i++ ) { + if ( ( channel == pSlide->Frames[ i ].frame.channel ) && + ( seqnumber == pSlide->Frames[ i ].frame.seqnumber ) ) { + pSlide->Frames[ i ].timestamp = 0; + pSlide->Frames[ i ].send_count = 0; + pSlide->cntOutstanding++; // Another frame removed + return TRUE; + } + } + + return FALSE; +} + + +/////////////////////////////////////////////////////////////////////////////// +// vs_timeoutSlidingWndFrame +// + +void vs_timeoutSlidingWndFrame( vs_swStruct *pSlide, + uint32_t now ) +{ + int i; + uint32_t diff; + + for ( i=0; i<VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES; i++ ) { + diff = pSlide->Frames[ i ].timestamp - now; + if ( diff > pSlide->maxtime ) { + if ( pSlide->Frames[ i ].send_count > pSlide->maxresend ) { + // Abort sending of this frame + vs_removeSlidingWndFrame( pSlide, + pSlide->Frames[ i ].frame.channel, + pSlide->Frames[ i ].frame.seqnumber ); + } + else { + // Retransmit the frame + if ( vs_sendFrame( &pSlide->Frames[ i ].frame ) ) { + pSlide->Frames[ i ].timestamp = now; + pSlide->Frames[ i ].send_count++; + } + } + } + } +} + + +#endif // Sliding winow \ No newline at end of file Modified: trunk/firmware/common/vscp_serial.h =================================================================== --- trunk/firmware/common/vscp_serial.h 2008-03-01 15:26:59 UTC (rev 867) +++ trunk/firmware/common/vscp_serial.h 2008-03-14 08:05:37 UTC (rev 868) @@ -41,18 +41,28 @@ #ifndef VSCP_SERIAL_H #define VSCP_SERIAL_H -#define VSCP_SERIAL_MAX_FLYING_WINDOWS 5 +#include <inttypes.h> +#ifndef BOOL +#define BOOL int +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE !FALSE +#endif + // Special characters #define DLE 0x10 // Escape character #define STX 0x01 // Start of 'text' #define ETX 0x02 // End of 'text' -#define VSCP_SERIAL_FRAME_SIZE 23 // Max frame size +#define VSCP_SERIAL_FRAME_SIZE 27 // Max frame size +#define VSCP_SERIAL_BUFFER_SIZE VSCP_SERIAL_FRAME_SIZE * 2 -#define VSCP_SERIAL_ACK 252 // Frame ACK Code -#define VSCP_SERIAL_NACK 253 // Frame NACK Code - // Protocol state machine enum { VSCP_SERIAL_PROTOCOL_STATE_NONE, // Wait for packet. @@ -65,50 +75,118 @@ VSCP_SERIAL_PROTOCOL_SUBSTATE_ESCAPE // Escape character received }; +// Predefined serial VSCP opcodes +#define VSCP_SERIAL_OPCODE_NOOP 0 +#define VSCP_SERIAL_OPCODE_LEVEL1_EVENT 1 +#define VSCP_SERIAL_OPCODE_LEVEL2_EVENT 2 +#define VSCP_SERIAL_OPCODE_POLL_EVENT 3 +#define VSCP_SERIAL_OPCODE_NO_EVENT 4 +#define VSCP_SERIAL_OPCODE_RESERVED_DLE 10 +#define VSCP_SERIAL_OPCODE_SENT_ACK 249 +#define VSCP_SERIAL_OPCODE_SENT_NACK 250 +#define VSCP_SERIAL_OPCODE_ACK 251 +#define VSCP_SERIAL_OPCODE_NACK 252 +#define VSCP_SERIAL_OPCODE_ERROR 253 +#define VSCP_SERIAL_OPCODE_RESPONSE 254 +#define VSCP_SERIAL_OPCODE_COMMAND 255 + +// CAN flag bits (uses data byte 0-3 for id and +// bit 32 is Extended id, bit 31 RTR +#define VSCP_SERIAL_CAN_DATA0_EXTENDED 0x80 +#define VSCP_SERIAL_CAN_DATA0_RTR 0x40 + // The serial frame - typedef struct { uint8_t opcode; - uint8_t flags; + uint8_t flags; // bit0-2 data count, bit3 class bit 9 uint8_t channel; - uint8_t counter; + uint8_t seqnumber; uint8_t vscpclass; uint8_t vscptype; uint8_t data[16]; -} vscp_serial_frame; +} vs_frame; -#ifdef VSCP_SERIAL_ENABLE_FLYING_WINDOWS +#ifdef VSCP_SERIAL_ENABLE_SLIDING_WINDOWS -// Flying frame struct +// Sliding window frame structure typedef struct { - uint8_t sendtime; // Time when frame sent - // Zero indicate unused entry - uint8_t id; // id for frame -} vscp_serial_flyStruct; + uint32_t timestamp; // Time when frame sent/received + // Zero indicate unused entry + vs_frame frame; // frame + uint8_t send_count; // # times theframe has been sent +} vs_swFrameStruct; + + +typedef struct { + uint8_t cntOutstanding; // # send but not ACK'd frames + // can be max size_window + uint32_t maxtime; // maxtime waiting for ACK before resend + uint8_t maxresend; // Max # resends before giving up + + vs_swFrameStruct Frames[ VSCP_SERIAL_MAX_SLIDING_WINDOW_FRAMES ]; // Pending frames +} vs_swStruct; + #endif -// External functions +#ifdef __cplusplus + extern "C" { +#endif + +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// The follwing is external functions and should be implemented +// by the program that use this code +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + /*! - Send a character on the serial line + Send a character on the serial line. + If its better to send a chunk of data + just collect data in this routine and + do the actial send with vs_sendFrame. @param b Byte to send. @return TRUE on success, FALSE on failure. */ -BOOL vs_sendbyte( uint8_t b ): +BOOL vs_sendSerialByte( uint8_t b ); +/*! + Send content in buffer. + If its better to send lrger chunks of data such + as a frame use this call to sen dthe data that has + been collected with the vs_sendSerialByte. Do not + implement this function if vs_sendSerialByte actually + send the data. + @param pbuf buffer to send + @param count Pointer to number of bytes to send. + @return TRUE on success, FALSE on failure. +*/ +BOOL vs_sendBuffer( uint8_t *pbuf, uint16_t count ); + + + + + +/////////////////////////////////////////////////////////////////////////////// +// Protocol API +/////////////////////////////////////////////////////////////////////////////// + +/*! + Buffer serial byte without DLE substitution + @param b Byte to send +*/ +void vs_bufferSerialByte( uint8_t b ); -// Protocol functions - /*! Send serial byte with DLE handling + @param psum Pointer to checksum @param b Byte to send - @return TRUE on success, FALSE on failure. */ -BOOL vs_sendchar_subst( uint8_t b ); - +BOOL vs_bufferSerialByteSubst( uint8_t *pcsum, uint8_t b ); + + /*! vscp_serial_init */ @@ -126,29 +204,99 @@ @param pFrame Pointer to frame that will receive data @return TRUE och success. FALSE on failure. */ -BOOL vs_get_frame( vscp_serial_frame *pFrame ); +BOOL vs_getFrame( vs_frame *pFrame ); /*! Send ACK @param channel Channel number ACK is sent for. - @param counter Id for packet whcih is ACK'ed + @param seqnumber Id for packet whcih is ACK'ed @return TRUE och success. FALSE on failure. */ -BOOL vs_send_ACK( uint8_t channel, uint8_t counter ); +BOOL vs_sendAck( uint8_t channel, uint8_t seqnumber ); /*! Send NACK @param channel Channel number NACK is sent for. - @param counter Id for packet which is NACK'ed + @param seqnumber Id for packet which is NACK'ed @return TRUE och success. FALSE on failure. */ -BOOL vs_send_NACK( uint8_t channel, uint8_t counter ); +BOOL vs_sendNack( uint8_t channel, uint8_t seqnumber ); /*! Send serial frame @param pFrame Pointer to serial frame structure @return TRUE och success. FALSE on failure. */ -BOOL vs_send_frame( vscp_serial_frame *pFrame ); +BOOL vs_sendFrame( vs_frame *pFrame ); + +/*! + Send command frame + First byte of data is command code + @param channel Channel number NACK is sent for. + @param seqnumber Id for packet which is NACK'ed + @param count Number of databytes (0-16) + @param pData Pointer to data. + @return TRUE och success. FALSE on failure. +*/ +BOOL vs_sendCommandFrame( uint8_t channel, + uint8_t seqnumber, + uint8_t count, + uint8_t *pData ); + +/*! + Send error frame + First byte of data is error code + @param channel Channel number NACK is sent for. + @param seqnumber Id for packet which is NACK'ed + @param count Number of databytes (0-16) + @param pData Pointer to data. + @return TRUE och success. FALSE on failure. +*/ +BOOL vs_sendErrorFrame( uint8_t channel, + uint8_t seqnumber, + uint8_t count, + uint8_t *pData ); + + + + +#ifdef VSCP_SERIAL_ENABLE_SLIDING_WINDOWS + + +/*! + Add sliding window frame + Frames get added to the structure while waiting for ACK's + for them. +*/ +BOOL vs_addSlidingWndFrame( vs_swStruct *pSlide, + vs_swFrameStruct *pFrame, + uint32_t now ); + +/*! + Remove a sliding window frame + When an ACK is received for a frame it is removed from + the table. +*/ +BOOL vs_removeSlidingWndFrame( vs_swStruct *pSlide, + uint8_t channel, + uint8_t seqnumber ); + +/*! + Check if a frame needs to be retransmitted + This function should be called on regular intervals to + resend frames that has not got ACK's and to remove frames + that has been retransmitted to many times. +*/ +void vs_timeoutSlidingWndFrame( vs_swStruct *pSlide, + uint32_t now ); + +#endif // Sliding Window + + +#ifdef __cplusplus +} +#endif + + #endif // VSCP_SERIAL_H \ No newline at end of file Modified: trunk/src/common/com_win32.cpp =================================================================== --- trunk/src/common/com_win32.cpp 2008-03-01 15:26:59 UTC (rev 867) +++ trunk/src/common/com_win32.cpp 2008-03-14 08:05:37 UTC (rev 868) @@ -155,7 +155,16 @@ return true; } +///////////////////////////////////////////////////////////////////////////// +// close +// +void CComm::close() +{ + CloseHandle( m_hCommPort ); + m_hCommPort = NULL; +} + ///////////////////////////////////////////////////////////////////////////// // readChar // @@ -229,15 +238,7 @@ -///////////////////////////////////////////////////////////////////////////// -// close -// -void CComm::close() -{ - CloseHandle( m_hCommPort ); - m_hCommPort = NULL; -} ///////////////////////////////////////////////////////////////////////////// Property changes on: trunk/src/vscp ___________________________________________________________________ Name: svn:ignore - Deliveryx Delivery *.ncb *.opt delivery deliveryx + Deliveryx Delivery *.ncb *.opt delivery deliveryx VCProjectunicodeDebug Modified: trunk/src/vscp/common/canal.h =================================================================== --- trunk/src/vscp/common/canal.h 2008-03-01 15:26:59 UTC (rev 867) +++ trunk/src/vscp/common/canal.h 2008-03-14 08:05:37 UTC (rev 868) @@ -59,16 +59,16 @@ #define CANAL_MAIN_VERSION 1 #define CANAL_MINOR_VERSION 0 -#define CANAL_SUB_VERSION 6 +#define CANAL_SUB_VERSION 6 // Canal Levels #define CANAL_LEVEL_STANDARD 1 -#define CANAL_LEVEL_USES_TCPIP 2 +#define CANAL_LEVEL_USES_TCPIP 2 // VSCP daemon version information positions -#define POS_VSCPD_MAJOR_VERSION 1 -#define POS_VSCPD_MINOR_VERSION 2 +#define POS_VSCPD_MAJOR_VERSION 1 +#define POS_VSCPD_MINOR_VERSION 2 #define POS_VSCPD_SUB_VERSION 3 @@ -78,19 +78,19 @@ #define CANAL_COMMAND_OPEN_VSCP_CONTROL 3 // Daemon Control channel /// Interprocess success/failure codes -#define COMMAND_FAILURE 0 -#define COMMAND_SUCCESS 1 +#define COMMAND_FAILURE 0 +#define COMMAND_SUCCESS 1 /// Return types -#define PACKAGE_ACK 0 -#define PACKAGE_NACK 1 +#define PACKAGE_ACK 0 +#define PACKAGE_NACK 1 -#define PACKAGE_TIMEOUT -1 -#define PACKAGE_UNKNOWN -1 +#define PACKAGE_TIMEOUT -1 +#define PACKAGE_UNKNOWN -1 -#define PACKAGE_FAILURE 0 -#define PACKAGE_SUCCESS 1 +#define PACKAGE_FAILURE 0 +#define PACKAGE_SUCCESS 1 #ifdef __cplusplus extern "C" { @@ -152,6 +152,13 @@ typedef canalStatus * PCANALSTATUS; +// This is the define for the received callback method +typedef void ( __stdcall * LPFNDLL_RECEIVE_CALLBACK) ( canalMsg *pMsg ); + +// CAN driver open handle +typedef long CANHANDLE; + + // * * * Prototypes /*! @@ -517,6 +524,9 @@ #define CANAL_BINARY_ERROR_NO_DATA 6 // No data available #define CANAL_BINARY_ERROR_INVALID_CMD 7 // Command not recognized. +// Filter mask settings +#define CANUSB_ACCEPTANCE_FILTER_ALL 0x00000000 +#define CANUSB_ACCEPTANCE_MASK_ALL 0xFFFFFFFF #ifdef __cplusplus } Property changes on: trunk/src/vscp/vscpworks ___________________________________________________________________ Name: svn:ignore - DebugMSWUnicode *.bak ReleaseMSWUnicode vscpworks-autosave.pjd *.aps *.ncb *.opt *.tmp *.plg VCProjectUnicodeDebug VCProjectUnicodeRelease VCProjectDebug *.pdb VCProjectunicodeDebug vscpworks.dsw.save.txt VCProjectRelease + DebugMSWUnicode *.bak ReleaseMSWUnicode vscpworks-autosave.pjd *.aps *.ncb *.opt *.tmp *.plg VCProjectUnicodeDebug VCProjectUnicodeRelease VCProjectDebug *.pdb VCProjectunicodeDebug vscpworks.dsw.save.txt VCProjectRelease Makefile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ak...@us...> - 2008-03-01 15:27:04
|
Revision: 867 http://can.svn.sourceforge.net/can/?rev=867&view=rev Author: akhe Date: 2008-03-01 07:26:59 -0800 (Sat, 01 Mar 2008) Log Message: ----------- Fixed timebase for 75x Modified Paths: -------------- trunk/firmware/arm/str/common/sysTime75x.c Modified: trunk/firmware/arm/str/common/sysTime75x.c =================================================================== --- trunk/firmware/arm/str/common/sysTime75x.c 2008-03-01 13:09:07 UTC (rev 866) +++ trunk/firmware/arm/str/common/sysTime75x.c 2008-03-01 15:26:59 UTC (rev 867) @@ -21,13 +21,16 @@ // TB_FlagClear( TB2 ); // -#include "sysTime75x.h" +#include "includes.h" +#include "75x_conf.h" +#include "75x_lib.h" +#include "sysTime.h" -volatile vu32 sysTICs; +volatile Int32U sysTICs; /****************************************************************************** * - * Function Name: initTimebase2() + * Function Name: initTimebase() * * Description: * This function initializes the TB2 for use as the system timer. @@ -39,25 +42,32 @@ * void * *****************************************************************************/ -void initTimebase2(void) +void initTimebase( void ) { TB_InitTypeDef TB_InitStructure; + EIC_IRQInitTypeDef EIC_IRQInitStructure; sysTICs = 0; - CFG_PeripheralClockConfig( CFG_CLK_TB2, ENABLE ); + MRCC_PeripheralClockConfig( MRCC_Peripheral_TB, ENABLE ); // TB2 Configuration to get timbase IRQ each 1ms - TB_InitStructure.TB_CLK_Source = TB_CLK_INTERNAL ; - TB_InitStructure.TB_Prescaler = 50; // The internal TB Frequency = 160KHz - TB_InitStructure.TB_Preload = 160; // 160000Hz * 0.001 s = 160 + TB_InitStructure.TB_ClockSource = TB_ClockSource_CKTIM; + TB_InitStructure.TB_Prescaler = 100; // The internal TB Frequency = 160KHz + TB_InitStructure.TB_AutoReload = 160; // 160000Hz * 0.001 s = 160 - TB_Init( TB2, &TB_InitStructure ); - TB_ITConfig( TB2, ENABLE ); + TB_Init( &TB_InitStructure ); + TB_ITConfig( TB_IT_Update, ENABLE ); - EIC_IRQChannelConfig( TB2_IRQChannel, ENABLE ); // Enable IRQ + //EIC_IRQChannelConfig( TB_IRQChannel, ENABLE ); // Enable IRQ + + // Enable and configure the priority of the TIM0 Output compare IRQ Channel + EIC_IRQInitStructure.EIC_IRQChannel = TB_IRQChannel; + EIC_IRQInitStructure.EIC_IRQChannelPriority = 1; + EIC_IRQInitStructure.EIC_IRQChannelCmd = ENABLE; + EIC_IRQInit( &EIC_IRQInitStructure ); - TB_Cmd( TB2, ENABLE ); // Enable the timer + TB_Cmd( ENABLE ); // Enable the timer } /****************************************************************************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |