mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 14:44:17 +00:00
Merge remote branch 'fsorig/master'
This commit is contained in:
commit
1f08e2b0ec
683 files changed
+43414
-75312
No files matched your search
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
* Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org>
|
||||
* Copyright (C) 2005-2012, Anthony Minessale II <anthm@freeswitch.org>
|
||||
*
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
@@ -748,14 +748,6 @@ static switch_io_routines_t channel_io_routines = {
|
||||
/*.receive_message */ channel_receive_message
|
||||
};
|
||||
|
||||
static switch_endpoint_interface_t channel_endpoint_interface = {
|
||||
/*.interface_name */ "alsa",
|
||||
/*.io_routines */ &channel_io_routines,
|
||||
/*.event_handlers */ &channel_event_handlers,
|
||||
/*.private */ NULL,
|
||||
/*.next */ NULL
|
||||
};
|
||||
|
||||
|
||||
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
|
||||
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
|
||||
@@ -766,7 +758,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||
switch_call_cause_t *cancel_cause)
|
||||
{
|
||||
|
||||
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) {
|
||||
if ((*new_session = switch_core_session_request(alsa_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) {
|
||||
private_t *tech_pvt;
|
||||
switch_channel_t *channel;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
@@ -956,6 +948,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_alsa_shutdown)
|
||||
}
|
||||
switch_core_hash_destroy(&globals.call_hash);
|
||||
|
||||
switch_event_free_subclass(MY_EVENT_RINGING);
|
||||
switch_safe_free(globals.dialplan);
|
||||
switch_safe_free(globals.cid_name);
|
||||
switch_safe_free(globals.cid_num);
|
||||
@@ -1437,7 +1430,7 @@ static switch_status_t place_call(char **argv, int argc, switch_stream_handle_t
|
||||
}
|
||||
dest = argv[0];
|
||||
|
||||
if ((session = switch_core_session_request(&channel_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) {
|
||||
if ((session = switch_core_session_request(alsa_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) {
|
||||
private_t *tech_pvt;
|
||||
switch_channel_t *channel;
|
||||
char *dialplan = globals.dialplan;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
* Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org>
|
||||
* Copyright (C) 2005-2012, Anthony Minessale II <anthm@freeswitch.org>
|
||||
*
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
!/gsmlib/gsmlib-*/aclocal.m4
|
||||
!/gsmlib/gsmlib-*/configure
|
||||
!/gsmlib/gsmlib_1.10.orig.tar.gz
|
||||
@@ -1,9 +1,5 @@
|
||||
MODNAME=mod_gsmopen
|
||||
SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"'
|
||||
#LOCAL_CFLAGS += $(SVNDEF) -I/usr/src/gsmlib-1.10
|
||||
LOCAL_CFLAGS += $(SVNDEF) -I../../../../libs/spandsp/src -I../../../..//libs/tiff-3.8.2/libtiff
|
||||
#LOCAL_LDFLAGS=-lasound -L/usr/src/gsmlib-1.10/gsmlib/.libs -lgsmme
|
||||
LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lasound -lgsmme -lspandsp
|
||||
LOCAL_OBJS=gsmopen_protocol.o
|
||||
#OUR_OBJS += /usr/src/gsmlib-1.10/gsmlib/libgsmme.la
|
||||
LOCAL_CFLAGS += -I../../../../libs/spandsp/src -I../../../..//libs/tiff-3.8.2/libtiff -DGSMOPEN_C_VER=\"`git log -1 --format="%h" gsmopen_protocol.cpp`\" -DMODGSMOPEN_C_VER=\"`git log -1 --format="%h" mod_gsmopen.cpp`\"
|
||||
LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lspandsp -lctb-0.16 -lgsmme
|
||||
LOCAL_OBJS=gsmopen_protocol.o
|
||||
include ../../../../build/modmake.rules
|
||||
@@ -11,9 +11,9 @@ SPANDSP_LA=$(SPANDSP_BUILDDIR)/src/libspandsp.la
|
||||
|
||||
mod_LTLIBRARIES = mod_gsmopen.la
|
||||
mod_gsmopen_la_SOURCES = mod_gsmopen.cpp gsmopen_protocol.cpp
|
||||
mod_gsmopen_la_CFLAGS = $(AM_CFLAGS) -I$(SPANDSP_DIR)/src -I$(TIFF_DIR)/libtiff -I$(SPANDSP_BUILDDIR)/src -I$(TIFF_BUILDDIR)/libtiff -I. -DGSMOPEN_SVN_VERSION=\"`cat $(switch_builddir)/.version`\"
|
||||
mod_gsmopen_la_CFLAGS = $(AM_CFLAGS) -I$(SPANDSP_DIR)/src -I$(TIFF_DIR)/libtiff -I$(SPANDSP_BUILDDIR)/src -I$(TIFF_BUILDDIR)/libtiff -I. -DGSMOPEN_C_VER=\"`git log -1 --format="%h" gsmopen_protocol.cpp`\" -DMODGSMOPEN_C_VER=\"`git log -1 --format="%h" mod_gsmopen.cpp`\"
|
||||
mod_gsmopen_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(SPANDSP_LA) $(TIFF_LA)
|
||||
mod_gsmopen_la_LDFLAGS = -avoid-version -module -no-undefined -lasound -lgsmme
|
||||
mod_gsmopen_la_LDFLAGS = -avoid-version -module -no-undefined -lctb-0.16 -lgsmme
|
||||
|
||||
$(SPANDSP_LA): $(TIFF_LA) $(SPANDSP_DIR) $(SPANDSP_DIR)/.update
|
||||
cd $(SPANDSP_BUILDDIR) && $(MAKE) -j1
|
||||
|
||||
@@ -1,31 +1,9 @@
|
||||
GSMopen, GSM Endpoint and Trunk
|
||||
|
||||
This is just a prototype.
|
||||
|
||||
put this directory in freeswitch.trunk/src/mod/endpoints/
|
||||
|
||||
make clean; make; make install
|
||||
|
||||
Is not getting its configuration from the configuration file, it's all hardcoded but it needs the configuration file.
|
||||
|
||||
Copy gsmopen.conf.xml in /usr/local/freeswitch/conf/autoload_configs/
|
||||
|
||||
You must have the device on serial port /dev/ttyACM0 and the audio as second soundcard plughw:1 (if you do not have a first soundcard, just modprobe snd-dummy before to connect the usb thingy).
|
||||
|
||||
Put the volumes (with alsamixer -c1 -Vall) as: speaker 80, autogain on, mic off, mic capt 0.
|
||||
|
||||
Then, with alsamixer -c1 -Vcapture, be sure capture is active (eg, press the spacebar until the red CAPTURE appear). When it all working, adjust to your taste.
|
||||
|
||||
It answer calls, make calls, receive sms, and send sms (with the CLI command "sendsms").
|
||||
|
||||
Copy ciapalo in /usr/local/bin/ (is the program automatically spawned when an SMS is received).
|
||||
|
||||
Copy asound.conf in /etc/asound.conf, it will spare you cpu cycles when rate conversion is required (always).
|
||||
|
||||
All documentation on compiling, using, configuring,
|
||||
tricks and tweaks, possible problems at:
|
||||
|
||||
http://wiki.freeswitch.org/wiki/GSMopen_GSM_Endpoint_and_Trunk
|
||||
http://wiki.freeswitch.org/wiki/Gsmopen
|
||||
|
||||
Enjoy
|
||||
|
||||
|
||||
File renamed without changes.
+23
@@ -0,0 +1,23 @@
|
||||
<configuration name="gsmopen.conf" description="GSMopen Configuration">
|
||||
<global_settings>
|
||||
<param name="debug" value="8"/>
|
||||
<param name="dialplan" value="XML"/>
|
||||
<param name="context" value="default"/>
|
||||
<param name="hold-music" value="$${moh_uri}"/>
|
||||
<param name="destination" value="9999"/>
|
||||
</global_settings>
|
||||
<!-- one entry here per gsmopen interface -->
|
||||
<per_interface_settings>
|
||||
<interface id="1" name="interface1">
|
||||
<param name="hold-music" value="$${moh_uri}"/>
|
||||
<param name="dialplan" value="XML"/>
|
||||
<param name="context" value="default"/>
|
||||
<param name="destination" value="5000"/>
|
||||
<param name="alsacname" value="plughw:1"/>
|
||||
<param name="alsapname" value="plughw:1"/>
|
||||
<param name="controldevice_name" value="/dev/ttyACM0"/>
|
||||
</interface>
|
||||
<!-- following interfaces are commented out!
|
||||
-->
|
||||
</per_interface_settings>
|
||||
</configuration>
|
||||
File renamed without changes.
File renamed without changes.
@@ -1 +0,0 @@
|
||||
../../gsmopen.h
|
||||
@@ -0,0 +1,665 @@
|
||||
/*
|
||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
* Copyright (C) 2005/2012, Anthony Minessale II <anthm@freeswitch.org>
|
||||
*
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Anthony Minessale II <anthm@freeswitch.org>
|
||||
* Portions created by the Initial Developer are Copyright (C)
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* This module (mod_gsmopen) has been contributed by:
|
||||
*
|
||||
* Giovanni Maruzzelli (gmaruzz@gmail.com)
|
||||
*
|
||||
*
|
||||
* Further Contributors:
|
||||
*
|
||||
*
|
||||
*
|
||||
* mod_gsmopen.c -- GSM compatible Endpoint Module
|
||||
*
|
||||
*/
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
|
||||
#ifdef WIN32
|
||||
#define HAVE_VSNPRINTF
|
||||
#pragma warning(disable: 4290)
|
||||
#endif //WIN32
|
||||
|
||||
#define MY_EVENT_INCOMING_SMS "gsmopen::incoming_sms"
|
||||
#define MY_EVENT_DUMP "gsmopen::dump_event"
|
||||
#define MY_EVENT_ALARM "gsmopen::alarm"
|
||||
|
||||
#define ALARM_FAILED_INTERFACE 0
|
||||
#define ALARM_NO_NETWORK_REGISTRATION 1
|
||||
#define ALARM_ROAMING_NETWORK_REGISTRATION 2
|
||||
#define ALARM_NETWORK_NO_SERVICE 3
|
||||
#define ALARM_NETWORK_NO_SIGNAL 4
|
||||
#define ALARM_NETWORK_LOW_SIGNAL 5
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#undef GIOVA48
|
||||
|
||||
#ifndef GIOVA48
|
||||
#define SAMPLES_PER_FRAME 160
|
||||
#else // GIOVA48
|
||||
#define SAMPLES_PER_FRAME 960
|
||||
#endif // GIOVA48
|
||||
|
||||
|
||||
#ifndef GIOVA48
|
||||
#define GSMOPEN_FRAME_SIZE 160
|
||||
#else //GIOVA48
|
||||
#define GSMOPEN_FRAME_SIZE 960
|
||||
#endif //GIOVA48
|
||||
#define SAMPLERATE_GSMOPEN 8000
|
||||
|
||||
#ifndef NO_ALSA
|
||||
#define GSMOPEN_ALSA
|
||||
#endif // NO_ALSA
|
||||
#include <switch.h>
|
||||
#include <switch_version.h>
|
||||
#ifndef WIN32
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <iconv.h>
|
||||
#endif //WIN32
|
||||
//#include <libteletone.h>
|
||||
|
||||
#ifdef GSMOPEN_ALSA
|
||||
#define ALSA_PCM_NEW_HW_PARAMS_API
|
||||
#define ALSA_PCM_NEW_SW_PARAMS_API
|
||||
#include <alsa/asoundlib.h>
|
||||
#endif /* GSMOPEN_ALSA */
|
||||
|
||||
#ifdef GSMOPEN_PORTAUDIO
|
||||
#include "pablio.h"
|
||||
#undef WANT_SPEEX
|
||||
#ifdef WANT_SPEEX
|
||||
#include "speex/speex_preprocess.h"
|
||||
#include "speex/speex_echo.h"
|
||||
#endif /* WANT_SPEEX */
|
||||
#endif// GSMOPEN_PORTAUDIO
|
||||
|
||||
//#include "celliax_spandsp.h"
|
||||
#ifndef WIN32
|
||||
#include <sys/time.h>
|
||||
//#include <X11/Xlib.h>
|
||||
//#include <X11/Xlibint.h>
|
||||
//#include <X11/Xatom.h>
|
||||
#endif //WIN32
|
||||
|
||||
#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES
|
||||
#include <spandsp.h>
|
||||
#include <spandsp/version.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
//Windows macro for FD_SET includes a warning C4127: conditional expression is constant
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
#define PROTOCOL_ALSA_VOICEMODEM 4
|
||||
#define PROTOCOL_AT 2
|
||||
#define PROTOCOL_FBUS2 1
|
||||
#define PROTOCOL_NO_SERIAL 3
|
||||
|
||||
#define AT_BUFSIZ 8192
|
||||
//FIXME FIXME FIXME #define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */
|
||||
#define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */
|
||||
//FIXME FIXME FIXME #define AT_MESG_MAX_LINES 256 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */
|
||||
#define AT_MESG_MAX_LINES 20 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */
|
||||
|
||||
//#define SAMPLERATE_GSMOPEN 16000
|
||||
//#define SAMPLES_PER_FRAME SAMPLERATE_GSMOPEN/50
|
||||
|
||||
#ifndef GSMOPEN_SVN_VERSION
|
||||
#define GSMOPEN_SVN_VERSION SWITCH_VERSION_REVISION
|
||||
#endif /* GSMOPEN_SVN_VERSION */
|
||||
|
||||
typedef enum {
|
||||
TFLAG_IO = (1 << 0),
|
||||
TFLAG_INBOUND = (1 << 1),
|
||||
TFLAG_OUTBOUND = (1 << 2),
|
||||
TFLAG_DTMF = (1 << 3),
|
||||
TFLAG_VOICE = (1 << 4),
|
||||
TFLAG_HANGUP = (1 << 5),
|
||||
TFLAG_LINEAR = (1 << 6),
|
||||
TFLAG_CODEC = (1 << 7),
|
||||
TFLAG_BREAK = (1 << 8)
|
||||
} TFLAGS;
|
||||
|
||||
typedef enum {
|
||||
GFLAG_MY_CODEC_PREFS = (1 << 0)
|
||||
} GFLAGS;
|
||||
|
||||
#define DEBUGA_GSMOPEN(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_GSMOPEN %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
|
||||
#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
|
||||
#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
|
||||
#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
|
||||
#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
|
||||
#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
|
||||
|
||||
#define GSMOPEN_P_LOG (void *)NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->phone_callflow : -1
|
||||
|
||||
/*********************************/
|
||||
#define GSMOPEN_CAUSE_NORMAL 1
|
||||
#define GSMOPEN_CAUSE_FAILURE 2
|
||||
#define GSMOPEN_CAUSE_NO_ANSWER 3
|
||||
/*********************************/
|
||||
#define GSMOPEN_FRAME_DTMF 1
|
||||
/*********************************/
|
||||
#define GSMOPEN_CONTROL_RINGING 1
|
||||
#define GSMOPEN_CONTROL_ANSWER 2
|
||||
#define GSMOPEN_CONTROL_HANGUP 3
|
||||
#define GSMOPEN_CONTROL_BUSY 4
|
||||
|
||||
/*********************************/
|
||||
#define GSMOPEN_STATE_IDLE 0
|
||||
#define GSMOPEN_STATE_DOWN 1
|
||||
#define GSMOPEN_STATE_RING 2
|
||||
#define GSMOPEN_STATE_DIALING 3
|
||||
#define GSMOPEN_STATE_BUSY 4
|
||||
#define GSMOPEN_STATE_UP 5
|
||||
#define GSMOPEN_STATE_RINGING 6
|
||||
#define GSMOPEN_STATE_PRERING 7
|
||||
#define GSMOPEN_STATE_ERROR_DOUBLE_CALL 8
|
||||
#define GSMOPEN_STATE_SELECTED 9
|
||||
#define GSMOPEN_STATE_HANGUP_REQUESTED 10
|
||||
#define GSMOPEN_STATE_PREANSWER 11
|
||||
/*********************************/
|
||||
/* call flow from the device */
|
||||
#define CALLFLOW_CALL_IDLE 0
|
||||
#define CALLFLOW_CALL_DOWN 1
|
||||
#define CALLFLOW_INCOMING_RING 2
|
||||
#define CALLFLOW_CALL_DIALING 3
|
||||
#define CALLFLOW_CALL_LINEBUSY 4
|
||||
#define CALLFLOW_CALL_ACTIVE 5
|
||||
#define CALLFLOW_INCOMING_HANGUP 6
|
||||
#define CALLFLOW_CALL_RELEASED 7
|
||||
#define CALLFLOW_CALL_NOCARRIER 8
|
||||
#define CALLFLOW_CALL_INFLUX 9
|
||||
#define CALLFLOW_CALL_INCOMING 10
|
||||
#define CALLFLOW_CALL_FAILED 11
|
||||
#define CALLFLOW_CALL_NOSERVICE 12
|
||||
#define CALLFLOW_CALL_OUTGOINGRESTRICTED 13
|
||||
#define CALLFLOW_CALL_SECURITYFAIL 14
|
||||
#define CALLFLOW_CALL_NOANSWER 15
|
||||
#define CALLFLOW_STATUS_FINISHED 16
|
||||
#define CALLFLOW_STATUS_CANCELLED 17
|
||||
#define CALLFLOW_STATUS_FAILED 18
|
||||
#define CALLFLOW_STATUS_REFUSED 19
|
||||
#define CALLFLOW_STATUS_RINGING 20
|
||||
#define CALLFLOW_STATUS_INPROGRESS 21
|
||||
#define CALLFLOW_STATUS_UNPLACED 22
|
||||
#define CALLFLOW_STATUS_ROUTING 23
|
||||
#define CALLFLOW_STATUS_EARLYMEDIA 24
|
||||
#define CALLFLOW_INCOMING_CALLID 25
|
||||
#define CALLFLOW_STATUS_REMOTEHOLD 26
|
||||
#define CALLFLOW_CALL_REMOTEANSWER 27
|
||||
#define CALLFLOW_CALL_HANGUP_REQUESTED 28
|
||||
|
||||
/*********************************/
|
||||
|
||||
#define AT_OK 0
|
||||
#define AT_ERROR 1
|
||||
|
||||
#define GSMOPEN_MAX_INTERFACES 64
|
||||
|
||||
#ifndef WIN32
|
||||
struct GSMopenHandles {
|
||||
//Window gsmopen_win;
|
||||
//Display *disp;
|
||||
//Window win;
|
||||
int currentuserhandle;
|
||||
int api_connected;
|
||||
int fdesc[2];
|
||||
};
|
||||
#else //WIN32
|
||||
|
||||
struct GSMopenHandles {
|
||||
HWND win32_hInit_MainWindowHandle;
|
||||
HWND win32_hGlobal_GSMAPIWindowHandle;
|
||||
HINSTANCE win32_hInit_ProcessHandle;
|
||||
char win32_acInit_WindowClassName[128];
|
||||
UINT win32_uiGlobal_MsgID_GSMControlAPIAttach;
|
||||
UINT win32_uiGlobal_MsgID_GSMControlAPIDiscover;
|
||||
int currentuserhandle;
|
||||
int api_connected;
|
||||
switch_file_t *fdesc[2];
|
||||
};
|
||||
|
||||
#endif //WIN32
|
||||
|
||||
/*!
|
||||
* \brief structure for storing the results of AT commands, in an array of AT_MESG_MAX_LINES * AT_MESG_MAX_LENGTH chars
|
||||
*/
|
||||
struct s_result {
|
||||
int elemcount;
|
||||
char result[AT_MESG_MAX_LINES][AT_MESG_MAX_LENGTH];
|
||||
};
|
||||
|
||||
struct ciapa_struct {
|
||||
int state;
|
||||
int hangupcause;
|
||||
};
|
||||
typedef struct ciapa_struct ciapa_t;
|
||||
|
||||
struct private_object {
|
||||
unsigned int flags;
|
||||
switch_codec_t read_codec;
|
||||
switch_codec_t write_codec;
|
||||
switch_frame_t read_frame;
|
||||
unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
||||
char session_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
|
||||
switch_caller_profile_t *caller_profile;
|
||||
switch_mutex_t *mutex;
|
||||
switch_mutex_t *flag_mutex;
|
||||
|
||||
char id[80];
|
||||
char name[80];
|
||||
char dialplan[80];
|
||||
char context[80];
|
||||
char dial_regex[256];
|
||||
char fail_dial_regex[256];
|
||||
char hold_music[256];
|
||||
char type[256];
|
||||
char X11_display[256];
|
||||
#ifdef WIN32
|
||||
unsigned short tcp_cli_port;
|
||||
unsigned short tcp_srv_port;
|
||||
#else
|
||||
int tcp_cli_port;
|
||||
int tcp_srv_port;
|
||||
#endif
|
||||
struct GSMopenHandles GSMopenHandles;
|
||||
|
||||
int interface_state; /*!< \brief 'state' of the interface (channel) */
|
||||
char language[80]; /*!< \brief default Asterisk dialplan language for this interface */
|
||||
char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */
|
||||
int gsmopen_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */
|
||||
char callid_name[50];
|
||||
char callid_number[50];
|
||||
double playback_boost;
|
||||
double capture_boost;
|
||||
int stripmsd;
|
||||
char gsmopen_call_id[512];
|
||||
int gsmopen_call_ongoing;
|
||||
char gsmopen_friends[4096];
|
||||
char gsmopen_fullname[512];
|
||||
char gsmopen_displayname[512];
|
||||
int phone_callflow; /*!< \brief 'callflow' of the gsmopen interface (as opposed to phone interface) */
|
||||
int gsmopen; /*!< \brief config flag, bool, GSM support on this interface (0 if false, -1 if true) */
|
||||
int control_to_send;
|
||||
#ifdef WIN32
|
||||
switch_file_t *audiopipe[2];
|
||||
switch_file_t *audiogsmopenpipe[2];
|
||||
switch_file_t *gsmopen_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */
|
||||
#else /* WIN32 */
|
||||
int audiopipe[2];
|
||||
int audiogsmopenpipe[2];
|
||||
int gsmopen_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */
|
||||
#endif /* WIN32 */
|
||||
switch_thread_t *tcp_srv_thread;
|
||||
switch_thread_t *tcp_cli_thread;
|
||||
switch_thread_t *gsmopen_signaling_thread;
|
||||
switch_thread_t *gsmopen_api_thread;
|
||||
//short audiobuf[SAMPLES_PER_FRAME];
|
||||
//int audiobuf_is_loaded;
|
||||
|
||||
//int phonebook_listing;
|
||||
//int phonebook_querying;
|
||||
//int phonebook_listing_received_calls;
|
||||
|
||||
//int phonebook_first_entry;
|
||||
//int phonebook_last_entry;
|
||||
//int phonebook_number_lenght;
|
||||
//int phonebook_text_lenght;
|
||||
int gsmopen_dir_entry_extension_prefix;
|
||||
char gsmopen_user[256];
|
||||
char gsmopen_password[256];
|
||||
char destination[256];
|
||||
struct timeval answer_time;
|
||||
|
||||
struct timeval transfer_time;
|
||||
char transfer_callid_number[50];
|
||||
char gsmopen_transfer_call_id[512];
|
||||
int running;
|
||||
unsigned long ib_calls;
|
||||
unsigned long ob_calls;
|
||||
unsigned long ib_failed_calls;
|
||||
unsigned long ob_failed_calls;
|
||||
|
||||
|
||||
char controldevice_name[50]; /*!< \brief name of the serial device controlling the interface, possibly none */
|
||||
int controldevprotocol; /*!< \brief which protocol is used for serial control of this interface */
|
||||
char controldevprotocolname[50]; /*!< \brief name of the serial device controlling protocol, one of "at" "fbus2" "no_serial" "alsa_voicemodem" */
|
||||
int controldevfd; /*!< \brief serial controlling file descriptor for this interface */
|
||||
//pthread_t controldev_thread; /*!< \brief serial control thread for this interface, running during the call */
|
||||
#ifdef WIN32
|
||||
int controldevice_speed;
|
||||
#else
|
||||
speed_t controldevice_speed;
|
||||
#endif// WIN32
|
||||
int controldev_dead;
|
||||
|
||||
char at_dial_pre_number[64];
|
||||
char at_dial_post_number[64];
|
||||
char at_dial_expect[64];
|
||||
unsigned int at_early_audio;
|
||||
char at_hangup[64];
|
||||
char at_hangup_expect[64];
|
||||
char at_answer[64];
|
||||
char at_answer_expect[64];
|
||||
unsigned int at_initial_pause;
|
||||
char at_preinit_1[64];
|
||||
char at_preinit_1_expect[64];
|
||||
char at_preinit_2[64];
|
||||
char at_preinit_2_expect[64];
|
||||
char at_preinit_3[64];
|
||||
char at_preinit_3_expect[64];
|
||||
char at_preinit_4[64];
|
||||
char at_preinit_4_expect[64];
|
||||
char at_preinit_5[64];
|
||||
char at_preinit_5_expect[64];
|
||||
unsigned int at_after_preinit_pause;
|
||||
|
||||
char at_postinit_1[64];
|
||||
char at_postinit_1_expect[64];
|
||||
char at_postinit_2[64];
|
||||
char at_postinit_2_expect[64];
|
||||
char at_postinit_3[64];
|
||||
char at_postinit_3_expect[64];
|
||||
char at_postinit_4[64];
|
||||
char at_postinit_4_expect[64];
|
||||
char at_postinit_5[64];
|
||||
char at_postinit_5_expect[64];
|
||||
|
||||
char at_send_dtmf[64];
|
||||
|
||||
char at_query_battchg[64];
|
||||
char at_query_battchg_expect[64];
|
||||
char at_query_signal[64];
|
||||
char at_query_signal_expect[64];
|
||||
char at_call_idle[64];
|
||||
char at_call_incoming[64];
|
||||
char at_call_active[64];
|
||||
char at_call_failed[64];
|
||||
char at_call_calling[64];
|
||||
|
||||
#define CIEV_STRING_SIZE 64
|
||||
char at_indicator_noservice_string[64];
|
||||
char at_indicator_nosignal_string[64];
|
||||
char at_indicator_lowsignal_string[64];
|
||||
char at_indicator_lowbattchg_string[64];
|
||||
char at_indicator_nobattchg_string[64];
|
||||
char at_indicator_callactive_string[64];
|
||||
char at_indicator_nocallactive_string[64];
|
||||
char at_indicator_nocallsetup_string[64];
|
||||
char at_indicator_callsetupincoming_string[64];
|
||||
char at_indicator_callsetupoutgoing_string[64];
|
||||
char at_indicator_callsetupremoteringing_string[64];
|
||||
|
||||
int at_indicator_callp;
|
||||
int at_indicator_callsetupp;
|
||||
int at_indicator_roamp;
|
||||
int at_indicator_battchgp;
|
||||
int at_indicator_servicep;
|
||||
int at_indicator_signalp;
|
||||
|
||||
int at_has_clcc;
|
||||
int at_has_ecam;
|
||||
|
||||
char at_cmgw[16];
|
||||
int no_ucs2;
|
||||
time_t gsmopen_serial_sync_period;
|
||||
|
||||
time_t gsmopen_serial_synced_timestamp;
|
||||
struct s_result line_array;
|
||||
|
||||
|
||||
int unread_sms_msg_id;
|
||||
int reading_sms_msg;
|
||||
char sms_message[4800];
|
||||
char sms_sender[256];
|
||||
char sms_date[256];
|
||||
char sms_body[4800];
|
||||
char sms_datacodingscheme[256];
|
||||
char sms_servicecentreaddress[256];
|
||||
int sms_messagetype;
|
||||
int sms_cnmi_not_supported;
|
||||
int sms_pdu_not_supported;
|
||||
//char sms_receiving_program[256];
|
||||
|
||||
|
||||
struct timeval call_incoming_time;
|
||||
switch_mutex_t *controldev_lock;
|
||||
|
||||
int phonebook_listing;
|
||||
int phonebook_querying;
|
||||
int phonebook_listing_received_calls;
|
||||
|
||||
int phonebook_first_entry;
|
||||
int phonebook_last_entry;
|
||||
int phonebook_number_lenght;
|
||||
int phonebook_text_lenght;
|
||||
FILE *phonebook_writing_fp;
|
||||
|
||||
struct timeval ringtime;
|
||||
ciapa_t *owner;
|
||||
#ifdef GSMOPEN_ALSA
|
||||
snd_pcm_t *alsac; /*!< \brief handle of the ALSA capture audio device */
|
||||
snd_pcm_t *alsap; /*!< \brief handle of the ALSA playback audio device */
|
||||
char alsacname[50]; /*!< \brief name of the ALSA capture audio device */
|
||||
char alsapname[50]; /*!< \brief name of the ALSA playback audio device */
|
||||
int alsa_period_size; /*!< \brief ALSA period_size, in byte */
|
||||
int alsa_periods_in_buffer; /*!< \brief how many periods in ALSA buffer, to calculate buffer_size */
|
||||
unsigned long int alsa_buffer_size; /*!< \brief ALSA buffer_size, in byte */
|
||||
int alsawrite_filled;
|
||||
int alsa_capture_is_mono;
|
||||
int alsa_play_is_mono;
|
||||
struct pollfd pfd;
|
||||
#endif // GSMOPEN_ALSA
|
||||
|
||||
time_t audio_play_reset_timestamp;
|
||||
int audio_play_reset_period;
|
||||
|
||||
switch_timer_t timer_read;
|
||||
switch_timer_t timer_write;
|
||||
teletone_dtmf_detect_state_t dtmf_detect;
|
||||
switch_time_t old_dtmf_timestamp;
|
||||
|
||||
int no_sound;
|
||||
|
||||
#ifdef GSMOPEN_PORTAUDIO
|
||||
int speexecho;
|
||||
int speexpreprocess;
|
||||
int portaudiocindex; /*!< \brief Index of the Portaudio capture audio device */
|
||||
int portaudiopindex; /*!< \brief Index of the Portaudio playback audio device */
|
||||
PABLIO_Stream *stream;
|
||||
|
||||
#ifdef WANT_SPEEX
|
||||
SpeexPreprocessState *preprocess;
|
||||
SpeexEchoState *echo_state;
|
||||
#endif// WANT_SPEEX
|
||||
#endif// GSMOPEN_PORTAUDIO
|
||||
dtmf_rx_state_t dtmf_state;
|
||||
int active;
|
||||
int home_network_registered;
|
||||
int roaming_registered;
|
||||
int not_registered;
|
||||
int got_signal;
|
||||
char imei[128];
|
||||
int requesting_imei;
|
||||
char imsi[128];
|
||||
int requesting_imsi;
|
||||
int network_creg_not_supported;
|
||||
char creg[128];
|
||||
|
||||
};
|
||||
|
||||
typedef struct private_object private_t;
|
||||
|
||||
void *SWITCH_THREAD_FUNC gsmopen_api_thread_func(switch_thread_t * thread, void *obj);
|
||||
int gsmopen_audio_read(private_t * tech_pvt);
|
||||
int gsmopen_audio_init(private_t * tech_pvt);
|
||||
int gsmopen_signaling_read(private_t * tech_pvt);
|
||||
|
||||
int gsmopen_call(private_t * tech_pvt, char *idest, int timeout);
|
||||
int gsmopen_senddigit(private_t * tech_pvt, char digit);
|
||||
|
||||
void *gsmopen_do_tcp_srv_thread_func(void *obj);
|
||||
void *SWITCH_THREAD_FUNC gsmopen_do_tcp_srv_thread(switch_thread_t * thread, void *obj);
|
||||
|
||||
void *gsmopen_do_tcp_cli_thread_func(void *obj);
|
||||
void *SWITCH_THREAD_FUNC gsmopen_do_tcp_cli_thread(switch_thread_t * thread, void *obj);
|
||||
|
||||
void *gsmopen_do_gsmopenapi_thread_func(void *obj);
|
||||
void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t * thread, void *obj);
|
||||
int dtmf_received(private_t * tech_pvt, char *value);
|
||||
int start_audio_threads(private_t * tech_pvt);
|
||||
int new_inbound_channel(private_t * tech_pvt);
|
||||
int outbound_channel_answered(private_t * tech_pvt);
|
||||
//int gsmopen_signaling_write(private_t * tech_pvt, char *msg_to_gsmopen);
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
int gsmopen_pipe_read(switch_file_t * pipe, short *buf, int howmany);
|
||||
int gsmopen_pipe_write(switch_file_t * pipe, short *buf, int howmany);
|
||||
/* Visual C do not have strsep ? */
|
||||
char *strsep(char **stringp, const char *delim);
|
||||
#else
|
||||
int gsmopen_pipe_read(int pipe, short *buf, int howmany);
|
||||
int gsmopen_pipe_write(int pipe, short *buf, int howmany);
|
||||
#endif /* WIN32 */
|
||||
int gsmopen_close_socket(unsigned int fd);
|
||||
private_t *find_available_gsmopen_interface_rr(private_t * tech_pvt_calling);
|
||||
int remote_party_is_ringing(private_t * tech_pvt);
|
||||
int remote_party_is_early_media(private_t * tech_pvt);
|
||||
//int gsmopen_answer(private_t * tech_pvt, char *id, char *value);
|
||||
#if 0
|
||||
int gsmopen_transfer(private_t * tech_pvt, char *id, char *value);
|
||||
#endif //0
|
||||
int gsmopen_socket_create_and_bind(private_t * tech_pvt, int *which_port);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void *gsmopen_do_controldev_thread(void *data);
|
||||
#ifdef WIN32
|
||||
int gsmopen_serial_init(private_t * tech_pvt, int controldevice_speed);
|
||||
#else
|
||||
int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed);
|
||||
#endif //WIN32
|
||||
int gsmopen_serial_monitor(private_t * tech_pvt);
|
||||
int gsmopen_serial_sync(private_t * tech_pvt);
|
||||
int gsmopen_serial_sync_AT(private_t * tech_pvt);
|
||||
int gsmopen_serial_config(private_t * tech_pvt);
|
||||
int gsmopen_serial_config_AT(private_t * tech_pvt);
|
||||
|
||||
#define gsmopen_serial_write_AT_expect(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 2)
|
||||
#define gsmopen_serial_write_AT_expect_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 2)
|
||||
#define gsmopen_serial_write_AT_expect_noexpcr_tout(P, D, S, T) gsmopen_serial_write_AT_expect1(P, D, S, 0, T)
|
||||
// 20.5 sec timeout, used for querying the SIM and sending SMSs
|
||||
#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 20)
|
||||
#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 20)
|
||||
int gsmopen_serial_write_AT(private_t * tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_nocr(private_t * tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_ack(private_t * tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_noack(private_t * tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_expect1(private_t * tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds);
|
||||
int gsmopen_serial_AT_expect(private_t * tech_pvt, const char *expected_string, int expect_crlf, int seconds);
|
||||
int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf);
|
||||
int gsmopen_serial_read(private_t * tech_pvt);
|
||||
#ifdef NOTDEF
|
||||
int gsmopen_serial_getstatus(private_t * tech_pvt);
|
||||
int gsmopen_serial_hangup(private_t * tech_pvt);
|
||||
int gsmopen_serial_answer(private_t * tech_pvt);
|
||||
int gsmopen_serial_answer_AT(private_t * tech_pvt);
|
||||
int gsmopen_serial_hangup_AT(private_t * tech_pvt);
|
||||
int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr);
|
||||
int gsmopen_serial_getstatus_AT(private_t * tech_pvt);
|
||||
#endif // NOTDEF
|
||||
#define RESULT_FAILURE 0
|
||||
#define RESULT_SUCCESS 1
|
||||
int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft);
|
||||
int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft);
|
||||
//#define PUSHA_UNLOCKA(x) pthread_cleanup_push(gsmopen_unlocka_log, (void *) x);
|
||||
//#define POPPA_UNLOCKA(x) pthread_cleanup_pop(0);
|
||||
|
||||
#define PUSHA_UNLOCKA(x) if(option_debug > 100) ERRORA("PUSHA_UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x);
|
||||
#define POPPA_UNLOCKA(x) if(option_debug > 100) ERRORA("POPPA_UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x);
|
||||
//#define LOKKA(x) if(option_debug > 100) ERRORA("LOKKA: %p\n", GSMOPEN_P_LOG, (void *)x);
|
||||
#define LOKKA(x) switch_mutex_lock(x);
|
||||
#define UNLOCKA(x) switch_mutex_unlock(x);
|
||||
//#define UNLOCKA(x) if(option_debug > 100) ERRORA("UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x);
|
||||
|
||||
#define gsmopen_queue_control(x, y) ERRORA("gsmopen_queue_control: %p, %d\n", GSMOPEN_P_LOG, (void *)x, y);
|
||||
|
||||
#define ast_setstate(x, y) ERRORA("ast_setstate: %p, %d\n", GSMOPEN_P_LOG, (void *)x, y);
|
||||
|
||||
int gsmopen_serial_read(private_t * tech_pvt);
|
||||
int gsmopen_answer(private_t * tech_pvt);
|
||||
int gsmopen_serial_answer(private_t * tech_pvt);
|
||||
int gsmopen_serial_answer_AT(private_t * tech_pvt);
|
||||
int gsmopen_serial_hangup(private_t * tech_pvt);
|
||||
int gsmopen_serial_hangup_AT(private_t * tech_pvt);
|
||||
int gsmopen_hangup(private_t * tech_pvt);
|
||||
int gsmopen_serial_call(private_t * tech_pvt, char *dstr);
|
||||
int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr);
|
||||
int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text);
|
||||
|
||||
#ifdef GSMOPEN_ALSA
|
||||
int alsa_init(private_t * tech_pvt);
|
||||
int alsa_shutdown(private_t * tech_pvt);
|
||||
snd_pcm_t *alsa_open_dev(private_t * tech_pvt, snd_pcm_stream_t stream);
|
||||
int alsa_write(private_t * tech_pvt, short *data, int datalen);
|
||||
int alsa_read(private_t * tech_pvt, short *data, int datalen);
|
||||
|
||||
#endif /* GSMOPEN_ALSA */
|
||||
|
||||
|
||||
void gsmopen_store_boost(char *s, double *boost);
|
||||
int gsmopen_sound_boost(void *data, int samples_num, double boost);
|
||||
int sms_incoming(private_t * tech_pvt);
|
||||
int gsmopen_ring(private_t * tech_pvt);
|
||||
|
||||
int iso_8859_1_to_utf8(private_t * tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft);
|
||||
int gsmopen_serial_getstatus_AT(private_t * tech_pvt);
|
||||
|
||||
|
||||
#ifdef GSMOPEN_PORTAUDIO
|
||||
|
||||
int gsmopen_portaudio_devlist(private_t *tech_pvt);
|
||||
|
||||
int gsmopen_portaudio_init(private_t *tech_pvt);
|
||||
|
||||
int gsmopen_portaudio_write(private_t * tech_pvt, short *data, int datalen);
|
||||
|
||||
int gsmopen_portaudio_read(private_t * tech_pvt, short *data, int datalen);
|
||||
|
||||
|
||||
int gsmopen_portaudio_shutdown(private_t *tech_pvt);
|
||||
|
||||
#endif // GSMOPEN_PORTAUDIO
|
||||
int dump_event(private_t *tech_pvt);
|
||||
int alarm_event(private_t * tech_pvt, int alarm_code, const char *alarm_message);
|
||||
int dump_event_full(private_t * tech_pvt, int is_alarm, int alarm_code, const char *alarm_message);
|
||||
@@ -1 +0,0 @@
|
||||
../../gsmopen_protocol.cpp
|
||||
+4004
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
||||
../../mod_gsmopen.cpp
|
||||
File diff suppressed because it is too large.
Load diff
File renamed without changes.
@@ -4,18 +4,22 @@
|
||||
<param name="dialplan" value="XML"/>
|
||||
<param name="context" value="default"/>
|
||||
<param name="hold-music" value="$${moh_uri}"/>
|
||||
<param name="destination" value="9999"/>
|
||||
<param name="destination" value="5000"/>
|
||||
</global_settings>
|
||||
<!-- one entry here per gsmopen interface -->
|
||||
<per_interface_settings>
|
||||
<interface id="1" name="interface1">
|
||||
<param name="hold-music" value="$${moh_uri}"/>
|
||||
<param name="dialplan" value="XML"/>
|
||||
<param name="context" value="default"/>
|
||||
<param name="destination" value="5000"/>
|
||||
<param name="alsacname" value="plughw:1"/>
|
||||
<param name="alsapname" value="plughw:1"/>
|
||||
<param name="controldevice_name" value="/dev/ttyACM0"/>
|
||||
<interface id="1" name="gsm01">
|
||||
<param name="controldevice_name" value="/dev/ttyUSB3"/>
|
||||
<param name="controldevice_audio_name" value="/dev/ttyUSB2"/>
|
||||
<!-- in windowz would be, eg: -->
|
||||
<!--
|
||||
<param name="controldevice_name" value="COM4"/>
|
||||
-->
|
||||
<!-- 3G PC UI Interface is controldevice_name -->
|
||||
<!--
|
||||
<param name="controldevice_audio_name" value="COM2"/>
|
||||
-->
|
||||
<!-- 3G Application Interface is controldevice_audio_name -->
|
||||
</interface>
|
||||
<!-- following interfaces are commented out!
|
||||
-->
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/* Copyright (C) 2007 Jean-Marc Valin
|
||||
|
||||
File: testresample.c
|
||||
Testing the resampling code
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define NN 256
|
||||
|
||||
int main()
|
||||
{
|
||||
short *in;
|
||||
short *out;
|
||||
int i;
|
||||
int a;
|
||||
|
||||
in = malloc(NN*sizeof(short));
|
||||
out = malloc(NN*sizeof(short)/6);
|
||||
while (1)
|
||||
{
|
||||
fread(in, sizeof(short), NN, stdin);
|
||||
if (feof(stdin))
|
||||
break;
|
||||
|
||||
a=0;
|
||||
for (i=0;i<NN;i++){
|
||||
out[a]=in[i];
|
||||
i++;
|
||||
i++;
|
||||
i++;
|
||||
i++;
|
||||
i++;
|
||||
a++;
|
||||
}
|
||||
|
||||
fwrite(out, sizeof(short), NN/6, stdout);
|
||||
}
|
||||
free(in);
|
||||
free(out);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/* Copyright (C) 2007 Jean-Marc Valin
|
||||
|
||||
File: testresample.c
|
||||
Testing the resampling code
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
//#include "speex/speex_resampler.h"
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define NN 256
|
||||
|
||||
int main()
|
||||
{
|
||||
short *in;
|
||||
short *out;
|
||||
int i;
|
||||
int a;
|
||||
|
||||
in = malloc(NN*sizeof(short));
|
||||
out = malloc(NN*sizeof(short)*6);
|
||||
while (1)
|
||||
{
|
||||
fread(in, sizeof(short), NN, stdin);
|
||||
if (feof(stdin))
|
||||
break;
|
||||
|
||||
a=0;
|
||||
for (i=0;i<NN;i++){
|
||||
out[a]=in[i];
|
||||
a++;
|
||||
out[a]=in[i];
|
||||
a++;
|
||||
out[a]=in[i];
|
||||
a++;
|
||||
out[a]=in[i];
|
||||
a++;
|
||||
out[a]=in[i];
|
||||
a++;
|
||||
out[a]=in[i];
|
||||
a++;
|
||||
}
|
||||
|
||||
fwrite(out, sizeof(short), NN*6, stdout);
|
||||
}
|
||||
free(in);
|
||||
free(out);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
For Linux distros without gsmlib (eg: CentOS):
|
||||
|
||||
Here are the original (ancient) sources for gsmlib, and the patch made by Ubuntu for modern compilers.
|
||||
In the directory gsmlib-1.10-patched-13ubuntu is the source for gsmlib
|
||||
as patched by Ubuntu for modern compilers:
|
||||
|
||||
In the directory gsmlib-1.10-patched-13ubuntu are the patched sources, ready for (no need to patch them again):
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
Regular → Executable
+3
@@ -267,6 +267,9 @@ NoCopy &NoCopy::operator=(NoCopy &n)
|
||||
{
|
||||
cerr << "ABORT: NoCopy::operator= used" << endl;
|
||||
abort();
|
||||
#ifdef WIN32
|
||||
return n;
|
||||
#endif //WIN32
|
||||
}
|
||||
|
||||
#endif // NDEBUG
|
||||
|
||||
Regular → Executable
+1
@@ -13,6 +13,7 @@
|
||||
#include <gsm_config.h>
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#include <gsm_config.h>
|
||||
#include <gsmlib/gsm_win32_serial.h>
|
||||
#else
|
||||
#include <gsmlib/gsm_unix_serial.h>
|
||||
|
||||
Regular → Executable
+2
@@ -68,7 +68,9 @@
|
||||
|
||||
/* Define if vsnprintf() function available */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#ifndef WIN32
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif// WIN32
|
||||
|
||||
/* The number of bytes in a unsigned int. */
|
||||
#define SIZEOF_UNSIGNED_INT 4
|
||||
|
||||
+250
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="gsmctl"
|
||||
ProjectGUID="{A822BA57-6F96-4C69-9E28-C0FB2667B1B0}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/gsmctl.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/gsmctl.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Debug/gsmctl.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/gsmctl.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/gsmctl.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/gsmctl.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/gsmctl.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/gsmctl.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/gsmctl.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/gsmctl.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Quellcodedateien"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="getopt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\apps\gsmctl.cc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header-Dateien"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="getopt.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Ressourcendateien"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
+263
@@ -0,0 +1,263 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>gsmlib</ProjectName>
|
||||
<ProjectGuid>{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>../vcproject;..;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<PrecompiledHeaderOutputFile>.\Release/gsmlib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Release/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
|
||||
<BrowseInformation>true</BrowseInformation>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\Release\gsmlib.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Release/gsmlib.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<PrecompiledHeaderOutputFile>.\Debug/gsmlib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Debug/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\Debug\gsmlib.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
</Lib>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Debug/gsmlib.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>../vcproject;..;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<PrecompiledHeaderOutputFile>.\Release/gsmlib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Release/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
|
||||
<BrowseInformation>true</BrowseInformation>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\Release\gsmlib.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Release/gsmlib.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<PrecompiledHeaderOutputFile>.\Debug/gsmlib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Debug/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\Debug\gsmlib.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
</Lib>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Debug/gsmlib.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\gsmlib\gsm_at.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_cb.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_error.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_event.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_me_ta.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_nls.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_parser.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_phonebook.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_sms.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_sms_codec.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_sms_store.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_sorted_phonebook.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_sorted_phonebook_base.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_sorted_sms_store.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_util.cc" />
|
||||
<ClCompile Include="..\gsmlib\gsm_win32_serial.cc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\gsmlib\gsm_at.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_cb.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_error.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_event.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_map_key.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_me_ta.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_nls.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_parser.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_phonebook.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_port.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_sms.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_sms_codec.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_sms_store.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_sorted_phonebook.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_sorted_phonebook_base.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_sorted_sms_store.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_sysdep.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_util.h" />
|
||||
<ClInclude Include="..\gsmlib\gsm_win32_serial.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmctl", "gsmctl.vcproj", "{A822BA57-6F96-4C69-9E28-C0FB2667B1B0}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmlib", "gsmlib.vcproj", "{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmpb", "gsmpb.vcproj", "{311D5A85-4DC1-4714-9B61-AE3C57B67B5B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsendsms", "gsmsendsms.vcproj", "{CF99664C-05D1-41A3-9B12-B79D55718377}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsmsd", "gsmsmsd.vcproj", "{3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsmsstore", "gsmsmsstore.vcproj", "{5A834BCC-8B96-4D1C-9811-ADC816797E3A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgsmlib", "testgsmlib.vcproj", "{248E3E22-2203-4352-964E-32946A1A0AEC}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsms", "testsms.vcproj", "{BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsms2", "testsms2.vcproj", "{3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Release|Win32.Build.0 = Release|Win32
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.Build.0 = Release|Win32
|
||||
{311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Release|Win32.Build.0 = Release|Win32
|
||||
{CF99664C-05D1-41A3-9B12-B79D55718377}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{CF99664C-05D1-41A3-9B12-B79D55718377}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{CF99664C-05D1-41A3-9B12-B79D55718377}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CF99664C-05D1-41A3-9B12-B79D55718377}.Release|Win32.Build.0 = Release|Win32
|
||||
{3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Release|Win32.Build.0 = Release|Win32
|
||||
{5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Release|Win32.Build.0 = Release|Win32
|
||||
{248E3E22-2203-4352-964E-32946A1A0AEC}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{248E3E22-2203-4352-964E-32946A1A0AEC}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{248E3E22-2203-4352-964E-32946A1A0AEC}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{248E3E22-2203-4352-964E-32946A1A0AEC}.Release|Win32.Build.0 = Release|Win32
|
||||
{BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Release|Win32.Build.0 = Release|Win32
|
||||
{3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+489
@@ -0,0 +1,489 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="gsmlib"
|
||||
ProjectGUID="{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../vcproject,..,."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
RuntimeTypeInfo="true"
|
||||
PrecompiledHeaderFile=".\Release/gsmlib.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile=".\Release\gsmlib.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/gsmlib.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..,."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeTypeInfo="true"
|
||||
PrecompiledHeaderFile=".\Debug/gsmlib.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile=".\Debug\gsmlib.lib"
|
||||
SuppressStartupBanner="true"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/gsmlib.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../vcproject,..,."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
RuntimeTypeInfo="true"
|
||||
PrecompiledHeaderFile=".\Release/gsmlib.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile=".\Release\gsmlib.lib"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/gsmlib.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..,."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeTypeInfo="true"
|
||||
PrecompiledHeaderFile=".\Debug/gsmlib.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile=".\Debug\gsmlib.lib"
|
||||
SuppressStartupBanner="true"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/gsmlib.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;cc;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_at.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_cb.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_error.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_event.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_me_ta.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_nls.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_parser.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_phonebook.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sms.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sms_codec.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sms_store.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sorted_phonebook.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sorted_phonebook_base.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sorted_sms_store.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_util.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_win32_serial.cc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_at.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_cb.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_error.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_event.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_map_key.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_me_ta.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_nls.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_parser.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_phonebook.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_port.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sms.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sms_codec.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sms_store.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sorted_phonebook.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sorted_phonebook_base.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sorted_sms_store.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_sysdep.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_util.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gsmlib\gsm_win32_serial.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
+250
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="gsmpb"
|
||||
ProjectGUID="{311D5A85-4DC1-4714-9B61-AE3C57B67B5B}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/gsmpb.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/gsmpb.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/gsmpb.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/gsmpb.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/gsmpb.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/gsmpb.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/gsmpb.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Debug/gsmpb.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/gsmpb.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/gsmpb.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Quellcodedateien"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="getopt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\apps\gsmpb.cc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header-Dateien"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="getopt.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Ressourcendateien"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
Executable
+250
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="gsmsendsms"
|
||||
ProjectGUID="{CF99664C-05D1-41A3-9B12-B79D55718377}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/gsmsendsms.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/gsmsendsms.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Debug/gsmsendsms.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/gsmsendsms.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/gsmsendsms.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/gsmsendsms.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/gsmsendsms.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/gsmsendsms.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/gsmsendsms.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/gsmsendsms.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Quellcodedateien"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="getopt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\apps\gsmsendsms.cc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header-Dateien"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="getopt.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Ressourcendateien"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
+250
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="gsmsmsd"
|
||||
ProjectGUID="{3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/gsmsmsd.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/gsmsmsd.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Debug/gsmsmsd.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/gsmsmsd.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/gsmsmsd.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/gsmsmsd.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/gsmsmsd.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/gsmsmsd.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/gsmsmsd.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/gsmsmsd.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Quellcodedateien"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="getopt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\apps\gsmsmsd.cc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header-Dateien"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="getopt.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Ressourcendateien"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
Executable
+252
@@ -0,0 +1,252 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="gsmsmsstore"
|
||||
ProjectGUID="{5A834BCC-8B96-4D1C-9811-ADC816797E3A}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/gsmsmsstore.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/gsmsmsstore.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib"
|
||||
OutputFile=".\Release/gsmsmsstore.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/gsmsmsstore.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/gsmsmsstore.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/gsmsmsstore.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/gsmsmsstore.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib"
|
||||
OutputFile=".\Debug/gsmsmsstore.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/gsmsmsstore.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/gsmsmsstore.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Quellcodedateien"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="getopt.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\apps\gsmsmsstore.cc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header-Dateien"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="getopt.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Ressourcendateien"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
Executable
+222
@@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="testgsmlib"
|
||||
ProjectGUID="{248E3E22-2203-4352-964E-32946A1A0AEC}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/testgsmlib.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/testgsmlib.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/testgsmlib.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/testgsmlib.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/testgsmlib.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/testgsmlib.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/testgsmlib.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Debug/testgsmlib.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/testgsmlib.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/testgsmlib.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\tests\testgsmlib.cc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="testsms"
|
||||
ProjectGUID="{BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/testsms.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/testsms.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Debug/testsms.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/testsms.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/testsms.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/testsms.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/testsms.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/testsms.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/testsms.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/testsms.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\tests\testsms.cc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="testsms2"
|
||||
ProjectGUID="{3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/testsms2.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/testsms2.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/testsms2.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/testsms2.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/testsms2.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/testsms2.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../gsmlib,..,."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/testsms2.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Debug/testsms2.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/testsms2.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/testsms2.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\tests\testsms2.cc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
* Copyright (C) 2005/2011, Anthony Minessale II <anthm@freeswitch.org>
|
||||
* Copyright (C) 2005/2012, Anthony Minessale II <anthm@freeswitch.org>
|
||||
*
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
@@ -52,10 +52,6 @@
|
||||
#define ALARM_NETWORK_NO_SIGNAL 4
|
||||
#define ALARM_NETWORK_LOW_SIGNAL 5
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#undef GIOVA48
|
||||
|
||||
#ifndef GIOVA48
|
||||
@@ -64,7 +60,6 @@
|
||||
#define SAMPLES_PER_FRAME 960
|
||||
#endif // GIOVA48
|
||||
|
||||
|
||||
#ifndef GIOVA48
|
||||
#define GSMOPEN_FRAME_SIZE 160
|
||||
#else //GIOVA48
|
||||
@@ -72,9 +67,6 @@
|
||||
#endif //GIOVA48
|
||||
#define SAMPLERATE_GSMOPEN 8000
|
||||
|
||||
#ifndef NO_ALSA
|
||||
#define GSMOPEN_ALSA
|
||||
#endif // NO_ALSA
|
||||
#include <switch.h>
|
||||
#include <switch_version.h>
|
||||
#ifndef WIN32
|
||||
@@ -84,21 +76,6 @@
|
||||
#endif //WIN32
|
||||
//#include <libteletone.h>
|
||||
|
||||
#ifdef GSMOPEN_ALSA
|
||||
#define ALSA_PCM_NEW_HW_PARAMS_API
|
||||
#define ALSA_PCM_NEW_SW_PARAMS_API
|
||||
#include <alsa/asoundlib.h>
|
||||
#endif /* GSMOPEN_ALSA */
|
||||
|
||||
#ifdef GSMOPEN_PORTAUDIO
|
||||
#include "pablio.h"
|
||||
#undef WANT_SPEEX
|
||||
#ifdef WANT_SPEEX
|
||||
#include "speex/speex_preprocess.h"
|
||||
#include "speex/speex_echo.h"
|
||||
#endif /* WANT_SPEEX */
|
||||
#endif// GSMOPEN_PORTAUDIO
|
||||
|
||||
//#include "celliax_spandsp.h"
|
||||
#ifndef WIN32
|
||||
#include <sys/time.h>
|
||||
@@ -122,19 +99,27 @@
|
||||
#define PROTOCOL_FBUS2 1
|
||||
#define PROTOCOL_NO_SERIAL 3
|
||||
|
||||
#define AT_BUFSIZ 8192
|
||||
//FIXME FIXME FIXME #define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */
|
||||
#define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */
|
||||
#define AT_BUFSIZ AT_MESG_MAX_LENGTH
|
||||
//FIXME FIXME FIXME #define AT_MESG_MAX_LINES 256 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */
|
||||
#define AT_MESG_MAX_LINES 20 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */
|
||||
|
||||
//#define SAMPLERATE_GSMOPEN 16000
|
||||
//#define SAMPLES_PER_FRAME SAMPLERATE_GSMOPEN/50
|
||||
|
||||
#ifdef GSMOPEN_C_VER
|
||||
#ifdef MODGSMOPEN_C_VER
|
||||
#define GSMOPEN_SVN_VERSION MODGSMOPEN_C_VER"|"GSMOPEN_C_VER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GSMOPEN_SVN_VERSION
|
||||
#define GSMOPEN_SVN_VERSION SWITCH_VERSION_REVISION
|
||||
#endif /* GSMOPEN_SVN_VERSION */
|
||||
|
||||
#include "ctb-0.16/ctb.h"
|
||||
|
||||
typedef enum {
|
||||
TFLAG_IO = (1 << 0),
|
||||
TFLAG_INBOUND = (1 << 1),
|
||||
@@ -348,7 +333,6 @@ struct private_object {
|
||||
unsigned long ib_failed_calls;
|
||||
unsigned long ob_failed_calls;
|
||||
|
||||
|
||||
char controldevice_name[50]; /*!< \brief name of the serial device controlling the interface, possibly none */
|
||||
int controldevprotocol; /*!< \brief which protocol is used for serial control of this interface */
|
||||
char controldevprotocolname[50]; /*!< \brief name of the serial device controlling protocol, one of "at" "fbus2" "no_serial" "alsa_voicemodem" */
|
||||
@@ -358,7 +342,7 @@ struct private_object {
|
||||
int controldevice_speed;
|
||||
#else
|
||||
speed_t controldevice_speed;
|
||||
#endif// WIN32
|
||||
#endif // WIN32
|
||||
int controldev_dead;
|
||||
|
||||
char at_dial_pre_number[64];
|
||||
@@ -435,7 +419,6 @@ struct private_object {
|
||||
time_t gsmopen_serial_synced_timestamp;
|
||||
struct s_result line_array;
|
||||
|
||||
|
||||
int unread_sms_msg_id;
|
||||
int reading_sms_msg;
|
||||
char sms_message[4800];
|
||||
@@ -449,7 +432,6 @@ struct private_object {
|
||||
int sms_pdu_not_supported;
|
||||
//char sms_receiving_program[256];
|
||||
|
||||
|
||||
struct timeval call_incoming_time;
|
||||
switch_mutex_t *controldev_lock;
|
||||
|
||||
@@ -465,19 +447,6 @@ struct private_object {
|
||||
|
||||
struct timeval ringtime;
|
||||
ciapa_t *owner;
|
||||
#ifdef GSMOPEN_ALSA
|
||||
snd_pcm_t *alsac; /*!< \brief handle of the ALSA capture audio device */
|
||||
snd_pcm_t *alsap; /*!< \brief handle of the ALSA playback audio device */
|
||||
char alsacname[50]; /*!< \brief name of the ALSA capture audio device */
|
||||
char alsapname[50]; /*!< \brief name of the ALSA playback audio device */
|
||||
int alsa_period_size; /*!< \brief ALSA period_size, in byte */
|
||||
int alsa_periods_in_buffer; /*!< \brief how many periods in ALSA buffer, to calculate buffer_size */
|
||||
unsigned long int alsa_buffer_size; /*!< \brief ALSA buffer_size, in byte */
|
||||
int alsawrite_filled;
|
||||
int alsa_capture_is_mono;
|
||||
int alsa_play_is_mono;
|
||||
struct pollfd pfd;
|
||||
#endif // GSMOPEN_ALSA
|
||||
|
||||
time_t audio_play_reset_timestamp;
|
||||
int audio_play_reset_period;
|
||||
@@ -489,59 +458,59 @@ struct private_object {
|
||||
|
||||
int no_sound;
|
||||
|
||||
#ifdef GSMOPEN_PORTAUDIO
|
||||
int speexecho;
|
||||
int speexpreprocess;
|
||||
int portaudiocindex; /*!< \brief Index of the Portaudio capture audio device */
|
||||
int portaudiopindex; /*!< \brief Index of the Portaudio playback audio device */
|
||||
PABLIO_Stream *stream;
|
||||
dtmf_rx_state_t dtmf_state;
|
||||
int active;
|
||||
int home_network_registered;
|
||||
int roaming_registered;
|
||||
int not_registered;
|
||||
int got_signal;
|
||||
char imei[128];
|
||||
int requesting_imei;
|
||||
char imsi[128];
|
||||
int requesting_imsi;
|
||||
int network_creg_not_supported;
|
||||
char creg[128];
|
||||
|
||||
#ifdef WANT_SPEEX
|
||||
SpeexPreprocessState *preprocess;
|
||||
SpeexEchoState *echo_state;
|
||||
#endif// WANT_SPEEX
|
||||
#endif// GSMOPEN_PORTAUDIO
|
||||
dtmf_rx_state_t dtmf_state;
|
||||
int active;
|
||||
int home_network_registered;
|
||||
int roaming_registered;
|
||||
int not_registered;
|
||||
int got_signal;
|
||||
char imei[128];
|
||||
int requesting_imei;
|
||||
char imsi[128];
|
||||
int requesting_imsi;
|
||||
int network_creg_not_supported;
|
||||
char creg[128];
|
||||
char controldevice_audio_name[50];
|
||||
int controldev_audio_fd;
|
||||
int controldevice_audio_speed;
|
||||
int controldev_audio_dead;
|
||||
switch_mutex_t *controldev_audio_lock;
|
||||
ctb::SerialPort * serialPort_serial_audio;
|
||||
|
||||
ctb::SerialPort * serialPort_serial_control;
|
||||
|
||||
char buffer2[320];
|
||||
int buffer2_full;
|
||||
|
||||
};
|
||||
|
||||
typedef struct private_object private_t;
|
||||
|
||||
void *SWITCH_THREAD_FUNC gsmopen_api_thread_func(switch_thread_t * thread, void *obj);
|
||||
int gsmopen_audio_read(private_t * tech_pvt);
|
||||
int gsmopen_audio_init(private_t * tech_pvt);
|
||||
int gsmopen_signaling_read(private_t * tech_pvt);
|
||||
void *SWITCH_THREAD_FUNC gsmopen_api_thread_func(switch_thread_t *thread, void *obj);
|
||||
int gsmopen_audio_read(private_t *tech_pvt);
|
||||
int gsmopen_audio_init(private_t *tech_pvt);
|
||||
int gsmopen_signaling_read(private_t *tech_pvt);
|
||||
|
||||
int gsmopen_call(private_t * tech_pvt, char *idest, int timeout);
|
||||
int gsmopen_senddigit(private_t * tech_pvt, char digit);
|
||||
int gsmopen_call(private_t *tech_pvt, char *idest, int timeout);
|
||||
int gsmopen_senddigit(private_t *tech_pvt, char digit);
|
||||
|
||||
void *gsmopen_do_tcp_srv_thread_func(void *obj);
|
||||
void *SWITCH_THREAD_FUNC gsmopen_do_tcp_srv_thread(switch_thread_t * thread, void *obj);
|
||||
void *SWITCH_THREAD_FUNC gsmopen_do_tcp_srv_thread(switch_thread_t *thread, void *obj);
|
||||
|
||||
void *gsmopen_do_tcp_cli_thread_func(void *obj);
|
||||
void *SWITCH_THREAD_FUNC gsmopen_do_tcp_cli_thread(switch_thread_t * thread, void *obj);
|
||||
void *SWITCH_THREAD_FUNC gsmopen_do_tcp_cli_thread(switch_thread_t *thread, void *obj);
|
||||
|
||||
void *gsmopen_do_gsmopenapi_thread_func(void *obj);
|
||||
void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t * thread, void *obj);
|
||||
int dtmf_received(private_t * tech_pvt, char *value);
|
||||
int start_audio_threads(private_t * tech_pvt);
|
||||
int new_inbound_channel(private_t * tech_pvt);
|
||||
int outbound_channel_answered(private_t * tech_pvt);
|
||||
void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t *thread, void *obj);
|
||||
int dtmf_received(private_t *tech_pvt, char *value);
|
||||
int start_audio_threads(private_t *tech_pvt);
|
||||
int new_inbound_channel(private_t *tech_pvt);
|
||||
int outbound_channel_answered(private_t *tech_pvt);
|
||||
//int gsmopen_signaling_write(private_t * tech_pvt, char *msg_to_gsmopen);
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
int gsmopen_pipe_read(switch_file_t * pipe, short *buf, int howmany);
|
||||
int gsmopen_pipe_write(switch_file_t * pipe, short *buf, int howmany);
|
||||
int gsmopen_pipe_read(switch_file_t *pipe, short *buf, int howmany);
|
||||
int gsmopen_pipe_write(switch_file_t *pipe, short *buf, int howmany);
|
||||
/* Visual C do not have strsep ? */
|
||||
char *strsep(char **stringp, const char *delim);
|
||||
#else
|
||||
@@ -549,59 +518,58 @@ int gsmopen_pipe_read(int pipe, short *buf, int howmany);
|
||||
int gsmopen_pipe_write(int pipe, short *buf, int howmany);
|
||||
#endif /* WIN32 */
|
||||
int gsmopen_close_socket(unsigned int fd);
|
||||
private_t *find_available_gsmopen_interface_rr(private_t * tech_pvt_calling);
|
||||
int remote_party_is_ringing(private_t * tech_pvt);
|
||||
int remote_party_is_early_media(private_t * tech_pvt);
|
||||
private_t *find_available_gsmopen_interface_rr(private_t *tech_pvt_calling);
|
||||
int remote_party_is_ringing(private_t *tech_pvt);
|
||||
int remote_party_is_early_media(private_t *tech_pvt);
|
||||
//int gsmopen_answer(private_t * tech_pvt, char *id, char *value);
|
||||
#if 0
|
||||
int gsmopen_transfer(private_t * tech_pvt, char *id, char *value);
|
||||
int gsmopen_transfer(private_t *tech_pvt, char *id, char *value);
|
||||
#endif //0
|
||||
int gsmopen_socket_create_and_bind(private_t * tech_pvt, int *which_port);
|
||||
|
||||
|
||||
|
||||
|
||||
int gsmopen_socket_create_and_bind(private_t *tech_pvt, int *which_port);
|
||||
|
||||
void *gsmopen_do_controldev_thread(void *data);
|
||||
#ifdef WIN32
|
||||
int gsmopen_serial_init(private_t * tech_pvt, int controldevice_speed);
|
||||
#else
|
||||
int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed);
|
||||
#endif //WIN32
|
||||
int gsmopen_serial_monitor(private_t * tech_pvt);
|
||||
int gsmopen_serial_sync(private_t * tech_pvt);
|
||||
int gsmopen_serial_sync_AT(private_t * tech_pvt);
|
||||
int gsmopen_serial_config(private_t * tech_pvt);
|
||||
int gsmopen_serial_config_AT(private_t * tech_pvt);
|
||||
//#ifdef WIN32
|
||||
int gsmopen_serial_init(private_t *tech_pvt, int controldevice_speed);
|
||||
//#else
|
||||
//int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed);
|
||||
//#endif //WIN32
|
||||
int gsmopen_serial_monitor(private_t *tech_pvt);
|
||||
int gsmopen_serial_sync(private_t *tech_pvt);
|
||||
int gsmopen_serial_sync_AT(private_t *tech_pvt);
|
||||
int gsmopen_serial_config(private_t *tech_pvt);
|
||||
int gsmopen_serial_config_AT(private_t *tech_pvt);
|
||||
|
||||
#define gsmopen_serial_write_AT_expect(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 2)
|
||||
#define gsmopen_serial_write_AT_expect_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 2)
|
||||
#define gsmopen_serial_write_AT_expect(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 0)
|
||||
#define gsmopen_serial_write_AT_expect_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 0)
|
||||
#define gsmopen_serial_write_AT_expect_noexpcr_tout(P, D, S, T) gsmopen_serial_write_AT_expect1(P, D, S, 0, T)
|
||||
// 20.5 sec timeout, used for querying the SIM and sending SMSs
|
||||
#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 20)
|
||||
#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 20)
|
||||
int gsmopen_serial_write_AT(private_t * tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_nocr(private_t * tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_ack(private_t * tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_noack(private_t * tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_expect1(private_t * tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds);
|
||||
int gsmopen_serial_AT_expect(private_t * tech_pvt, const char *expected_string, int expect_crlf, int seconds);
|
||||
int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf);
|
||||
int gsmopen_serial_read(private_t * tech_pvt);
|
||||
//#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 20)
|
||||
//#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 20)
|
||||
#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 5)
|
||||
#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 5)
|
||||
int gsmopen_serial_write_AT(private_t *tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_nocr(private_t *tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_ack(private_t *tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_ack_nocr_longtime(private_t *tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_noack(private_t *tech_pvt, const char *data);
|
||||
int gsmopen_serial_write_AT_expect1(private_t *tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds);
|
||||
int gsmopen_serial_AT_expect(private_t *tech_pvt, const char *expected_string, int expect_crlf, int seconds);
|
||||
int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf);
|
||||
int gsmopen_serial_read(private_t *tech_pvt);
|
||||
#ifdef NOTDEF
|
||||
int gsmopen_serial_getstatus(private_t * tech_pvt);
|
||||
int gsmopen_serial_hangup(private_t * tech_pvt);
|
||||
int gsmopen_serial_answer(private_t * tech_pvt);
|
||||
int gsmopen_serial_answer_AT(private_t * tech_pvt);
|
||||
int gsmopen_serial_hangup_AT(private_t * tech_pvt);
|
||||
int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr);
|
||||
int gsmopen_serial_getstatus_AT(private_t * tech_pvt);
|
||||
int gsmopen_serial_getstatus(private_t *tech_pvt);
|
||||
int gsmopen_serial_hangup(private_t *tech_pvt);
|
||||
int gsmopen_serial_answer(private_t *tech_pvt);
|
||||
int gsmopen_serial_answer_AT(private_t *tech_pvt);
|
||||
int gsmopen_serial_hangup_AT(private_t *tech_pvt);
|
||||
int gsmopen_serial_call_AT(private_t *tech_pvt, char *dstr);
|
||||
int gsmopen_serial_getstatus_AT(private_t *tech_pvt);
|
||||
#endif // NOTDEF
|
||||
#define RESULT_FAILURE 0
|
||||
#define RESULT_SUCCESS 1
|
||||
int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft);
|
||||
int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft);
|
||||
int utf8_to_ucs2(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft);
|
||||
int ucs2_to_utf8(private_t *tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft);
|
||||
int utf8_to_iso_8859_1(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *iso_8859_1_out, size_t outbytesleft);
|
||||
//#define PUSHA_UNLOCKA(x) pthread_cleanup_push(gsmopen_unlocka_log, (void *) x);
|
||||
//#define POPPA_UNLOCKA(x) pthread_cleanup_pop(0);
|
||||
|
||||
@@ -616,50 +584,29 @@ int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t out
|
||||
|
||||
#define ast_setstate(x, y) ERRORA("ast_setstate: %p, %d\n", GSMOPEN_P_LOG, (void *)x, y);
|
||||
|
||||
int gsmopen_serial_read(private_t * tech_pvt);
|
||||
int gsmopen_answer(private_t * tech_pvt);
|
||||
int gsmopen_serial_answer(private_t * tech_pvt);
|
||||
int gsmopen_serial_answer_AT(private_t * tech_pvt);
|
||||
int gsmopen_serial_hangup(private_t * tech_pvt);
|
||||
int gsmopen_serial_hangup_AT(private_t * tech_pvt);
|
||||
int gsmopen_hangup(private_t * tech_pvt);
|
||||
int gsmopen_serial_call(private_t * tech_pvt, char *dstr);
|
||||
int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr);
|
||||
int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text);
|
||||
|
||||
#ifdef GSMOPEN_ALSA
|
||||
int alsa_init(private_t * tech_pvt);
|
||||
int alsa_shutdown(private_t * tech_pvt);
|
||||
snd_pcm_t *alsa_open_dev(private_t * tech_pvt, snd_pcm_stream_t stream);
|
||||
int alsa_write(private_t * tech_pvt, short *data, int datalen);
|
||||
int alsa_read(private_t * tech_pvt, short *data, int datalen);
|
||||
|
||||
#endif /* GSMOPEN_ALSA */
|
||||
|
||||
int gsmopen_serial_read(private_t *tech_pvt);
|
||||
int gsmopen_answer(private_t *tech_pvt);
|
||||
int gsmopen_serial_answer(private_t *tech_pvt);
|
||||
int gsmopen_serial_answer_AT(private_t *tech_pvt);
|
||||
int gsmopen_serial_hangup(private_t *tech_pvt);
|
||||
int gsmopen_serial_hangup_AT(private_t *tech_pvt);
|
||||
int gsmopen_hangup(private_t *tech_pvt);
|
||||
int gsmopen_serial_call(private_t *tech_pvt, char *dstr);
|
||||
int gsmopen_serial_call_AT(private_t *tech_pvt, char *dstr);
|
||||
int gsmopen_sendsms(private_t *tech_pvt, char *dest, char *text);
|
||||
|
||||
void gsmopen_store_boost(char *s, double *boost);
|
||||
int gsmopen_sound_boost(void *data, int samples_num, double boost);
|
||||
int sms_incoming(private_t * tech_pvt);
|
||||
int gsmopen_ring(private_t * tech_pvt);
|
||||
int sms_incoming(private_t *tech_pvt);
|
||||
int gsmopen_ring(private_t *tech_pvt);
|
||||
|
||||
int iso_8859_1_to_utf8(private_t * tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft);
|
||||
int gsmopen_serial_getstatus_AT(private_t * tech_pvt);
|
||||
int iso_8859_1_to_utf8(private_t *tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft);
|
||||
int gsmopen_serial_getstatus_AT(private_t *tech_pvt);
|
||||
|
||||
|
||||
#ifdef GSMOPEN_PORTAUDIO
|
||||
|
||||
int gsmopen_portaudio_devlist(private_t *tech_pvt);
|
||||
|
||||
int gsmopen_portaudio_init(private_t *tech_pvt);
|
||||
|
||||
int gsmopen_portaudio_write(private_t * tech_pvt, short *data, int datalen);
|
||||
|
||||
int gsmopen_portaudio_read(private_t * tech_pvt, short *data, int datalen);
|
||||
|
||||
|
||||
int gsmopen_portaudio_shutdown(private_t *tech_pvt);
|
||||
|
||||
#endif // GSMOPEN_PORTAUDIO
|
||||
int dump_event(private_t *tech_pvt);
|
||||
int alarm_event(private_t * tech_pvt, int alarm_code, const char *alarm_message);
|
||||
int dump_event_full(private_t * tech_pvt, int is_alarm, int alarm_code, const char *alarm_message);
|
||||
int alarm_event(private_t *tech_pvt, int alarm_code, const char *alarm_message);
|
||||
int dump_event_full(private_t *tech_pvt, int is_alarm, int alarm_code, const char *alarm_message);
|
||||
|
||||
int gsmopen_serial_init_audio_port(private_t *tech_pvt, int controldevice_audio_speed);
|
||||
int serial_audio_init(private_t *tech_pvt);
|
||||
int serial_audio_shutdown(private_t *tech_pvt);
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,18 @@
|
||||
Copyright
|
||||
|
||||
Copyright (C) 1999-2010 Joachim Buermann (jbuermann@iftools.com)
|
||||
|
||||
ctb is free software; you can redistribute it and/or modify it under
|
||||
the term of the GNU Library General Public Licence as published by the
|
||||
Free Software Foundation.
|
||||
|
||||
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
|
||||
Library General Public Licence for more details
|
||||
|
||||
|
||||
EXCEPTION NOTICE
|
||||
As a special exception, you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the library.
|
||||
@@ -0,0 +1,293 @@
|
||||
# =========================================================================
|
||||
# This makefile was generated by
|
||||
# Bakefile 0.2.5 (http://www.bakefile.org)
|
||||
# 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
|
||||
|
||||
# Destination root (/ is used if empty)
|
||||
DESTDIR ?=
|
||||
|
||||
#
|
||||
AR ?= ar
|
||||
|
||||
#
|
||||
RANLIB ?= ranlib
|
||||
|
||||
# Compiler flags to link shared library
|
||||
LINK_DLL_FLAGS ?= -shared
|
||||
|
||||
# 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 -MP
|
||||
CTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -D_THREAD_SAFE -pthread \
|
||||
$(__OPTIMIZE_FLAG) -I../include $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTB_LIB_OBJECTS = \
|
||||
$(OUTPUT)/ctb_lib_fifo.o \
|
||||
$(OUTPUT)/ctb_lib_getopt.o \
|
||||
$(OUTPUT)/ctb_lib_iobase.o \
|
||||
$(OUTPUT)/ctb_lib_portscan.o \
|
||||
$(OUTPUT)/ctb_lib_serportx.o \
|
||||
$(OUTPUT)/ctb_lib_serport.o \
|
||||
$(OUTPUT)/ctb_lib_timer.o \
|
||||
$(__GPIBSRC_OBJECTS)
|
||||
CTB_DLL_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -D_THREAD_SAFE -pthread \
|
||||
$(__OPTIMIZE_FLAG) -I../include -fPIC -DPIC $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTB_DLL_OBJECTS = \
|
||||
$(OUTPUT)/ctb_dll_fifo.o \
|
||||
$(OUTPUT)/ctb_dll_getopt.o \
|
||||
$(OUTPUT)/ctb_dll_iobase.o \
|
||||
$(OUTPUT)/ctb_dll_portscan.o \
|
||||
$(OUTPUT)/ctb_dll_serportx.o \
|
||||
$(OUTPUT)/ctb_dll_serport.o \
|
||||
$(OUTPUT)/ctb_dll_timer.o \
|
||||
$(__GPIBSRC_OBJECTS_1)
|
||||
CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -DGPIB=$(GPIB) -D_THREAD_SAFE \
|
||||
-pthread $(__OPTIMIZE_FLAG) -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)
|
||||
LIBFLAG = d
|
||||
endif
|
||||
ifeq ($(GPIB),1)
|
||||
GPIBFLAG = _gpib
|
||||
endif
|
||||
ifeq ($(GPIB),1)
|
||||
GPIBINC = gpib.h
|
||||
endif
|
||||
ifeq ($(GPIB),1)
|
||||
__GPIBSRC_OBJECTS = \
|
||||
$(OUTPUT)/ctb_lib_gpib.o
|
||||
endif
|
||||
ifeq ($(GPIB),1)
|
||||
__GPIBSRC_OBJECTS_1 = \
|
||||
$(OUTPUT)/ctb_dll_gpib.o
|
||||
endif
|
||||
ifeq ($(DEBUG),0)
|
||||
____DEBUG = -DNDEBUG
|
||||
endif
|
||||
ifeq ($(DEBUG),1)
|
||||
____DEBUG =
|
||||
endif
|
||||
ifeq ($(DEBUG),0)
|
||||
__OPTIMIZE_FLAG = -O0
|
||||
endif
|
||||
ifeq ($(DEBUG),1)
|
||||
__OPTIMIZE_FLAG = -O2
|
||||
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/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so $(OUTPUT)/ctbtest tip-linux
|
||||
|
||||
install: install_ctb_lib install_ctb_dll
|
||||
$(INSTALL) -d $(DESTDIR)$(prefix)/include/ctb-0.16
|
||||
for f in ctb.h fifo.h getopt.h $(GPIBINC) iobase.h linux/serport.h linux/timer.h portscan.h serport.h serportx.h timer.h; do \
|
||||
if test ! -d $(DESTDIR)$(prefix)/include/ctb-0.16/`dirname $$f` ; then \
|
||||
$(INSTALL) -d $(DESTDIR)$(prefix)/include/ctb-0.16/`dirname $$f`; \
|
||||
fi; \
|
||||
$(INSTALL) -m 644 ../include/ctb-0.16/$$f $(DESTDIR)$(prefix)/include/ctb-0.16/$$f; \
|
||||
done
|
||||
|
||||
uninstall: uninstall_ctb_lib uninstall_ctb_dll
|
||||
for f in ctb.h fifo.h getopt.h $(GPIBINC) iobase.h linux/serport.h linux/timer.h portscan.h serport.h serportx.h timer.h; do \
|
||||
rm -f $(DESTDIR)$(prefix)/include/ctb-0.16/$$f; \
|
||||
done
|
||||
|
||||
clean:
|
||||
rm -f $(OUTPUT)/*.o
|
||||
rm -f $(OUTPUT)/*.d
|
||||
rm -f ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a
|
||||
rm -f ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so
|
||||
rm -f ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so
|
||||
rm -f $(OUTPUT)/ctbtest
|
||||
|
||||
htmldoc:
|
||||
(cd ..; tar -cvzf manual/libctb-0.16-htmldoc.tar.gz docs/html/ )
|
||||
|
||||
tarball:
|
||||
(cd ../..; tar -cvzf libctb-0.16.tar.gz \
|
||||
libctb-0.16/build/ \
|
||||
libctb-0.16/manual/refman.pdf \
|
||||
libctb-0.16/include \
|
||||
libctb-0.16/python \
|
||||
libctb-0.16/samples \
|
||||
libctb-0.16/src \
|
||||
libctb-0.16/lib/gpib32.lib \
|
||||
--exclude=release \
|
||||
--exclude=debug \
|
||||
--exclude=install \
|
||||
--exclude=output \
|
||||
--exclude=website \
|
||||
--exclude=*~ \
|
||||
--exclude=buildall.sh \
|
||||
--exclude=buildall.bat \
|
||||
--exclude=version-update.sh \
|
||||
--exclude=libctb-0.16.tar.gz \
|
||||
--exclude=*.ilk \
|
||||
--exclude=*.log \
|
||||
--exclude=*.o* \
|
||||
--exclude=*.pdb \
|
||||
--exclude=*.pyc \
|
||||
--exclude=.svn; mv libctb-0.16.tar.gz libctb-0.16/build )
|
||||
|
||||
../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a: $(CTB_LIB_OBJECTS)
|
||||
rm -f $@
|
||||
$(AR) rcu $@ $(CTB_LIB_OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
install_ctb_lib: ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a
|
||||
$(INSTALL) -d $(DESTDIR)$(prefix)/lib
|
||||
$(INSTALL) -m 644 ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a $(DESTDIR)$(prefix)/lib
|
||||
|
||||
uninstall_ctb_lib:
|
||||
rm -f $(DESTDIR)$(prefix)/lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a
|
||||
|
||||
../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so: $(CTB_DLL_OBJECTS)
|
||||
$(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ $(CTB_DLL_OBJECTS) $(____DEBUG_1) -pthread -L../lib $(LDFLAGS) -lpthread $(__SYSLIB2_p)
|
||||
|
||||
install_ctb_dll: ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so
|
||||
$(INSTALL) -d $(DESTDIR)$(prefix)/lib
|
||||
$(INSTALL) -m 644 ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so $(DESTDIR)$(prefix)/lib
|
||||
install -c ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so $(DESTDIR)$(prefix)/lib
|
||||
|
||||
uninstall_ctb_dll:
|
||||
rm -f $(DESTDIR)$(prefix)/lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so
|
||||
rm -f $(DESTDIR)$(prefix)/lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so
|
||||
|
||||
$(OUTPUT)/ctbtest: $(CTBTEST_OBJECTS) ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a
|
||||
$(CXX) -o $@ $(CTBTEST_OBJECTS) $(____DEBUG_1) -pthread -L../lib $(LDFLAGS) ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a -lpthread $(__SYSLIB2_p)
|
||||
|
||||
tip-linux:
|
||||
@echo " "
|
||||
@echo "================================================================"
|
||||
@echo " The building of ctb 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/ctb-0.16"
|
||||
@echo " "
|
||||
@echo " Don't forget to run ldconfig (also as root)"
|
||||
@echo " "
|
||||
@echo " ctb comes with no guarantees and doesn't claim"
|
||||
@echo " to be suitable for any purpose."
|
||||
@echo "================================================================"
|
||||
@echo " "
|
||||
|
||||
$(OUTPUT)/ctb_lib_fifo.o: ./../src/fifo.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_lib_getopt.o: ./../src/getopt.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_lib_iobase.o: ./../src/iobase.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_lib_portscan.o: ./../src/portscan.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_lib_serportx.o: ./../src/serportx.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_lib_serport.o: ./../src/linux/serport.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_lib_timer.o: ./../src/linux/timer.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_lib_gpib.o: ./../src/gpib.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_dll_fifo.o: ./../src/fifo.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_dll_getopt.o: ./../src/getopt.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_dll_iobase.o: ./../src/iobase.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_dll_portscan.o: ./../src/portscan.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_dll_serportx.o: ./../src/serportx.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_dll_serport.o: ./../src/linux/serport.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_dll_timer.o: ./../src/linux/timer.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctb_dll_gpib.o: ./../src/gpib.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)/ctbtest_ctbtest.o: ./../samples/ctbtest.cpp
|
||||
$(CXX) -c -o $@ $(CTBTEST_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
.PHONY: all install uninstall clean install_ctb_lib uninstall_ctb_lib \
|
||||
install_ctb_dll uninstall_ctb_dll
|
||||
|
||||
|
||||
# Dependencies tracking:
|
||||
-include $(OUTPUT)/*.d
|
||||
@@ -0,0 +1,169 @@
|
||||
|
||||
CTB (Communication toolbox library) 08.02.2010
|
||||
======================================================================
|
||||
|
||||
Website: http://www.iftools.com/opensource/ctb.en.php
|
||||
Version: 0.16
|
||||
|
||||
|
||||
Linux GCC compiliation
|
||||
----------------------------------------------------------------
|
||||
|
||||
Type 'make DEBUG=x GPIB=x' or 'make -f GNUmakefile DEBUG=x GPIB=x'
|
||||
|
||||
Type the same command with an additional install as root to copy the
|
||||
headers and libs to there according system places
|
||||
(i.e. /usr/local/include/ctb-0.16 and /usr/local/lib/libctb-0.16.a)
|
||||
like:
|
||||
|
||||
sudo make DEBUG=x GPIB=x install
|
||||
|
||||
|
||||
Microsoft MingW32 compilation
|
||||
----------------------------------------------------------------
|
||||
|
||||
Type mingw32-make -f makefile.gcc DEBUG=x GPIB=x
|
||||
|
||||
Please note! Currently only a shared ctb library will be created.
|
||||
You have to copy the ctb-VERSION.dll in the application path of
|
||||
your application linked with ctb or in a global dll folder (but
|
||||
not recommented!)
|
||||
|
||||
|
||||
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.40 (Windows)
|
||||
- the develop files for python (means the header and the library
|
||||
files). I tested it with Python 2.4. You will get it at:
|
||||
http://www.python.org/ftp/python/2.4.4/python-2.4.4.msi
|
||||
- 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 ctb-0.15/python/module
|
||||
path.
|
||||
On linux:
|
||||
|
||||
export PYTHONPATH=somepath/ctb-0.15/python/module/linux
|
||||
|
||||
On Windows:
|
||||
|
||||
set PYTHONPATH=drive:\somepath\ctb-0.15\python\module\win32
|
||||
|
||||
|
||||
ChangeLog
|
||||
---------
|
||||
|
||||
0.16
|
||||
- added port scan function.
|
||||
- bug fixes for MingW build.
|
||||
|
||||
0.15
|
||||
- added ctb namespace and removed all wx prefix (also in the header
|
||||
path).
|
||||
- Linux: A serial port cannot opened twice or more any longer.
|
||||
- 9 bit data transmission support using the parity bit as ninth bit.
|
||||
- improved documentation
|
||||
- Some more documentation
|
||||
|
||||
0.14
|
||||
- Support for non-standard baudrates (depends on the used UART
|
||||
or USB to RS232 converter.
|
||||
|
||||
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 jbuermann@iftools.com
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
<?xml version="1.0" ?>
|
||||
<makefile>
|
||||
|
||||
<requires version="0.1.1"/>
|
||||
|
||||
<include file="presets/simple.bkl"/>
|
||||
<using module="datafiles"/>
|
||||
|
||||
<!-- default is NO GPIB support, you can change this by -->
|
||||
<!-- calling make with the Option GPIB=1 -->
|
||||
<option name="GPIB">
|
||||
<default-value>0</default-value>
|
||||
</option>
|
||||
|
||||
<!-- the actual ctb library version -->
|
||||
<set var="VERSION">0.16</set>
|
||||
<set var="NAME">libctb</set>
|
||||
|
||||
<!-- The directory where wxWidgets is installed: -->
|
||||
<set var="ENV_VAR">
|
||||
<if cond="FORMAT=='watcom'">%</if>
|
||||
<if cond="FORMAT!='watcom'"></if>
|
||||
</set>
|
||||
|
||||
<option name="WXDIR">
|
||||
<default-value>$(DOLLAR)($(ENV_VAR)WXWIN)</default-value>
|
||||
</option>
|
||||
<option name="INSTALLDIR">
|
||||
<default-value>$(DOLLAR)($(ENV_VAR)WXWIN)</default-value>
|
||||
</option>
|
||||
|
||||
<!-- the output of the compiler/linker will be put in a release -->
|
||||
<!-- or debug folder! -->
|
||||
<set var="OUTPUT">
|
||||
<if cond="DEBUG=='1'">debug</if>
|
||||
<if cond="DEBUG=='0'">release</if>
|
||||
</set>
|
||||
<set var="BUILDDIR">$(OUTPUT)</set>
|
||||
|
||||
<set var="INSTALLDIR">
|
||||
<if cond="PLATFORM_WIN32=='1' and WXDIR==''">..$(DIRSEP)lib</if>
|
||||
</set>
|
||||
|
||||
<!-- set the library name dependent on debug/gpib support -->
|
||||
<set var="LIBFLAG">
|
||||
<if cond="DEBUG=='1'">d</if>
|
||||
</set>
|
||||
|
||||
<set var="SYSLIB1">
|
||||
<if cond="PLATFORM_UNIX=='1'">pthread</if>
|
||||
<if cond="PLATFORM_WIN32=='1'">winmm</if>
|
||||
</set>
|
||||
|
||||
<set var="SYSLIB2">
|
||||
<if cond="PLATFORM_UNIX=='1' and GPIB=='1'">gpib</if>
|
||||
<if cond="PLATFORM_WIN32=='1' and GPIB=='1'">gpib32</if>
|
||||
</set>
|
||||
|
||||
<set var="OS">
|
||||
<if cond="PLATFORM_UNIX=='1'">linux</if>
|
||||
<if cond="PLATFORM_WIN32=='1'">win32</if>
|
||||
</set>
|
||||
|
||||
<set var="GPIBFLAG">
|
||||
<if cond="GPIB=='1'">_gpib</if>
|
||||
</set>
|
||||
|
||||
<set var="GPIBSRC">
|
||||
<if cond="GPIB=='1'">
|
||||
../src/gpib.cpp
|
||||
</if>
|
||||
</set>
|
||||
|
||||
<set var="GPIBINC">
|
||||
<if cond="GPIB=='1'">
|
||||
gpib.h
|
||||
</if>
|
||||
</set>
|
||||
|
||||
<set var="OPTIMIZE_FLAG">
|
||||
<if cond="DEBUG=='0'">off</if>
|
||||
<if cond="DEBUG=='1'">speed</if>
|
||||
</set>
|
||||
|
||||
<set var="FILES">
|
||||
../src/fifo.cpp
|
||||
../src/getopt.cpp
|
||||
../src/iobase.cpp
|
||||
../src/portscan.cpp
|
||||
../src/serportx.cpp
|
||||
../src/$(OS)/serport.cpp
|
||||
../src/$(OS)/timer.cpp
|
||||
</set>
|
||||
|
||||
<define-tag name="run-htmldoc" rules="action">
|
||||
<command>
|
||||
(cd ..; tar -cvzf manual/$(value) docs/html/ )
|
||||
</command>
|
||||
</define-tag>
|
||||
|
||||
<if cond="PLATFORM_UNIX=='1'">
|
||||
<action id="htmldoc">
|
||||
<run-htmldoc>$(NAME)-$(VERSION)-htmldoc.tar.gz</run-htmldoc>
|
||||
</action>
|
||||
</if>
|
||||
|
||||
<define-tag name="run-tarball" rules="action">
|
||||
<command>
|
||||
(cd ../..; tar -cvzf $(value) \
|
||||
$(NAME)-$(VERSION)/build/ \
|
||||
$(NAME)-$(VERSION)/manual/refman.pdf \
|
||||
$(NAME)-$(VERSION)/include \
|
||||
$(NAME)-$(VERSION)/python \
|
||||
$(NAME)-$(VERSION)/samples \
|
||||
$(NAME)-$(VERSION)/src \
|
||||
$(NAME)-$(VERSION)/lib/gpib32.lib \
|
||||
--exclude=release \
|
||||
--exclude=debug \
|
||||
--exclude=install \
|
||||
--exclude=output \
|
||||
--exclude=website \
|
||||
--exclude=*~ \
|
||||
--exclude=buildall.sh \
|
||||
--exclude=buildall.bat \
|
||||
--exclude=g++.sh \
|
||||
--exclude=version-update.sh \
|
||||
--exclude=$(value) \
|
||||
--exclude=*.ilk \
|
||||
--exclude=*.log \
|
||||
--exclude=*.o* \
|
||||
--exclude=*.pdb \
|
||||
--exclude=*.pyc \
|
||||
--exclude=.svn; mv $(value) $(NAME)-$(VERSION)/build )
|
||||
</command>
|
||||
</define-tag>
|
||||
|
||||
<if cond="PLATFORM_UNIX=='1'">
|
||||
<action id="tarball">
|
||||
<run-tarball>$(NAME)-$(VERSION).tar.gz</run-tarball>
|
||||
</action>
|
||||
</if>
|
||||
|
||||
<!-- This is only for UNIX like OS -->
|
||||
<data-files-tree id="install-headers">
|
||||
<srcdir>..$(DIRSEP)include$(DIRSEP)ctb-$(VERSION)</srcdir>
|
||||
<files>
|
||||
ctb.h
|
||||
fifo.h
|
||||
getopt.h
|
||||
$(GPIBINC)
|
||||
iobase.h
|
||||
linux/serport.h
|
||||
linux/timer.h
|
||||
portscan.h
|
||||
serport.h
|
||||
serportx.h
|
||||
timer.h
|
||||
</files>
|
||||
<install-to>$(INCLUDEDIR)$(DIRSEP)ctb-$(VERSION)</install-to>
|
||||
</data-files-tree>
|
||||
|
||||
<lib id="ctb_lib" template="simple">
|
||||
<dirname>../lib</dirname>
|
||||
<libname>ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION)</libname>
|
||||
<!-- for /MT -->
|
||||
<threading>multi</threading>
|
||||
<runtime-libs>static</runtime-libs>
|
||||
<optimize>$(OPTIMIZE_FLAG)</optimize>
|
||||
<sources>
|
||||
$(FILES)
|
||||
$(GPIBSRC)
|
||||
</sources>
|
||||
<lib-path>../lib</lib-path>
|
||||
<sys-lib>$(SYSLIB1)</sys-lib>
|
||||
<sys-lib>$(SYSLIB2)</sys-lib>
|
||||
<include>../include</include>
|
||||
<install-to>$(LIBDIR)</install-to>
|
||||
</lib>
|
||||
<dll id="ctb_dll" template="simple">
|
||||
<dirname>../lib</dirname>
|
||||
<threading>multi</threading>
|
||||
<dllname>ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION)</dllname>
|
||||
<runtime-libs>static</runtime-libs>
|
||||
<optimize>$(OPTIMIZE_FLAG)</optimize>
|
||||
<libname>ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION)</libname>
|
||||
<sources>
|
||||
$(FILES)
|
||||
$(GPIBSRC)
|
||||
</sources>
|
||||
<lib-path>../lib</lib-path>
|
||||
<sys-lib>$(SYSLIB1)</sys-lib>
|
||||
<sys-lib>$(SYSLIB2)</sys-lib>
|
||||
<include>../include</include>
|
||||
<install-to>$(LIBDIR)</install-to>
|
||||
</dll>
|
||||
|
||||
<!-- The sample of ctb -->
|
||||
<!-- ==================== -->
|
||||
<exe id="ctbtest" template="simple">
|
||||
<define>GPIB=$(GPIB)</define>
|
||||
<threading>multi</threading>
|
||||
<runtime-libs>static</runtime-libs>
|
||||
<optimize>$(OPTIMIZE_FLAG)</optimize>
|
||||
<sources>
|
||||
../samples/ctbtest.cpp
|
||||
</sources>
|
||||
<include>../include</include>
|
||||
<lib-path>../lib</lib-path>
|
||||
<library>ctb_lib</library>
|
||||
<sys-lib>$(SYSLIB1)</sys-lib>
|
||||
<sys-lib>$(SYSLIB2)</sys-lib>
|
||||
</exe>
|
||||
|
||||
<set var="LIBNAME">
|
||||
<if cond="FORMAT=='msvc'">vc</if>
|
||||
<if cond="FORMAT!='msvc'">$(FORMAT)</if>
|
||||
</set>
|
||||
|
||||
<action id="wxinstall" cond="PLATFORM_WIN32=='1'">
|
||||
<command>
|
||||
<!-- create the lib directory if it doesn't exist -->
|
||||
@if not exist $(INSTALLDIR)\lib\$(LIBNAME)_lib mkdir $(INSTALLDIR)\lib\$(LIBNAME)_lib
|
||||
<!-- copy the libraries (lib,dll) -->
|
||||
@copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION).lib $(INSTALLDIR)\lib\$(LIBNAME)_lib
|
||||
@copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION).dll $(INSTALLDIR)\lib\$(LIBNAME)_lib
|
||||
<!-- copy the header files -->
|
||||
@if not exist $(INSTALLDIR)\include\ctb-$(VERSION)\win32 mkdir $(INSTALLDIR)\include\ctb-$(VERSION)\win32
|
||||
@copy ..\include\ctb-$(VERSION)\*.h $(INSTALLDIR)\include\ctb-$(VERSION)
|
||||
@copy ..\include\ctb-$(VERSION)\win32\*.h $(INSTALLDIR)\include\ctb-$(VERSION)\win32
|
||||
</command>
|
||||
</action>
|
||||
|
||||
<action id="tip-linux" cond="PLATFORM_UNIX=='1'">
|
||||
<dependency-of>all</dependency-of>
|
||||
<command>
|
||||
@echo " "
|
||||
@echo "================================================================"
|
||||
@echo " The building of ctb 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 $(LIBDIR)"
|
||||
@echo " and the header files in $(INCLUDEDIR)/ctb-$(VERSION)"
|
||||
@echo " "
|
||||
@echo " Don't forget to run ldconfig (also as root)"
|
||||
@echo " "
|
||||
@echo " ctb comes with no guarantees and doesn't claim"
|
||||
@echo " to be suitable for any purpose."
|
||||
@echo "================================================================"
|
||||
@echo " "
|
||||
</command>
|
||||
</action>
|
||||
|
||||
<action id="tip-win32" cond="PLATFORM_WIN32=='1'">
|
||||
<dependency-of>all</dependency-of>
|
||||
<command>
|
||||
@echo " "
|
||||
@echo "================================================================"
|
||||
@echo " The building of ctb 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)$(DIRSEP)lib$(DIRSEP)$(LIBNAME)_lib "
|
||||
@echo " and the header files in"
|
||||
@echo " $(INSTALLDIR)$(DIRSEP)ctb-$(VERSION)"
|
||||
@echo " "
|
||||
@echo " If you are using another compiler (Borland, Watcom, mingw,...) "
|
||||
@echo " take a look in the README in this directory! "
|
||||
@echo " "
|
||||
@echo " ctb comes with no guarantees and doesn't claim "
|
||||
@echo " to be suitable for any purpose. "
|
||||
@echo "================================================================"
|
||||
@echo " "
|
||||
</command>
|
||||
</action>
|
||||
|
||||
</makefile>
|
||||
@@ -0,0 +1,269 @@
|
||||
# =========================================================================
|
||||
# This makefile was generated by
|
||||
# Bakefile 0.2.5 (http://www.bakefile.org)
|
||||
# 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: ###
|
||||
|
||||
CTB_LIB_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) -tWM \
|
||||
$(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTB_LIB_OBJECTS = \
|
||||
$(OUTPUT)\ctb_lib_fifo.obj \
|
||||
$(OUTPUT)\ctb_lib_getopt.obj \
|
||||
$(OUTPUT)\ctb_lib_iobase.obj \
|
||||
$(OUTPUT)\ctb_lib_portscan.obj \
|
||||
$(OUTPUT)\ctb_lib_serportx.obj \
|
||||
$(OUTPUT)\ctb_lib_serport.obj \
|
||||
$(OUTPUT)\ctb_lib_timer.obj \
|
||||
$(____GPIBSRC_FILENAMES_OBJECTS)
|
||||
CTB_DLL_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) -tWM \
|
||||
$(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTB_DLL_OBJECTS = \
|
||||
$(OUTPUT)\ctb_dll_fifo.obj \
|
||||
$(OUTPUT)\ctb_dll_getopt.obj \
|
||||
$(OUTPUT)\ctb_dll_iobase.obj \
|
||||
$(OUTPUT)\ctb_dll_portscan.obj \
|
||||
$(OUTPUT)\ctb_dll_serportx.obj \
|
||||
$(OUTPUT)\ctb_dll_serport.obj \
|
||||
$(OUTPUT)\ctb_dll_timer.obj \
|
||||
$(____GPIBSRC_FILENAMES_1_OBJECTS)
|
||||
CTBTEST_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) \
|
||||
-DGPIB=$(GPIB) -tWM $(__OPTIMIZE_FLAG) -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"
|
||||
LIBFLAG = d
|
||||
!endif
|
||||
!if "$(GPIB)" == "1"
|
||||
GPIBFLAG = _gpib
|
||||
!endif
|
||||
!if "$(GPIB)" == "1"
|
||||
____GPIBSRC_FILENAMES_OBJECTS = \
|
||||
$(OUTPUT)\ctb_lib_gpib.obj
|
||||
!endif
|
||||
!if "$(GPIB)" == "1"
|
||||
____GPIBSRC_FILENAMES_1_OBJECTS = \
|
||||
$(OUTPUT)\ctb_dll_gpib.obj
|
||||
!endif
|
||||
!if "$(DEBUG)" == "0"
|
||||
____DEBUG = -DNDEBUG
|
||||
!endif
|
||||
!if "$(DEBUG)" == "1"
|
||||
____DEBUG =
|
||||
!endif
|
||||
!if "$(DEBUG)" == "0"
|
||||
__OPTIMIZE_FLAG = -Od
|
||||
!endif
|
||||
!if "$(DEBUG)" == "1"
|
||||
__OPTIMIZE_FLAG = -O2
|
||||
!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\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.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\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.tds del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.tds
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilc del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilc
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ild del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ild
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilf del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilf
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ils del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ils
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.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\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib: $(CTB_LIB_OBJECTS)
|
||||
if exist $@ del $@
|
||||
tlib /a /p4096 $@ @&&|
|
||||
$(CTB_LIB_OBJECTS)
|
||||
|
|
||||
|
||||
..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll: $(CTB_DLL_OBJECTS)
|
||||
ilink32 -Tpd -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(____DEBUG_2) -L..\lib $(LDFLAGS) @&&|
|
||||
c0d32.obj $(CTB_DLL_OBJECTS),$@,, winmm.lib $(__SYSLIB2_p) import32.lib cw32mt.lib,,
|
||||
|
|
||||
implib -f ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16 $@
|
||||
|
||||
$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib
|
||||
ilink32 -Tpe -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(____DEBUG_2) -L..\lib $(LDFLAGS) @&&|
|
||||
c0x32.obj $(CTBTEST_OBJECTS),$@,, ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib winmm.lib $(__SYSLIB2_p) import32.lib cw32mt.lib,,
|
||||
|
|
||||
|
||||
wxinstall:
|
||||
@copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\borland_lib
|
||||
@copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\borland_lib
|
||||
|
||||
@if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32
|
||||
@copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16
|
||||
@copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32
|
||||
|
||||
tip-win32:
|
||||
@echo " "
|
||||
@echo "================================================================"
|
||||
@echo " The building of ctb 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)\ctb-0.16"
|
||||
@echo " "
|
||||
@echo " If you are using another compiler (Borland, Watcom, mingw,...) "
|
||||
@echo " take a look in the README in this directory! "
|
||||
@echo " "
|
||||
@echo " ctb comes with no guarantees and doesn't claim "
|
||||
@echo " to be suitable for any purpose. "
|
||||
@echo "================================================================"
|
||||
@echo " "
|
||||
|
||||
$(OUTPUT)\ctb_lib_fifo.obj: .\..\src\fifo.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\fifo.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_getopt.obj: .\..\src\getopt.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\getopt.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_iobase.obj: .\..\src\iobase.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\iobase.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_portscan.obj: .\..\src\portscan.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\portscan.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_serportx.obj: .\..\src\serportx.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\serportx.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_serport.obj: .\..\src\win32\serport.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\serport.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_timer.obj: .\..\src\win32\timer.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\timer.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_gpib.obj: .\..\src\gpib.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\gpib.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_fifo.obj: .\..\src\fifo.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\fifo.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_getopt.obj: .\..\src\getopt.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\getopt.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_iobase.obj: .\..\src\iobase.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\iobase.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_portscan.obj: .\..\src\portscan.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\portscan.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_serportx.obj: .\..\src\serportx.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\serportx.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_serport.obj: .\..\src\win32\serport.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\serport.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_timer.obj: .\..\src\win32\timer.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\timer.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_gpib.obj: .\..\src\gpib.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\gpib.cpp
|
||||
|
||||
$(OUTPUT)\ctbtest_ctbtest.obj: .\..\samples\ctbtest.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CTBTEST_CXXFLAGS) .\..\samples\ctbtest.cpp
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
# =========================================================================
|
||||
# This makefile was generated by
|
||||
# Bakefile 0.2.5 (http://www.bakefile.org)
|
||||
# Do not modify, all changes will be overwritten!
|
||||
# =========================================================================
|
||||
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# These are configurable options:
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# Compiler flags to link shared library
|
||||
LINK_DLL_FLAGS ?= -shared
|
||||
|
||||
# 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 -MP
|
||||
CTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -mthreads $(__OPTIMIZE_FLAG) \
|
||||
-I..\include $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTB_LIB_OBJECTS = \
|
||||
$(OUTPUT)\ctb_lib_fifo.o \
|
||||
$(OUTPUT)\ctb_lib_getopt.o \
|
||||
$(OUTPUT)\ctb_lib_iobase.o \
|
||||
$(OUTPUT)\ctb_lib_portscan.o \
|
||||
$(OUTPUT)\ctb_lib_serportx.o \
|
||||
$(OUTPUT)\ctb_lib_serport.o \
|
||||
$(OUTPUT)\ctb_lib_timer.o \
|
||||
$(____GPIBSRC_FILENAMES_OBJECTS)
|
||||
CTB_DLL_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -mthreads $(__OPTIMIZE_FLAG) \
|
||||
-I..\include $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTB_DLL_OBJECTS = \
|
||||
$(OUTPUT)\ctb_dll_fifo.o \
|
||||
$(OUTPUT)\ctb_dll_getopt.o \
|
||||
$(OUTPUT)\ctb_dll_iobase.o \
|
||||
$(OUTPUT)\ctb_dll_portscan.o \
|
||||
$(OUTPUT)\ctb_dll_serportx.o \
|
||||
$(OUTPUT)\ctb_dll_serport.o \
|
||||
$(OUTPUT)\ctb_dll_timer.o \
|
||||
$(____GPIBSRC_FILENAMES_1_OBJECTS)
|
||||
CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -DGPIB=$(GPIB) -mthreads \
|
||||
$(__OPTIMIZE_FLAG) -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)
|
||||
LIBFLAG = d
|
||||
endif
|
||||
ifeq ($(GPIB),1)
|
||||
GPIBFLAG = _gpib
|
||||
endif
|
||||
ifeq ($(GPIB),1)
|
||||
____GPIBSRC_FILENAMES_OBJECTS = \
|
||||
$(OUTPUT)\ctb_lib_gpib.o
|
||||
endif
|
||||
ifeq ($(GPIB),1)
|
||||
____GPIBSRC_FILENAMES_1_OBJECTS = \
|
||||
$(OUTPUT)\ctb_dll_gpib.o
|
||||
endif
|
||||
ifeq ($(DEBUG),0)
|
||||
____DEBUG = -DNDEBUG
|
||||
endif
|
||||
ifeq ($(DEBUG),1)
|
||||
____DEBUG =
|
||||
endif
|
||||
ifeq ($(DEBUG),0)
|
||||
__OPTIMIZE_FLAG = -O0
|
||||
endif
|
||||
ifeq ($(DEBUG),1)
|
||||
__OPTIMIZE_FLAG = -O2
|
||||
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\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(OUTPUT)\ctbtest.exe tip-win32
|
||||
|
||||
clean:
|
||||
-if exist $(OUTPUT)\*.o del $(OUTPUT)\*.o
|
||||
-if exist $(OUTPUT)\*.d del $(OUTPUT)\*.d
|
||||
-if exist ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a del ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll
|
||||
-if exist ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a del ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a
|
||||
-if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe
|
||||
|
||||
..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a: $(CTB_LIB_OBJECTS)
|
||||
if exist $@ del $@
|
||||
ar rcu $@ $(CTB_LIB_OBJECTS)
|
||||
ranlib $@
|
||||
|
||||
..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll: $(CTB_DLL_OBJECTS)
|
||||
$(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ $(CTB_DLL_OBJECTS) $(____DEBUG_1) -mthreads -Wl,--out-implib=..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a -L..\lib $(LDFLAGS) -lwinmm $(__SYSLIB2_p)
|
||||
|
||||
$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a
|
||||
$(CXX) -o $@ $(CTBTEST_OBJECTS) $(____DEBUG_1) -mthreads -L..\lib $(LDFLAGS) ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a -lwinmm $(__SYSLIB2_p)
|
||||
|
||||
wxinstall:
|
||||
@copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\mingw_lib
|
||||
@copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\mingw_lib
|
||||
|
||||
@if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32
|
||||
@copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16
|
||||
@copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32
|
||||
|
||||
tip-win32:
|
||||
@echo " "
|
||||
@echo "================================================================"
|
||||
@echo " The building of ctb 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)\ctb-0.16"
|
||||
@echo " "
|
||||
@echo " If you are using another compiler (Borland, Watcom, mingw,...) "
|
||||
@echo " take a look in the README in this directory! "
|
||||
@echo " "
|
||||
@echo " ctb comes with no guarantees and doesn't claim "
|
||||
@echo " to be suitable for any purpose. "
|
||||
@echo "================================================================"
|
||||
@echo " "
|
||||
|
||||
$(OUTPUT)\ctb_lib_fifo.o: ./../src/fifo.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_getopt.o: ./../src/getopt.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_iobase.o: ./../src/iobase.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_portscan.o: ./../src/portscan.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_serportx.o: ./../src/serportx.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_serport.o: ./../src/win32/serport.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_timer.o: ./../src/win32/timer.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_gpib.o: ./../src/gpib.cpp
|
||||
$(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_fifo.o: ./../src/fifo.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_getopt.o: ./../src/getopt.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_iobase.o: ./../src/iobase.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_portscan.o: ./../src/portscan.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_serportx.o: ./../src/serportx.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_serport.o: ./../src/win32/serport.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_timer.o: ./../src/win32/timer.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_gpib.o: ./../src/gpib.cpp
|
||||
$(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OUTPUT)\ctbtest_ctbtest.o: ./../samples/ctbtest.cpp
|
||||
$(CXX) -c -o $@ $(CTBTEST_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
|
||||
SHELL := $(COMSPEC)
|
||||
|
||||
# Dependencies tracking:
|
||||
-include $(OUTPUT)/*.d
|
||||
@@ -0,0 +1,260 @@
|
||||
# =========================================================================
|
||||
# This makefile was generated by
|
||||
# Bakefile 0.2.5 (http://www.bakefile.org)
|
||||
# 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]
|
||||
# 0 - Release
|
||||
# 1 - Debug
|
||||
DEBUG = 0
|
||||
|
||||
#
|
||||
GPIB = 0
|
||||
|
||||
#
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
#
|
||||
INSTALLDIR = $(WXWIN)
|
||||
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Do not modify the rest of this file!
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
### Variables: ###
|
||||
|
||||
CTB_LIB_CXXFLAGS = /MD$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \
|
||||
$(______DEBUG) /Fd..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb \
|
||||
$(__OPTIMIZE_FLAG) /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTB_LIB_OBJECTS = \
|
||||
$(OUTPUT)\ctb_lib_fifo.obj \
|
||||
$(OUTPUT)\ctb_lib_getopt.obj \
|
||||
$(OUTPUT)\ctb_lib_iobase.obj \
|
||||
$(OUTPUT)\ctb_lib_portscan.obj \
|
||||
$(OUTPUT)\ctb_lib_serportx.obj \
|
||||
$(OUTPUT)\ctb_lib_serport.obj \
|
||||
$(OUTPUT)\ctb_lib_timer.obj \
|
||||
$(____GPIBSRC_FILENAMES_OBJECTS)
|
||||
CTB_DLL_CXXFLAGS = /MD$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \
|
||||
$(______DEBUG) /Fd..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb \
|
||||
$(__OPTIMIZE_FLAG) /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTB_DLL_OBJECTS = \
|
||||
$(OUTPUT)\ctb_dll_fifo.obj \
|
||||
$(OUTPUT)\ctb_dll_getopt.obj \
|
||||
$(OUTPUT)\ctb_dll_iobase.obj \
|
||||
$(OUTPUT)\ctb_dll_portscan.obj \
|
||||
$(OUTPUT)\ctb_dll_serportx.obj \
|
||||
$(OUTPUT)\ctb_dll_serport.obj \
|
||||
$(OUTPUT)\ctb_dll_timer.obj \
|
||||
$(____GPIBSRC_FILENAMES_1_OBJECTS)
|
||||
CTBTEST_CXXFLAGS = /MD$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \
|
||||
$(______DEBUG) /Fd$(OUTPUT)\ctbtest.pdb /DGPIB=$(GPIB) $(__OPTIMIZE_FLAG) \
|
||||
/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"
|
||||
LIBFLAG = d
|
||||
!endif
|
||||
!if "$(GPIB)" == "1"
|
||||
GPIBFLAG = _gpib
|
||||
!endif
|
||||
!if "$(GPIB)" == "1"
|
||||
____GPIBSRC_FILENAMES_OBJECTS = \
|
||||
$(OUTPUT)\ctb_lib_gpib.obj
|
||||
!endif
|
||||
!if "$(GPIB)" == "1"
|
||||
____GPIBSRC_FILENAMES_1_OBJECTS = \
|
||||
$(OUTPUT)\ctb_dll_gpib.obj
|
||||
!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 "$(DEBUG)" == "0"
|
||||
__OPTIMIZE_FLAG = /Od
|
||||
!endif
|
||||
!if "$(DEBUG)" == "1"
|
||||
__OPTIMIZE_FLAG = /O2
|
||||
!endif
|
||||
!if "$(GPIB)" == "1"
|
||||
__SYSLIB2_p = gpib32.lib
|
||||
!endif
|
||||
|
||||
|
||||
all: $(OUTPUT)
|
||||
$(OUTPUT):
|
||||
-if not exist $(OUTPUT) mkdir $(OUTPUT)
|
||||
|
||||
### Targets: ###
|
||||
|
||||
all: ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.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\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilk del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilk
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.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\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib: $(CTB_LIB_OBJECTS)
|
||||
if exist $@ del $@
|
||||
link /LIB /NOLOGO /OUT:$@ @<<
|
||||
$(CTB_LIB_OBJECTS)
|
||||
<<
|
||||
|
||||
..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll: $(CTB_DLL_OBJECTS)
|
||||
link /DLL /NOLOGO /OUT:$@ $(____DEBUG_3) /pdb:"..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb" /LIBPATH:..\lib $(LDFLAGS) @<<
|
||||
$(CTB_DLL_OBJECTS) winmm.lib $(__SYSLIB2_p) /IMPLIB:..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib
|
||||
<<
|
||||
|
||||
$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib
|
||||
link /NOLOGO /OUT:$@ $(____DEBUG_3) /pdb:"$(OUTPUT)\ctbtest.pdb" /LIBPATH:..\lib $(LDFLAGS) @<<
|
||||
$(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib winmm.lib $(__SYSLIB2_p)
|
||||
<<
|
||||
|
||||
wxinstall:
|
||||
@copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\vc_lib
|
||||
@copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\vc_lib
|
||||
|
||||
@if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32
|
||||
@copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16
|
||||
@copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32
|
||||
|
||||
tip-win32:
|
||||
@echo " "
|
||||
@echo "================================================================"
|
||||
@echo " The building of ctb 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)\ctb-0.16"
|
||||
@echo " "
|
||||
@echo " If you are using another compiler (Borland, Watcom, mingw,...) "
|
||||
@echo " take a look in the README in this directory! "
|
||||
@echo " "
|
||||
@echo " ctb comes with no guarantees and doesn't claim "
|
||||
@echo " to be suitable for any purpose. "
|
||||
@echo "================================================================"
|
||||
@echo " "
|
||||
|
||||
$(OUTPUT)\ctb_lib_fifo.obj: .\..\src\fifo.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\fifo.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_getopt.obj: .\..\src\getopt.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\getopt.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_iobase.obj: .\..\src\iobase.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\iobase.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_portscan.obj: .\..\src\portscan.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\portscan.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_serportx.obj: .\..\src\serportx.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\serportx.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_serport.obj: .\..\src\win32\serport.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\serport.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_timer.obj: .\..\src\win32\timer.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\timer.cpp
|
||||
|
||||
$(OUTPUT)\ctb_lib_gpib.obj: .\..\src\gpib.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\gpib.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_fifo.obj: .\..\src\fifo.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\fifo.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_getopt.obj: .\..\src\getopt.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\getopt.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_iobase.obj: .\..\src\iobase.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\iobase.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_portscan.obj: .\..\src\portscan.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\portscan.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_serportx.obj: .\..\src\serportx.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\serportx.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_serport.obj: .\..\src\win32\serport.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\serport.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_timer.obj: .\..\src\win32\timer.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\timer.cpp
|
||||
|
||||
$(OUTPUT)\ctb_dll_gpib.obj: .\..\src\gpib.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\gpib.cpp
|
||||
|
||||
$(OUTPUT)\ctbtest_ctbtest.obj: .\..\samples\ctbtest.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CTBTEST_CXXFLAGS) .\..\samples\ctbtest.cpp
|
||||
|
||||
@@ -0,0 +1,283 @@
|
||||
# =========================================================================
|
||||
# This makefile was generated by
|
||||
# Bakefile 0.2.5 (http://www.bakefile.org)
|
||||
# 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]
|
||||
# 0 - Release
|
||||
# 1 - Debug
|
||||
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
|
||||
LIBFLAG = d
|
||||
!endif
|
||||
GPIBFLAG =
|
||||
!ifeq GPIB 1
|
||||
GPIBFLAG = _gpib
|
||||
!endif
|
||||
____GPIBSRC_FILENAMES_OBJECTS =
|
||||
!ifeq GPIB 1
|
||||
____GPIBSRC_FILENAMES_OBJECTS = &
|
||||
$(OUTPUT)\ctb_lib_gpib.obj
|
||||
!endif
|
||||
____GPIBSRC_FILENAMES_1_OBJECTS =
|
||||
!ifeq GPIB 1
|
||||
____GPIBSRC_FILENAMES_1_OBJECTS = &
|
||||
$(OUTPUT)\ctb_dll_gpib.obj
|
||||
!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
|
||||
__OPTIMIZE_FLAG =
|
||||
!ifeq DEBUG 0
|
||||
__OPTIMIZE_FLAG = -od
|
||||
!endif
|
||||
!ifeq DEBUG 1
|
||||
__OPTIMIZE_FLAG = -ot -ox
|
||||
!endif
|
||||
__SYSLIB2_p =
|
||||
!ifeq GPIB 1
|
||||
__SYSLIB2_p = gpib32.lib
|
||||
!endif
|
||||
|
||||
### Variables: ###
|
||||
|
||||
CTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_0) -bm $(__OPTIMIZE_FLAG) &
|
||||
-i=..\include $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTB_LIB_OBJECTS = &
|
||||
$(OUTPUT)\ctb_lib_fifo.obj &
|
||||
$(OUTPUT)\ctb_lib_getopt.obj &
|
||||
$(OUTPUT)\ctb_lib_iobase.obj &
|
||||
$(OUTPUT)\ctb_lib_portscan.obj &
|
||||
$(OUTPUT)\ctb_lib_serportx.obj &
|
||||
$(OUTPUT)\ctb_lib_serport.obj &
|
||||
$(OUTPUT)\ctb_lib_timer.obj &
|
||||
$(____GPIBSRC_FILENAMES_OBJECTS)
|
||||
CTB_DLL_CXXFLAGS = -bd $(____DEBUG) $(____DEBUG_0) -bm $(__OPTIMIZE_FLAG) &
|
||||
-i=..\include $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTB_DLL_OBJECTS = &
|
||||
$(OUTPUT)\ctb_dll_fifo.obj &
|
||||
$(OUTPUT)\ctb_dll_getopt.obj &
|
||||
$(OUTPUT)\ctb_dll_iobase.obj &
|
||||
$(OUTPUT)\ctb_dll_portscan.obj &
|
||||
$(OUTPUT)\ctb_dll_serportx.obj &
|
||||
$(OUTPUT)\ctb_dll_serport.obj &
|
||||
$(OUTPUT)\ctb_dll_timer.obj &
|
||||
$(____GPIBSRC_FILENAMES_1_OBJECTS)
|
||||
CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_0) -dGPIB=$(GPIB) -bm &
|
||||
$(__OPTIMIZE_FLAG) -i=..\include $(CPPFLAGS) $(CXXFLAGS)
|
||||
CTBTEST_OBJECTS = &
|
||||
$(OUTPUT)\ctbtest_ctbtest.obj
|
||||
|
||||
|
||||
all : $(OUTPUT)
|
||||
$(OUTPUT) :
|
||||
-if not exist $(OUTPUT) mkdir $(OUTPUT)
|
||||
|
||||
### Targets: ###
|
||||
|
||||
all : .SYMBOLIC ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.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\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll
|
||||
-if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib
|
||||
-if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe
|
||||
|
||||
..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib : $(CTB_LIB_OBJECTS)
|
||||
@%create $(OUTPUT)\ctb_lib.lbc
|
||||
@for %i in ($(CTB_LIB_OBJECTS)) do @%append $(OUTPUT)\ctb_lib.lbc +%i
|
||||
wlib -q -p4096 -n -b $^@ @$(OUTPUT)\ctb_lib.lbc
|
||||
|
||||
..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll : $(CTB_DLL_OBJECTS)
|
||||
@%create $(OUTPUT)\ctb_dll.lbc
|
||||
@%append $(OUTPUT)\ctb_dll.lbc option quiet
|
||||
@%append $(OUTPUT)\ctb_dll.lbc name $^@
|
||||
@%append $(OUTPUT)\ctb_dll.lbc option caseexact
|
||||
@%append $(OUTPUT)\ctb_dll.lbc $(____DEBUG_2) libpath ..\lib $(LDFLAGS)
|
||||
@for %i in ($(CTB_DLL_OBJECTS)) do @%append $(OUTPUT)\ctb_dll.lbc file %i
|
||||
@for %i in ( winmm.lib $(__SYSLIB2_p)) do @%append $(OUTPUT)\ctb_dll.lbc library %i
|
||||
@%append $(OUTPUT)\ctb_dll.lbc
|
||||
@%append $(OUTPUT)\ctb_dll.lbc system nt_dll
|
||||
wlink @$(OUTPUT)\ctb_dll.lbc
|
||||
wlib -q -n -b ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib +$^@
|
||||
|
||||
$(OUTPUT)\ctbtest.exe : $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.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 $(____DEBUG_2) libpath ..\lib $(LDFLAGS)
|
||||
@for %i in ($(CTBTEST_OBJECTS)) do @%append $(OUTPUT)\ctbtest.lbc file %i
|
||||
@for %i in ( ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib winmm.lib $(__SYSLIB2_p)) do @%append $(OUTPUT)\ctbtest.lbc library %i
|
||||
@%append $(OUTPUT)\ctbtest.lbc
|
||||
@for %i in () do @%append $(OUTPUT)\ctbtest.lbc option stack=%i
|
||||
wlink @$(OUTPUT)\ctbtest.lbc
|
||||
|
||||
wxinstall :
|
||||
@copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\watcom_lib
|
||||
@copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\watcom_lib
|
||||
|
||||
@if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32
|
||||
@copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16
|
||||
@copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32
|
||||
|
||||
tip-win32 :
|
||||
@echo " "
|
||||
@echo "================================================================"
|
||||
@echo " The building of ctb 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\watcom_lib "
|
||||
@echo " and the header files in"
|
||||
@echo " $(INSTALLDIR)\ctb-0.16"
|
||||
@echo " "
|
||||
@echo " If you are using another compiler (Borland, Watcom, mingw,...) "
|
||||
@echo " take a look in the README in this directory! "
|
||||
@echo " "
|
||||
@echo " ctb comes with no guarantees and doesn't claim "
|
||||
@echo " to be suitable for any purpose. "
|
||||
@echo "================================================================"
|
||||
@echo " "
|
||||
|
||||
$(OUTPUT)\ctb_lib_fifo.obj : .AUTODEPEND .\..\src\fifo.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_getopt.obj : .AUTODEPEND .\..\src\getopt.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_iobase.obj : .AUTODEPEND .\..\src\iobase.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_portscan.obj : .AUTODEPEND .\..\src\portscan.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_serportx.obj : .AUTODEPEND .\..\src\serportx.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_serport.obj : .AUTODEPEND .\..\src\win32\serport.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_timer.obj : .AUTODEPEND .\..\src\win32\timer.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_lib_gpib.obj : .AUTODEPEND .\..\src\gpib.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_fifo.obj : .AUTODEPEND .\..\src\fifo.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_getopt.obj : .AUTODEPEND .\..\src\getopt.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_iobase.obj : .AUTODEPEND .\..\src\iobase.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_portscan.obj : .AUTODEPEND .\..\src\portscan.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_serportx.obj : .AUTODEPEND .\..\src\serportx.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_serport.obj : .AUTODEPEND .\..\src\win32\serport.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_timer.obj : .AUTODEPEND .\..\src\win32\timer.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctb_dll_gpib.obj : .AUTODEPEND .\..\src\gpib.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $<
|
||||
|
||||
$(OUTPUT)\ctbtest_ctbtest.obj : .AUTODEPEND .\..\samples\ctbtest.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CTBTEST_CXXFLAGS) $<
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
#ifndef LIBCTB_CTB_H_INCLUDED_
|
||||
#define LIBCTB_CTB_H_INCLUDED_
|
||||
|
||||
#include "ctb-0.16/fifo.h"
|
||||
#if ( GPIB )
|
||||
# include "ctb-0.16/gpib.h"
|
||||
#endif
|
||||
#include "ctb-0.16/getopt.h"
|
||||
#include "ctb-0.16/iobase.h"
|
||||
//#include "ctb-0.16/kbhit.h"
|
||||
#include "ctb-0.16/portscan.h"
|
||||
#include "ctb-0.16/serport.h"
|
||||
#include "ctb-0.16/serportx.h"
|
||||
#include "ctb-0.16/timer.h"
|
||||
|
||||
/*!
|
||||
\mainpage ctb overview
|
||||
|
||||
The ctb (communication toolbox) library was realized, to simplify the
|
||||
communication with other instruments throughout the serial com ports
|
||||
(at first). To make my life easier, it should works with Linux and
|
||||
all win32 plattforms (excepted windows 3.1, which is a only 16bit OS)
|
||||
because I develope my applications for both plattforms).\n
|
||||
Some times later GPIB support was added to make ctb an integrated part
|
||||
for the extensive test and calibration system of a company I worked
|
||||
these days.\n
|
||||
The main goal of the library was a non-blocked communication to avoid
|
||||
frozen GUIs waiting for data which in some conditions never arrives.
|
||||
|
||||
On the base ctb defines an abstract class IOBase, which must be
|
||||
derivate for several interfaces (at now this was done for the
|
||||
RS232 comports and GPIB IEEE488 interface).
|
||||
|
||||
This leads to another feature: Because all classes depends on one
|
||||
super class, you have just open your wanted interface and don't
|
||||
worry about it's special typ later. This is like the 'Virtual
|
||||
Instrument' featured by Nation Instruments LabView.
|
||||
|
||||
Last not least: ctb provides one written code for Linux and Windows
|
||||
(compiles well with GNU G++ and VC++). Without any dependences (execept
|
||||
for a standard C++ compilier) ctb runs also in small enviroments like
|
||||
embedded systems and doesn't need any graphic stuff for use.
|
||||
|
||||
ctb is composed of five parts:
|
||||
|
||||
- ctb::IOBase class
|
||||
- ctb::SerialPort class
|
||||
- ctb::GpibDevice class
|
||||
- ctb::Timer class
|
||||
- ctb::Fifo class
|
||||
|
||||
\section IOBase IOBase class
|
||||
|
||||
An abstract class for different interfaces. The idea behind this:
|
||||
Similar to the virtual file system this class defines a lot of
|
||||
preset member functions, which the derivate classes must be
|
||||
overload.\n
|
||||
In the main thing these are: open a interface (such as RS232),
|
||||
reading and writing non blocked through the interface and at
|
||||
last, close it.\n
|
||||
For special interface settings the method ioctl was defined.
|
||||
(control interface). ioctl covers some interface dependent
|
||||
settings like switch on/off the RS232 status lines and must also
|
||||
be defined from each derivated class.
|
||||
|
||||
|
||||
\section SerialPort SerialPort class
|
||||
|
||||
The class for the serial ports is named as
|
||||
ctb::SerialPort. SerialPort is a wrapper for non blocked reading and
|
||||
writing. This is easy under linux, but with windows a lot more
|
||||
tricky. SerialPort is as simple as possible. It doesn't create any
|
||||
gui events or signals, so it works also standalone. It's also not a
|
||||
device driver, means, you must call the read method, if you look for
|
||||
receiving data.
|
||||
|
||||
You can write any desired data with any length (length type is
|
||||
size_t, I think, on win32 and linux this is a 32Bit integer) and
|
||||
SerialPort returns the really writen data length, also you can read
|
||||
a lot of data and SerialPort returns the really received data count.
|
||||
|
||||
Both, read and write returns immediatelly. Using these, the program
|
||||
never blocks. Also IOBase implements a blocked read and write. You can
|
||||
use these functions, if you want a definitiv count of data and never
|
||||
accept less than this. Because there is a difficulty, when the
|
||||
communication is interrupted or death, both blocked functions get a
|
||||
timeout flag to returns after a given time interval. The timeouts
|
||||
will be handled with the second timer class.
|
||||
|
||||
As an additional benefit ctb features also 9 Bit transmission (with
|
||||
take advantage of the parity bit), non-standard baudrates (depending
|
||||
on your hardware but not on ctb) and all parity eventualities
|
||||
including static parity settings like Mark and Space.
|
||||
|
||||
\section GpibDevice GpibDevice class
|
||||
|
||||
Named as ctb::GpibDevice. In the philosophy of the SerialPort class
|
||||
GpibDevice also supports non-blocking communication. You can instant
|
||||
as many GpibDevice objects as you need for instance to communicate
|
||||
with a lot of different bus participants in a typical GPIB enviroment.
|
||||
GPIB support was tested with PCI cards and USB adapter from Nation
|
||||
Instrument and Keithley.
|
||||
|
||||
\section Timer Timer class
|
||||
|
||||
The idea of the ctb::Timer class is to base on the Unix C alarm
|
||||
function. You create a Timer with a given alarm time and a adress of
|
||||
flag, which the timer must set after the time is over.
|
||||
|
||||
Because the alarm function cannot used more than once in the same
|
||||
process (under windows I don't know a similar function), every timer
|
||||
instance will be a separate thread after starting it. So you can start
|
||||
a timer and continue in your program, make a lot of things and test
|
||||
the flag whenever you want this. (For example, you read/write a
|
||||
given count of data).
|
||||
|
||||
\note
|
||||
I think, it's a better style, to request a given count of data in
|
||||
100ms (for example) and trap the situation, if there are not enough
|
||||
data after this time. And not do this for every byte!
|
||||
|
||||
\section Fifo Fifo cass
|
||||
Provides a simple thread safe fifo to realize a fast and simple
|
||||
communication pipe between two threads (and was used also as a put
|
||||
back mechanism for the wxIOBase and it's derivated classes).\n
|
||||
ctb::Fifo tackles the concurrently access from different threads with an
|
||||
internal temporary pointer asignment which was atomic. From there no
|
||||
mutex or semaphore is involved and lead to a fast access.
|
||||
|
||||
Please note:\n
|
||||
The thread safeness is limited to the put/get write/read methods but
|
||||
which should be sufficent for a fifo.
|
||||
|
||||
|
||||
\latexonly \newpage \endlatexonly
|
||||
|
||||
*/
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,96 @@
|
||||
#ifndef __LIBCTB_FIFO_H_INCLUDED_
|
||||
#define __LIBCTB_FIFO_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: fifo.h
|
||||
// Purpose:
|
||||
// Author: Joachim Buermann, Michael Hungershausen
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/**
|
||||
\file fifo.h
|
||||
*/
|
||||
|
||||
namespace ctb {
|
||||
|
||||
/*!
|
||||
\class Fifo
|
||||
A simple thread safe fifo to realize a put back mechanism for the
|
||||
wxIOBase and it's derivated classes.
|
||||
*/
|
||||
class Fifo
|
||||
{
|
||||
protected:
|
||||
/*! the size of the fifo */
|
||||
size_t m_size;
|
||||
/*! the start of the internal fifo buffer */
|
||||
char* m_begin;
|
||||
/*!
|
||||
the end of the internal fifo buffer (m_end marks the first
|
||||
invalid byte AFTER the internal buffer)
|
||||
*/
|
||||
char* m_end;
|
||||
/*! the current read position */
|
||||
char* m_rdptr;
|
||||
/*! the current write position */
|
||||
char* m_wrptr;
|
||||
public:
|
||||
/*!
|
||||
\brief the constructor initialize a fifo with the given size.
|
||||
\param size size of the fifo
|
||||
*/
|
||||
Fifo(size_t size);
|
||||
/*!
|
||||
\brief the destructor destroys all internal memory.
|
||||
*/
|
||||
virtual ~Fifo();
|
||||
/*!
|
||||
\brief clear all internal memory and set the read and write
|
||||
pointers to the start of the internal memory.
|
||||
\Note This function is not thread safe! Don't use it, if another
|
||||
thread takes access to the fifo instance. Use a looping get() or
|
||||
read() call instead of this.
|
||||
*/
|
||||
virtual void clear();
|
||||
/*!
|
||||
\brief fetch the next available byte from the fifo.
|
||||
\param ch points to a charater to store the result
|
||||
\return 1 if successful, 0 otherwise
|
||||
*/
|
||||
virtual int get(char* ch);
|
||||
/*!
|
||||
\brief query the fifo for it's available bytes.
|
||||
\return count of readable bytes, storing in the fifo
|
||||
*/
|
||||
size_t items();
|
||||
/*!
|
||||
\brief put a character into the fifo.
|
||||
\param ch the character to put in
|
||||
\return 1 if successful, 0 otherwise
|
||||
*/
|
||||
virtual int put(char ch);
|
||||
/*!
|
||||
\brief read a given count of bytes out of the fifo.
|
||||
\param data memory to store the readed data
|
||||
\param count number of bytes to read
|
||||
\return On success, the number of bytes read are returned,
|
||||
0 otherwise
|
||||
*/
|
||||
virtual int read(char* data,int count);
|
||||
/*!
|
||||
\brief write a given count of bytes into the fifo.
|
||||
\param data start of the data to write
|
||||
\param count number of bytes to write
|
||||
\return On success, the number of bytes written are returned,
|
||||
0 otherwise
|
||||
*/
|
||||
virtual int write(char* data,int count);
|
||||
};
|
||||
|
||||
} // namespace ctb
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef LIBCTB_GETOPT_H_INCLUDED_
|
||||
#define LIBCTB_GETOPT_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: getopt.h
|
||||
// Purpose: Simple wrapper file
|
||||
// Author: Joachim Buermann
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined (WIN32)
|
||||
# include "win32/getopt.h"
|
||||
#else
|
||||
# include <getopt.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __WX_GETOPT_H
|
||||
@@ -0,0 +1,378 @@
|
||||
#ifndef LIBCTB_GPIB_H_INCLUDED_
|
||||
#define LIBCTB_GPIB_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: gpibx.h
|
||||
// Purpose: base class for gpib devices
|
||||
// Author: Joachim Buermann
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ctb-0.16/iobase.h"
|
||||
|
||||
namespace ctb {
|
||||
|
||||
/*!
|
||||
\file gpib.h
|
||||
*/
|
||||
|
||||
/*! defines the os specific name for the first gpib controller */
|
||||
extern const char* GPIB1;
|
||||
|
||||
/*! defines the os specific name for the second gpib controller */
|
||||
extern const char* GPIB2;
|
||||
|
||||
/*!
|
||||
\enum GpibTimeout
|
||||
NI488.2 API defines the following valid timeouts.
|
||||
*/
|
||||
enum GpibTimeout
|
||||
{
|
||||
/// no timeout (infinity)
|
||||
GpibTimeoutNone = 0,
|
||||
/// 10 micro seconds
|
||||
GpibTimeout10us,
|
||||
/// 30 micro seconds
|
||||
GpibTimeout30us,
|
||||
/// 100 micro seconds
|
||||
GpibTimeout100us,
|
||||
/// 300 micro seconds
|
||||
GpibTimeout300us,
|
||||
/// 1 milli second
|
||||
GpibTimeout1ms,
|
||||
/// 3 milli seconds
|
||||
GpibTimeout3ms,
|
||||
/// 10 milli seconds
|
||||
GpibTimeout10ms,
|
||||
/// 30 milli seconds
|
||||
GpibTimeout30ms,
|
||||
/// 0.1 seconds
|
||||
GpibTimeout100ms,
|
||||
/// 0.3 seconds
|
||||
GpibTimeout300ms,
|
||||
/// 1 second
|
||||
GpibTimeout1s,
|
||||
/// 3 seconds
|
||||
GpibTimeout3s,
|
||||
/// 10 seconds
|
||||
GpibTimeout10s,
|
||||
/// 30 seconds
|
||||
GpibTimeout30s,
|
||||
/// 100 seconds
|
||||
GpibTimeout100s,
|
||||
/// 300 seconds (5 minutes)
|
||||
GpibTimeout300s,
|
||||
/// 1000 seconds
|
||||
GpibTimeout1000s
|
||||
};
|
||||
|
||||
/*!
|
||||
\struct Gpib_DCS
|
||||
|
||||
The device control struct for the gpib communication class.
|
||||
This struct should be used, if you refer advanced parameter.
|
||||
*/
|
||||
struct Gpib_DCS
|
||||
{
|
||||
/*! primary address of GPIB device */
|
||||
int m_address1;
|
||||
/*! secondary address of GPIB device */
|
||||
int m_address2;
|
||||
/*! I/O timeout */
|
||||
GpibTimeout m_timeout;
|
||||
/*! EOT enable */
|
||||
bool m_eot;
|
||||
/*!
|
||||
Defines the EOS character.
|
||||
Note! Defining an EOS byte does not cause the driver to
|
||||
automatically send that byte at the end of write I/O
|
||||
operations. The application is responsible for placing the
|
||||
EOS byte at the end of the data strings that it defines.
|
||||
(National Instruments NI-488.2M Function Reference Manual)
|
||||
*/
|
||||
unsigned char m_eosChar;
|
||||
/*!
|
||||
Set the EOS mode (handling).m_eosMode may be a combination
|
||||
of bits ORed together. The following bits can be used:
|
||||
0x04: Terminate read when EOS is detected.
|
||||
0x08: Set EOI (End or identify line) with EOS on write function
|
||||
0x10: Compare all 8 bits of EOS byte rather than low 7 bits
|
||||
(all read and write functions).
|
||||
*/
|
||||
unsigned char m_eosMode;
|
||||
/*! buffer for internal use */
|
||||
char m_buf[32];
|
||||
/*! to avoid memory leak warnings generated by swig */
|
||||
~Gpib_DCS() {};
|
||||
/*!
|
||||
\brief the constructor initiate the device control struct with
|
||||
the common useful values and set the internal timeout for the
|
||||
GPIB controller to 1ms to avoid (or better reduce) blocking
|
||||
*/
|
||||
Gpib_DCS() {
|
||||
/*! set default device address to 1 */
|
||||
m_address1 = 1;
|
||||
m_address2 = 0;
|
||||
/*!
|
||||
set the timeout to a short value to avoid blocking
|
||||
(default are 1msec)
|
||||
*/
|
||||
m_timeout = GpibTimeout1ms;
|
||||
m_eot = true;
|
||||
/*! EOS character, see above! */
|
||||
m_eosChar = 0;//'\n';
|
||||
/*! EOS mode, see above! */
|
||||
m_eosMode = 0;
|
||||
};
|
||||
/*!
|
||||
\brief returns the internal parameters in a more human readable
|
||||
string format like 'Adr: (1,0) to:1ms'.
|
||||
\return the settings as a null terminated string
|
||||
*/
|
||||
char* GetSettings();
|
||||
};
|
||||
|
||||
/*!
|
||||
\enum GpibIoctls
|
||||
|
||||
The following Ioctl calls are only valid for the GpibDevice class.
|
||||
*/
|
||||
enum GpibIoctls {
|
||||
/*!
|
||||
Set the adress of the via gpib connected device.
|
||||
*/
|
||||
CTB_GPIB_SETADR = CTB_GPIB,
|
||||
/*!
|
||||
Get the serial poll byte
|
||||
*/
|
||||
CTB_GPIB_GETRSP,
|
||||
/*!
|
||||
Get the GPIB status
|
||||
*/
|
||||
CTB_GPIB_GETSTA,
|
||||
/*!
|
||||
Get the last GPIB error number
|
||||
*/
|
||||
CTB_GPIB_GETERR,
|
||||
/*!
|
||||
Get the GPIB line status (hardware control lines) as an
|
||||
integer. The lowest 8 bits correspond to the current state
|
||||
of the lines.
|
||||
*/
|
||||
CTB_GPIB_GETLINES,
|
||||
/*!
|
||||
Set the GPIB specific timeout
|
||||
*/
|
||||
CTB_GPIB_SETTIMEOUT,
|
||||
/*!
|
||||
Forces the specified device to go to local program mode
|
||||
*/
|
||||
CTB_GPIB_GTL,
|
||||
/*!
|
||||
This routine can only be used if the specified GPIB
|
||||
Interface Board is the System Controller.
|
||||
Remember that even though the REN line is asserted,
|
||||
the device(s) will not be put into remote state until is
|
||||
addressed to listen by the Active Controller
|
||||
*/
|
||||
CTB_GPIB_REN,
|
||||
/*!
|
||||
The command asserts the GPIB interface clear (IFC) line for
|
||||
ast least 100us if the GPIB board is the system controller.
|
||||
This initializes the GPIB and makes the interface CIC and
|
||||
active controller with ATN asserted.
|
||||
Note! The IFC signal resets only the GPIB interface functions
|
||||
of the bus devices and not the internal device functions.
|
||||
For a device reset you should use the CTB_RESET command above.
|
||||
*/
|
||||
CTB_GPIB_RESET_BUS,
|
||||
/*!
|
||||
Configure the end-of-string (EOS) termination character.
|
||||
Note! Defining an EOS byte does not cause the driver to
|
||||
automatically send that byte at the end of write I/O
|
||||
operations. The application is responsible for placing the
|
||||
EOS byte at the end of the data strings that it defines.
|
||||
(National Instruments NI-488.2M Function Reference Manual)
|
||||
*/
|
||||
CTB_GPIB_SET_EOS_CHAR,
|
||||
/*!
|
||||
Get the internal EOS termination character (see above).
|
||||
*/
|
||||
CTB_GPIB_GET_EOS_CHAR,
|
||||
/*!
|
||||
Set the EOS mode (handling).m_eosMode may be a combination
|
||||
of bits ORed together. The following bits can be used:
|
||||
0x04: Terminate read when EOS is detected.
|
||||
0x08: Set EOI (End or identify line) with EOS on write function
|
||||
0x10: Compare all 8 bits of EOS byte rather than low 7 bits
|
||||
(all read and write functions).
|
||||
*/
|
||||
CTB_GPIB_SET_EOS_MODE,
|
||||
/*!
|
||||
Get the internal EOS mode (see above).
|
||||
*/
|
||||
CTB_GPIB_GET_EOS_MODE,
|
||||
};
|
||||
|
||||
/*!
|
||||
\class GpibDevice
|
||||
GpibDevice is the basic class for communication via the GPIB bus.
|
||||
*/
|
||||
class GpibDevice : public IOBase
|
||||
{
|
||||
protected:
|
||||
/*!
|
||||
\brief
|
||||
the internal board identifier, 0 for the first gpib controller,
|
||||
1 for the second one
|
||||
*/
|
||||
int m_board;
|
||||
/*!
|
||||
\brief
|
||||
the file descriptor of the connected gpib device
|
||||
*/
|
||||
int m_hd;
|
||||
/*!
|
||||
\brief
|
||||
contains the internal conditions of the GPIB communication like
|
||||
GPIB error, timeout and so on...
|
||||
*/
|
||||
int m_state;
|
||||
/*! the internal GPIB error number */
|
||||
int m_error;
|
||||
/*! the count of data read or written */
|
||||
int m_count;
|
||||
/*!
|
||||
\brief contains the internal settings of the GPIB connection like
|
||||
address, timeout, end of string character and so one...
|
||||
*/
|
||||
Gpib_DCS m_dcs;
|
||||
int CloseDevice();
|
||||
/*!
|
||||
\brief returns a short notation or more detail description of
|
||||
the given GPIB error number.
|
||||
\param error the occured GPIB error
|
||||
\param detailed true for a more detailed description, false
|
||||
otherwise
|
||||
\return a null terminated string with the short or detailed
|
||||
error message.
|
||||
*/
|
||||
virtual const char* GetErrorString(int error,bool detailed);
|
||||
/*!
|
||||
Open the interface (internally to request a file descriptor for the
|
||||
given interface). The second parameter is a undefined pointer of a
|
||||
Gpib_DCS data struct.
|
||||
\param devname the name of the GPIB device, GPIB1 means the first
|
||||
GPIB controller, GPIB2 the second (if available).
|
||||
\param dcs untyped pointer of advanced device parameters,
|
||||
\sa struct Gpib_DCS (data struct for the gpib device)
|
||||
\return zero on success, otherwise -1
|
||||
*/
|
||||
int OpenDevice(const char* devname, void* dcs);
|
||||
public:
|
||||
GpibDevice() {
|
||||
m_board = -1;
|
||||
m_hd = -1;
|
||||
m_state = m_count = m_error = 0;
|
||||
};
|
||||
virtual ~GpibDevice() {Close();};
|
||||
/*!
|
||||
\brief returns the name of the class instance. You find this useful,
|
||||
if you handle different devices like a serial port or a gpib device
|
||||
via a IOBase pointer.
|
||||
\return name of the class.
|
||||
*/
|
||||
const char* ClassName() {return "ctb::GpibDevice";};
|
||||
/*!
|
||||
\brief returns a more detail description of the given error
|
||||
number.
|
||||
\param error the occured error number
|
||||
\return null terminated string with the error description
|
||||
*/
|
||||
virtual const char* GetErrorDescription(int error) {
|
||||
return GetErrorString(error,true);
|
||||
};
|
||||
/*!
|
||||
\brief returns a short notation like 'EABO' of the given error
|
||||
number.
|
||||
\param error the occured error number
|
||||
\return null terminated string with the short error notation
|
||||
*/
|
||||
virtual const char* GetErrorNotation(int error) {
|
||||
return GetErrorString(error,false);
|
||||
};
|
||||
/*!
|
||||
\brief request the current settings of the connected gpib device
|
||||
as a null terminated string.
|
||||
\return the settings as a string like 'Adr: (1,0) to:1ms'
|
||||
*/
|
||||
virtual char* GetSettingsAsString() {
|
||||
return m_dcs.GetSettings();
|
||||
};
|
||||
/// This is only for internal usage
|
||||
int Ibrd(char* buf,size_t len);
|
||||
/// This is only for internal usage
|
||||
int Ibwrt(char* buf,size_t len);
|
||||
/*!
|
||||
\brief Many operating characteristics are only possible for
|
||||
special devices. To avoid the need of a lot of different functions
|
||||
and to give the user a uniform interface, all this special
|
||||
operating instructions will covered by one Ioctl methode (like
|
||||
the linux ioctl call).
|
||||
The Ioctl command (cmd) has encoded in it whether the argument
|
||||
is an in parameter or out parameter, and the size of the
|
||||
argument args in bytes. Macros and defines used in specifying an
|
||||
ioctl request are located in iobase.h and the header file for
|
||||
the derivated device (for example in gpib.h).
|
||||
\param cmd one of GpibIoctls specify the ioctl request.
|
||||
\param args is a typeless pointer to a memory location, where
|
||||
Ioctl reads the request arguments or write the results.
|
||||
Please note, that an invalid memory location or size involving
|
||||
a buffer overflow or segmention fault!
|
||||
*/
|
||||
virtual int Ioctl(int cmd,void* args);
|
||||
/*!
|
||||
Returns the current state of the device.
|
||||
\return 1 if device is valid and open, otherwise 0
|
||||
*/
|
||||
int IsOpen() {
|
||||
return m_hd >= 0;
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief Opens a GPIB device in a user likely way. Insteed of
|
||||
using the Device Control Struct just input your parameter in a
|
||||
more intuitive manner.
|
||||
\param devname the name of the GPIB controler like GPIB1 or GPIB2
|
||||
\param address the address of the connected device (1...31)
|
||||
\return the new file descriptor, or -1 if an error occurred
|
||||
*/
|
||||
int Open( const char* devname, int address );
|
||||
|
||||
// Open overrides and hides the IOBase::Open( const char*
|
||||
// devname, void* dcs ) of the base class! So bring it into scope
|
||||
// again!
|
||||
using IOBase::Open;
|
||||
|
||||
int Read(char* buf,size_t len);
|
||||
|
||||
int Write(char* buf,size_t len);
|
||||
|
||||
/*!
|
||||
\brief FindListener returns all listening devices connected to
|
||||
the GPIB bus of the given board.
|
||||
This function is not member of the GPIB class, becauce it
|
||||
should do it's job before you open any GPIB connection.
|
||||
\param board the board nummber. Default is the first board (=0).
|
||||
Valid board numbers are 0 and 1.
|
||||
\return -1 if an error occurred, otherwise a setting bit for
|
||||
each listener address. Bit0 is always 0 (address 0 isn't valid,
|
||||
Bit1 means address 1, Bit2 address 2 and so on...
|
||||
*/
|
||||
static int FindListeners(int board = 0);
|
||||
};
|
||||
|
||||
} // namespace ctb
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,294 @@
|
||||
#ifndef LIBCTB_IOBASE_H_INCLUDED_
|
||||
#define LIBCTB_IOBASE_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: iobase.h
|
||||
// Purpose: io basic class
|
||||
// Author: Joachim Buermann
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ctb-0.16/fifo.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
/**
|
||||
\file iobase.h
|
||||
*/
|
||||
|
||||
namespace ctb {
|
||||
|
||||
enum {
|
||||
|
||||
CTB_COMMON = 0x0000,
|
||||
CTB_SERIAL = 0x0100,
|
||||
CTB_GPIB = 0x0200,
|
||||
CTB_TIMEOUT_INFINITY = 0xFFFFFFFF
|
||||
};
|
||||
|
||||
// const unsigned int wxTIMEOUT_INFINITY = 0xFFFFFFFF;
|
||||
|
||||
/*!
|
||||
\enum IOBaseIoctls
|
||||
|
||||
Defines the ioctl calls for derivated classes. The following Ioctl
|
||||
calls are valid for all from wxIOBase derivated classes.
|
||||
*/
|
||||
enum IOBaseIoctls {
|
||||
/*!
|
||||
Reset the connected device. For a serial (RS232) connection,
|
||||
a break is send. For GPIB the IFC (Interface Clear) line is
|
||||
set.
|
||||
*/
|
||||
CTB_RESET = CTB_COMMON
|
||||
};
|
||||
|
||||
/*!
|
||||
\class IOBase
|
||||
An abstract class for different interfaces. The idea behind this:
|
||||
Similar to the virtual file system this class defines a lot of
|
||||
preset member functions, which the derivate classes must be
|
||||
overload.
|
||||
In the main thing these are: open a interface (such as RS232),
|
||||
reading and writing non blocked through the interface and at
|
||||
last, close it.
|
||||
For special interface settings the method ioctl was defined.
|
||||
(control interface). ioctl covers some interface dependent
|
||||
settings like switch on/off the RS232 status lines and must also
|
||||
be defined from each derivated class.
|
||||
*/
|
||||
|
||||
class IOBase
|
||||
{
|
||||
protected:
|
||||
/*!
|
||||
\brief internal fifo (first in, first out queue) to put back
|
||||
already readed bytes into the reading stream. After put back a single
|
||||
byte or sequence of characters, you can read them again with the
|
||||
next Read call.
|
||||
*/
|
||||
Fifo* m_fifo;
|
||||
enum {
|
||||
/// fifosize of the putback fifo
|
||||
fifoSize = 256
|
||||
};
|
||||
/*!
|
||||
Close the interface (internally the file descriptor, which was
|
||||
connected with the interface).
|
||||
\return zero on success, otherwise -1.
|
||||
*/
|
||||
virtual int CloseDevice() = 0;
|
||||
/*!
|
||||
Open the interface (internally to request a file descriptor for the
|
||||
given interface). The second parameter is a undefined pointer of a
|
||||
device dependent data struct. It must be undefined, because different
|
||||
devices have different settings. A serial device like the com ports
|
||||
points here to a data struct, includes information like baudrate,
|
||||
parity, count of stopbits and wordlen and so on. Another devices
|
||||
(for example a IEEE) needs a adress and EOS (end of string character)
|
||||
and don't use baudrate or parity.
|
||||
\param devname the name of the device, presents the given interface.
|
||||
Under windows for example COM1, under Linux /dev/cua0. Use wxCOMn to
|
||||
avoid plattform depended code (n is the serial port number, beginning
|
||||
with 1).
|
||||
\param dcs untyped pointer of advanced device parameters,
|
||||
\sa struct dcs_devCUA (data struct for the serail com ports)
|
||||
\return zero on success, otherwise -1
|
||||
*/
|
||||
virtual int OpenDevice(const char* devname, void* dcs = 0L) = 0;
|
||||
public:
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
IOBase() {
|
||||
m_fifo = new Fifo(fifoSize);
|
||||
};
|
||||
|
||||
/*!
|
||||
Default destructor
|
||||
*/
|
||||
virtual ~IOBase() {
|
||||
delete m_fifo;
|
||||
};
|
||||
/*!
|
||||
\brief A little helper function to detect the class name
|
||||
\return the name of the class
|
||||
*/
|
||||
virtual const char* ClassName() {return "ctb::IOBase";};
|
||||
/*!
|
||||
Closed the interface. Internally it calls the CloseDevice()
|
||||
method, which must be defined in the derivated class.
|
||||
\return zero on success, or -1 if an error occurred.
|
||||
*/
|
||||
int Close() {return CloseDevice();};
|
||||
|
||||
/*!
|
||||
In this method we can do all things, which are different
|
||||
between the discrete interfaces. The method is similar to the
|
||||
C ioctl function. We take a command number and a integer
|
||||
pointer as command parameter.
|
||||
An example for this is the reset of a connection between a PC
|
||||
and one ore more other instruments. On serial (RS232) connections
|
||||
mostly a break will be send, GPIB on the other hand defines a
|
||||
special line on the GPIB bus, to reset all connected devices.
|
||||
If you only want to reset your connection, you should use the
|
||||
Ioctl methode for doing this, independent of the real type of
|
||||
the connection.
|
||||
\param cmd a command identifier, (under Posix such as TIOCMBIS
|
||||
for RS232 interfaces), IOBaseIoctls
|
||||
\param args typeless parameter pointer for the command above.
|
||||
\return zero on success, or -1 if an error occurred.
|
||||
*/
|
||||
virtual int Ioctl(int cmd,void* args) {return -1;};
|
||||
|
||||
/*!
|
||||
Returns the current state of the device.
|
||||
\return 1 if device is valid and open, otherwise 0
|
||||
*/
|
||||
virtual int IsOpen() = 0;
|
||||
|
||||
/*!
|
||||
\param devname name of the interface, we want to open
|
||||
\param dcs a untyped pointer to a device control struct. If
|
||||
he is NULL, the default device parameter will be used.
|
||||
\return the new file descriptor, or -1 if an error occurred
|
||||
|
||||
The pointer dcs will be used for special device dependent
|
||||
settings. Because this is very specific, the struct or
|
||||
destination of the pointer will be defined by every device
|
||||
itself. (For example: a serial device class should refer
|
||||
things like parity, word length and count of stop bits,
|
||||
a IEEE class adress and EOS character).
|
||||
*/
|
||||
int Open(const char* devname,void* dcs=0L) {
|
||||
return OpenDevice(devname,dcs);
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief In some circumstances you want to put back a already
|
||||
readed byte (for instance, you have overreaded it and like to
|
||||
parse the recieving bytes again).
|
||||
The internal fifo stores fifoSize characters until you
|
||||
have to read again.
|
||||
\param ch the character to put back in the input stream
|
||||
\return 1, if successful, otherwise 0
|
||||
*/
|
||||
int PutBack(char ch) {
|
||||
return m_fifo->put(ch);
|
||||
};
|
||||
|
||||
/*!
|
||||
Read attempt to read len bytes from the interface into the buffer
|
||||
starting with buf. Read never blocks. If there are no bytes for
|
||||
reading, Read returns zero otherwise the count of bytes been readed.
|
||||
\param buf starting adress of the buffer
|
||||
\param len count of bytes, we want to read
|
||||
\return -1 on fails, otherwise the count of readed bytes
|
||||
*/
|
||||
virtual int Read(char* buf,size_t len) = 0;
|
||||
|
||||
/*!
|
||||
\brief
|
||||
ReadUntilEos read bytes from the interface until the EOS string
|
||||
was received or a timeout occurs.
|
||||
ReadUntilEos returns the count of bytes been readed. The received
|
||||
bytes are stored on the heap point by the readbuf pointer and
|
||||
must delete by the caller.
|
||||
\param readbuf points to the start of the readed bytes. You must
|
||||
delete them, also if you received no byte.
|
||||
\param readedBytes A pointer to the variable that receives the number
|
||||
of bytes read.
|
||||
\param eosString is the null terminated end of string sequence.
|
||||
Default is the linefeed character.
|
||||
\param timeout_in_ms the function returns after this time, also
|
||||
if no eos occured (default is 1s).
|
||||
\param quota defines a character between those an EOS doesn't
|
||||
terminate the string
|
||||
\return 1 on sucess (the operation ends successfull without a timeout),
|
||||
0 if a timeout occurred and -1 otherwise
|
||||
*/
|
||||
virtual int ReadUntilEOS(char*& readbuf,
|
||||
size_t* readedBytes,
|
||||
char* eosString = "\n",
|
||||
long timeout_in_ms = 1000L,
|
||||
char quota = 0);
|
||||
|
||||
/*!
|
||||
\brief
|
||||
readv() attempts to read up to len bytes from the interface
|
||||
into the buffer starting at buf.
|
||||
readv() is blocked till len bytes are readed or the given
|
||||
timeout in milliseconds was reached.
|
||||
\param buf starting address of the buffer
|
||||
\param len count bytes, we want to read
|
||||
\param timeout_in_ms in milliseconds. If you don't want any timeout,
|
||||
you give the wxTIMEOUT_INFINITY here.
|
||||
But think of it: In this case, this function never returns
|
||||
if there a not enough bytes to read.
|
||||
\return the number of data bytes successfully read
|
||||
*/
|
||||
int Readv(char* buf,size_t len,unsigned int timeout_in_ms);
|
||||
|
||||
/*!
|
||||
\brief
|
||||
readv() attempts to read up to len bytes from the interface
|
||||
into the buffer starting at buf.
|
||||
readv() is blocked till len bytes are readed or the timeout_flag
|
||||
points on a int greater then zero.
|
||||
\param buf starting adress of the buffer
|
||||
\param len count bytes, we want to read
|
||||
\param timeout_flag a pointer to an integer. If you don't want
|
||||
any timeout, you given a null pointer here.
|
||||
But think of it: In this case, this function comes never
|
||||
back, if there a not enough bytes to read.
|
||||
\param nice if true go to sleep for one ms (reduce CPU last),
|
||||
if there is no byte available (default is false)
|
||||
*/
|
||||
int Readv(char* buf,size_t len,int* timeout_flag,bool nice=false);
|
||||
|
||||
/*!
|
||||
Write writes up to len bytes from the buffer starting with buf
|
||||
into the interface.
|
||||
\param buf start adress of the buffer
|
||||
\param len count of bytes, we want to write
|
||||
\return on success, the number of bytes written are returned
|
||||
(zero indicates nothing was written). On error, -1 is returned.
|
||||
*/
|
||||
virtual int Write(char* buf,size_t len) = 0;
|
||||
|
||||
/*!
|
||||
Writev() writes up to len bytes to the interface from the buffer,
|
||||
starting at buf.
|
||||
Also Writev() blocks till all bytes are written or the given
|
||||
timeout in milliseconds was reached.
|
||||
\param buf starting address of the buffer
|
||||
\param len count bytes, we want to write
|
||||
\param timeout_in_ms timeout in milliseconds. If you give
|
||||
wxTIMEOUT_INFINITY here, the function blocks, till all data was
|
||||
written.
|
||||
\return the number of data bytes successfully written.
|
||||
*/
|
||||
int Writev(char* buf,size_t len,unsigned int timeout_in_ms);
|
||||
|
||||
/*!
|
||||
Writev() writes up to len bytes to the interface from the buffer,
|
||||
starting at buf.
|
||||
Also Writev() blocks till all bytes are written or the timeout_flag
|
||||
points to an integer greater then zero.
|
||||
\param buf starting adress of the buffer
|
||||
\param len count bytes, we want to write
|
||||
\param timeout_flag a pointer to an integer. You also can give a null
|
||||
pointer here. This blocks, til all data is writen.
|
||||
\param nice if true go to sleep for one ms (reduce CPU last),
|
||||
if there is no byte available (default is false)
|
||||
*/
|
||||
int Writev(char* buf,size_t len,int* timeout_flag,bool nice = false);
|
||||
|
||||
};
|
||||
|
||||
} // namespace ctb
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef LIBCTB_KBHIT_H_INCLUDED_
|
||||
#define LIBCTB_KBHIT_H_INCLUDED_
|
||||
|
||||
namespace ctb {
|
||||
|
||||
char GetKey();
|
||||
|
||||
} // namespace ctb
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,94 @@
|
||||
#ifndef LIBCTB_LINUX_SERPORT_H_INCLUDED_
|
||||
#define LIBCTB_LINUX_SERPORT_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: linux/serport.h
|
||||
// Purpose:
|
||||
// Author: Joachim Buermann
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ctb-0.16/serportx.h"
|
||||
#include <linux/serial.h>
|
||||
#include <termios.h>
|
||||
|
||||
namespace ctb {
|
||||
|
||||
/*!
|
||||
\class SerialPort
|
||||
|
||||
\brief the linux version
|
||||
*/
|
||||
class SerialPort : public SerialPort_x
|
||||
{
|
||||
protected:
|
||||
/*!
|
||||
\brief under Linux, the serial ports are normal file descriptor
|
||||
*/
|
||||
int fd;
|
||||
/*!
|
||||
\brief Linux defines this struct termios for controling asynchronous
|
||||
communication. t covered the active settings, save_t the original
|
||||
settings.
|
||||
*/
|
||||
struct termios t, save_t;
|
||||
|
||||
/*!
|
||||
\brief The Linux serial driver summing all breaks, framings, overruns
|
||||
and parity errors for each port during system runtime. Because we only
|
||||
need the errors during a active connection, we must save the actual
|
||||
error numbers in this separate structurs.
|
||||
*/
|
||||
struct serial_icounter_struct save_info, last_info;
|
||||
|
||||
/*!
|
||||
\brief adaptor member function, to convert the plattform independent
|
||||
type wxBaud into a linux conform value.
|
||||
\param baud the baudrate as wxBaud type
|
||||
\return speed_t linux specific data type, defined in termios.h
|
||||
*/
|
||||
speed_t AdaptBaudrate( int baud );
|
||||
|
||||
int CloseDevice();
|
||||
int OpenDevice(const char* devname, void* dcs);
|
||||
|
||||
/*!
|
||||
\brief internal member function to set an unusal (non-standard)
|
||||
baudrate. Called by SetBaudrate.
|
||||
*/
|
||||
int SetBaudrateAny( int baudrate );
|
||||
|
||||
/*!
|
||||
\brief internal member function to set a standard baudrate.
|
||||
Called by SetBaudrate.
|
||||
*/
|
||||
int SetBaudrateStandard( int baudrate );
|
||||
|
||||
public:
|
||||
SerialPort();
|
||||
|
||||
~SerialPort();
|
||||
|
||||
int ChangeLineState( SerialLineState flags );
|
||||
|
||||
int ClrLineState( SerialLineState flags );
|
||||
|
||||
int GetLineState();
|
||||
int Ioctl(int cmd,void* args);
|
||||
int IsOpen();
|
||||
int Read(char* buf,size_t len);
|
||||
int SendBreak(int duration);
|
||||
|
||||
int SetBaudrate( int baudrate );
|
||||
|
||||
int SetParityBit( bool parity );
|
||||
|
||||
int SetLineState( SerialLineState flags );
|
||||
|
||||
int Write(char* buf,size_t len);
|
||||
};
|
||||
|
||||
} // namespace ctb
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,139 @@
|
||||
#ifndef LIBCTB_LINUX_TIMER_H_INCLUDED_
|
||||
#define LIBCTB_LINUX_TIMER_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: linux/timer.h
|
||||
// Purpose:
|
||||
// Author: Joachim Buermann
|
||||
// Id: $Id: timer.h,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $
|
||||
// Copyright: (c) 2001 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
\file timer.h
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
namespace ctb {
|
||||
|
||||
/*!
|
||||
\brief A data struct, using from class timer.
|
||||
*/
|
||||
struct timer_control
|
||||
{
|
||||
/*!
|
||||
under linux, we used usec internally
|
||||
*/
|
||||
unsigned int usecs;
|
||||
/*!
|
||||
covers the adress of the exitflag
|
||||
*/
|
||||
int *exitflag;
|
||||
/*!
|
||||
covers the adress of the exit function. NULL, if
|
||||
there was no exit function.
|
||||
*/
|
||||
void* (*exitfnc)(void*);
|
||||
};
|
||||
|
||||
/*!
|
||||
\class Timer
|
||||
\brief A thread based timer class for handling timeouts in
|
||||
an easier way.
|
||||
|
||||
On starting every timer instance will create it's own thread.
|
||||
The thread makes simply nothing, until it's given time is over.
|
||||
After that, he set a variable, refer by it's adress to one
|
||||
and exit.
|
||||
|
||||
There are a lot of situations, which the timer class must handle.
|
||||
The timer instance leaves his valid range (for example, the
|
||||
timer instance is local inside a function, and the function fished)
|
||||
BEFORE the thread was ending. In this case, the destructor must
|
||||
terminate the thread in a correct way. (This is very different
|
||||
between the OS. threads are a system resource like file descriptors
|
||||
and must be deallocated after using it).
|
||||
|
||||
The thread should be asynchronously stopped. Means, under all
|
||||
circumstance, it must be possible, to finish the timer and start
|
||||
it again.
|
||||
|
||||
Several timer instance can be used simultanously.
|
||||
*/
|
||||
class Timer
|
||||
{
|
||||
protected:
|
||||
/*!
|
||||
control covers the time interval, the adress
|
||||
of the exitflag, and if not null, a function, which will
|
||||
be called on the end.
|
||||
*/
|
||||
timer_control control;
|
||||
/*!
|
||||
stopped will be set by calling the stop() method.
|
||||
Internaly the timer thread steadily tests the state of
|
||||
this variable. If stopped not zero, the thread will be
|
||||
finished.
|
||||
*/
|
||||
int stopped;
|
||||
/*!
|
||||
under linux we use the pthread library. tid covers the
|
||||
identifier for a separate threads.
|
||||
*/
|
||||
pthread_t tid;
|
||||
/*!
|
||||
here we store the time interval, whilst the timer run.
|
||||
This is waste!!!
|
||||
*/
|
||||
unsigned int timer_secs;
|
||||
|
||||
public:
|
||||
/*!
|
||||
The constructor creates an timer object with the given
|
||||
properties. The timer at this moment is not started. This
|
||||
will be done with the start() member function.
|
||||
\param msec time interval after that the the variable
|
||||
pointed by exitflag is setting to one.
|
||||
\param exitflag the adress of an integer, which was set
|
||||
to one after the given time interval.
|
||||
\warning The integer variable shouldn't leave it's valid
|
||||
range, before the timer was finished. So never take a
|
||||
local variable.
|
||||
\param exitfnc A function, which was called after msec.
|
||||
If you don't want this, refer a NULL pointer.
|
||||
*/
|
||||
Timer(unsigned int msec,int* exitflag,void*(*exitfnc)(void*));
|
||||
/*!
|
||||
the destructor. If his was called (for example by leaving the
|
||||
valid range of the timer object), the timer thread automaticaly
|
||||
will finished. The exitflag wouldn't be set, also the exitfnc
|
||||
wouldn't be called.
|
||||
*/
|
||||
~Timer();
|
||||
/*!
|
||||
starts the timer. But now a thread will created and started.
|
||||
After this, the timer thread will be running until he was stopped
|
||||
by calling stop() or reached his given time interval.
|
||||
*/
|
||||
int start();
|
||||
/*!
|
||||
stops the timer and canceled the timer thread. After timer::stop() a new
|
||||
start() will started the timer from beginning.
|
||||
*/
|
||||
int stop();
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief sleepms
|
||||
A plattform independent function, to go to sleep for the given
|
||||
time interval.
|
||||
\param ms time interval in milli seconds
|
||||
*/
|
||||
void sleepms(unsigned int ms);
|
||||
|
||||
} // namespace ctb
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef LIBCTB_PORTSCAN_H_INCLUDED_
|
||||
#define LIBCTB_PORTSCAN_H_INCLUDED_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
/**
|
||||
\file portscan.h
|
||||
*/
|
||||
|
||||
namespace ctb {
|
||||
|
||||
/*!
|
||||
\brief returns all available COM ports as an array of strings.
|
||||
\param result stores the available COM ports
|
||||
\param checkInUse return only ports which are available AND
|
||||
unused (default)
|
||||
\return true if successful, false otherwise
|
||||
*/
|
||||
bool GetAvailablePorts( std::vector<std::string>& result,
|
||||
bool checkInUse = true );
|
||||
|
||||
} // namespace ctb
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef LIBCTB_SERPORT_H_INCLUDED_
|
||||
#define LIBCTB_SERPORT_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: serport.h
|
||||
// Purpose: simple wrapper file
|
||||
// Author: Joachim Buermann
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined (WIN32)
|
||||
# include "ctb-0.16/win32/serport.h"
|
||||
#else
|
||||
# include "ctb-0.16/linux/serport.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __SERPORT_BASE_H
|
||||
|
||||
@@ -0,0 +1,451 @@
|
||||
#ifndef LIBCTB_SERPORTX_H_INCLUDED_
|
||||
#define LIBCTB_SERPORTX_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: serportx.h
|
||||
// Purpose:
|
||||
// Author: Joachim Buermann
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "ctb-0.16/iobase.h"
|
||||
|
||||
#if defined (WIN32)
|
||||
# define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
/**
|
||||
\file serportx.h
|
||||
*/
|
||||
|
||||
/*!
|
||||
\def SERIALPORT_NAME_LEN
|
||||
defines the maximum length of the os depending serial port names
|
||||
*/
|
||||
#define SERIALPORT_NAME_LEN 32
|
||||
|
||||
namespace ctb {
|
||||
|
||||
/*! specifices the first serial port */
|
||||
extern const char* COM1;
|
||||
/*! specifies the second serial port */
|
||||
extern const char* COM2;
|
||||
/*! specifies the third serial port */
|
||||
extern const char* COM3;
|
||||
/*! specifies the fourth serial port */
|
||||
extern const char* COM4;
|
||||
/*! specifies the fifth serial port */
|
||||
extern const char* COM5;
|
||||
/*! specifies the sixth serial port */
|
||||
extern const char* COM6;
|
||||
/*! specifies the seventh serial port */
|
||||
extern const char* COM7;
|
||||
/*! specifies the eighth serial port */
|
||||
extern const char* COM8;
|
||||
/*! specifies the ninth serial port */
|
||||
extern const char* COM9;
|
||||
/*! specifies the tenth serial port */
|
||||
extern const char* COM10;
|
||||
/*! specifies the eleventh serial port */
|
||||
extern const char* COM11;
|
||||
/*! specifies the twelfth serial port */
|
||||
extern const char* COM12;
|
||||
/*! specifies the thriteenth serial port */
|
||||
extern const char* COM13;
|
||||
/*! specifies the fourteenth serial port */
|
||||
extern const char* COM14;
|
||||
/*! specifies the fiveteenth serial port */
|
||||
extern const char* COM15;
|
||||
/*! specifies the sixteenth serial port */
|
||||
extern const char* COM16;
|
||||
/*! specifies the seventeenth serial port */
|
||||
extern const char* COM17;
|
||||
/*! specifies the eighteenth serial port */
|
||||
extern const char* COM18;
|
||||
/*! specifies the nineteenth serial port */
|
||||
extern const char* COM19;
|
||||
/*! specifies the twentieth serial port */
|
||||
extern const char* COM20;
|
||||
|
||||
/*!
|
||||
\enum Parity
|
||||
|
||||
\brief Defines the different modes of parity checking. Under
|
||||
Linux, the struct termios will be set to provide the wanted
|
||||
behaviour.
|
||||
*/
|
||||
enum Parity
|
||||
{
|
||||
/*! no parity check */
|
||||
ParityNone,
|
||||
/*! odd parity check */
|
||||
ParityOdd,
|
||||
/*! even parity check */
|
||||
ParityEven,
|
||||
/*! mark (not implemented yet) */
|
||||
ParityMark,
|
||||
/*! space (not implemented yet) */
|
||||
ParitySpace
|
||||
};
|
||||
|
||||
/*!
|
||||
\enum SerialLineState
|
||||
|
||||
Defines the different modem control lines. The value for
|
||||
each item are defined in /usr/include/bits/ioctl-types.h.
|
||||
This is the linux definition. The window version translate
|
||||
each item in it's own value.
|
||||
modem lines defined in ioctl-types.h
|
||||
\code
|
||||
#define TIOCM_LE 0x001
|
||||
#define TIOCM_DTR 0x002
|
||||
#define TIOCM_RTS 0x004
|
||||
#define TIOCM_ST 0x008
|
||||
#define TIOCM_SR 0x010
|
||||
#define TIOCM_CTS 0x020
|
||||
#define TIOCM_CAR 0x040
|
||||
#define TIOCM_RNG 0x080
|
||||
#define TIOCM_DSR 0x100
|
||||
#define TIOCM_CD TIOCM_CAR
|
||||
#define TIOCM_RI TIOCM_RNG
|
||||
\endcode
|
||||
*/
|
||||
enum SerialLineState
|
||||
{
|
||||
/*! Data Carrier Detect (read only) */
|
||||
LinestateDcd = 0x040,
|
||||
/*! Clear To Send (read only) */
|
||||
LinestateCts = 0x020,
|
||||
/*! Data Set Ready (read only) */
|
||||
LinestateDsr = 0x100,
|
||||
/*! Data Terminal Ready (write only) */
|
||||
LinestateDtr = 0x002,
|
||||
/*! Ring Detect (read only) */
|
||||
LinestateRing = 0x080,
|
||||
/*! Request To Send (write only) */
|
||||
LinestateRts = 0x004,
|
||||
/*! no active line state, use this for clear */
|
||||
LinestateNull = 0x000
|
||||
};
|
||||
|
||||
/*!
|
||||
\struct SerialPort_DCS
|
||||
|
||||
The device control struct for the serial communication class.
|
||||
This struct should be used, if you refer advanced parameter.
|
||||
*/
|
||||
struct SerialPort_DCS
|
||||
{
|
||||
/*! the baudrate */
|
||||
int baud;
|
||||
/*! the parity */
|
||||
Parity parity;
|
||||
/*! the wordlen */
|
||||
unsigned char wordlen;
|
||||
/*! count of stopbits */
|
||||
unsigned char stopbits;
|
||||
/*! rtscts flow control */
|
||||
bool rtscts;
|
||||
/*! XON/XOFF flow control */
|
||||
bool xonxoff;
|
||||
/*! buffer for internal use */
|
||||
char buf[16];
|
||||
SerialPort_DCS() {
|
||||
baud = 38400;
|
||||
parity = ParityNone;
|
||||
wordlen = 8;
|
||||
stopbits = 1;
|
||||
rtscts = false;
|
||||
xonxoff = false;
|
||||
};
|
||||
// to avoid memory leak warnings generated by swig
|
||||
~SerialPort_DCS() {};
|
||||
/*!
|
||||
\brief returns the internal settings of the DCS as a human
|
||||
readable string like '8N1 115200'.
|
||||
\return the internal settings as null terminated string
|
||||
*/
|
||||
char* GetSettings() {
|
||||
const char ac[5] = {'N','O','E','M','S'};
|
||||
memset(buf,0,sizeof(buf));
|
||||
snprintf(buf,sizeof(buf)-1,"%i%c%i %i",
|
||||
wordlen,
|
||||
ac[parity],
|
||||
stopbits,
|
||||
baud);
|
||||
return buf;
|
||||
};
|
||||
};
|
||||
|
||||
/*!
|
||||
\struct SerialPort_EINFO
|
||||
|
||||
The internal communication error struct. It contains the number
|
||||
of each error (break, framing, overrun and parity) since opening
|
||||
the serial port. Each error number will be cleared if the open
|
||||
methode was called.
|
||||
*/
|
||||
struct SerialPort_EINFO
|
||||
{
|
||||
/*! number of breaks */
|
||||
int brk;
|
||||
/*! number of framing errors */
|
||||
int frame;
|
||||
/*! number of overrun errors */
|
||||
int overrun;
|
||||
/*! number of parity errors */
|
||||
int parity;
|
||||
SerialPort_EINFO() {
|
||||
brk = frame = overrun = parity = 0;
|
||||
};
|
||||
~SerialPort_EINFO() {};
|
||||
};
|
||||
|
||||
/*!
|
||||
\enum SerialPortIoctls
|
||||
|
||||
The following Ioctl calls are only valid for the SerialPort
|
||||
class.
|
||||
*/
|
||||
enum SerialPortIoctls {
|
||||
/*!
|
||||
Get all numbers of occured communication errors (breaks
|
||||
framing, overrun and parity), so the args parameter of
|
||||
the Ioctl call must pointed to a SerialPort_EINFO
|
||||
struct.
|
||||
*/
|
||||
CTB_SER_GETEINFO = CTB_SERIAL,
|
||||
/*!
|
||||
Get integer 1, if a break occured since the last call
|
||||
so the args parameter of the Ioctl methode must pointed
|
||||
to an integer value. If there was no break, the result
|
||||
is integer 0.
|
||||
*/
|
||||
CTB_SER_GETBRK,
|
||||
/*!
|
||||
Get integer 1, if a framing occured since the last call
|
||||
so the args parameter of the Ioctl methode must pointed
|
||||
to an integer value. If there was no break, the result
|
||||
is integer 0.
|
||||
*/
|
||||
CTB_SER_GETFRM,
|
||||
/*!
|
||||
Get integer 1, if a overrun occured since the last call
|
||||
so the args parameter of the Ioctl methode must pointed
|
||||
to an integer value. If there was no break, the result
|
||||
is integer 0.
|
||||
*/
|
||||
CTB_SER_GETOVR,
|
||||
/*!
|
||||
Get integer 1, if a parity occured since the last call
|
||||
so the args parameter of the Ioctl methode must pointed
|
||||
to an integer value. If there was no break, the result
|
||||
is integer 0.
|
||||
*/
|
||||
CTB_SER_GETPAR,
|
||||
/*!
|
||||
Get the number of bytes received by the serial port driver
|
||||
but not yet read by a Read or Readv Operation.
|
||||
*/
|
||||
CTB_SER_GETINQUE,
|
||||
/*!
|
||||
Set the parity bit on or off to use it as a ninth bit.
|
||||
*/
|
||||
CTB_SER_SETPAR
|
||||
};
|
||||
|
||||
/*!
|
||||
\class SerialPort_x
|
||||
SerialPort_x is the basic class for serial communication via
|
||||
the serial comports. It is also an abstract class and defines
|
||||
all necessary methods, which the derivated plattform depended
|
||||
classes must be invoke.
|
||||
*/
|
||||
class SerialPort_x : public IOBase
|
||||
{
|
||||
protected:
|
||||
/*!
|
||||
\brief contains the internal settings of the serial port like
|
||||
baudrate, protocol, wordlen and so on.
|
||||
*/
|
||||
SerialPort_DCS m_dcs;
|
||||
/*!
|
||||
\brief contains the internal (os specific) name of the serial
|
||||
device.
|
||||
*/
|
||||
char m_devname[SERIALPORT_NAME_LEN];
|
||||
public:
|
||||
|
||||
/*!
|
||||
\enum FlowControl
|
||||
\brief Specifies the flow control.
|
||||
|
||||
|
||||
*/
|
||||
enum FlowControl
|
||||
{
|
||||
NoFlowControl, /*!< No flow control at all */
|
||||
|
||||
RtsCtsFlowControl, /*!< Enable RTS/CTS hardware flow control */
|
||||
|
||||
XonXoffFlowControl /*!< Enable XON/XOFF protocol */
|
||||
};
|
||||
|
||||
SerialPort_x() {m_devname[0] = '\0';};
|
||||
virtual ~SerialPort_x() {};
|
||||
/*!
|
||||
\brief returns the name of the class instance. You find this useful,
|
||||
if you handle different devices like a serial port or a gpib device
|
||||
via a IOBase pointer.
|
||||
\return name of the class.
|
||||
*/
|
||||
const char* ClassName() {return "ctb::SerialPort";};
|
||||
|
||||
/*!
|
||||
\brief change the linestates according to which bits
|
||||
are set/unset in flags.
|
||||
\param flags valid line flags are SERIAL_LINESTATE_DSR and/or
|
||||
SERIAL_LINESTATE_RTS
|
||||
\return zero on success, -1 if an error occurs
|
||||
*/
|
||||
virtual int ChangeLineState( SerialLineState flags ) = 0;
|
||||
|
||||
/*!
|
||||
\brief turn off status lines depending upon which bits (DSR and/or RTS)
|
||||
are set in flags.
|
||||
\param flags valid line flags are SERIAL_LINESTATE_DSR and/or
|
||||
SERIAL_LINESTATE_RTS
|
||||
\return zero on success, -1 if an error occurs
|
||||
*/
|
||||
virtual int ClrLineState( SerialLineState flags ) = 0;
|
||||
|
||||
/*!
|
||||
\brief Read the line states of DCD, CTS, DSR and RING
|
||||
\return returns the appropriate bits on sucess, otherwise -1
|
||||
*/
|
||||
virtual int GetLineState() = 0;
|
||||
|
||||
/*!
|
||||
\brief request the current settings of the connected serial port
|
||||
as a null terminated string.
|
||||
\return the settings as a string like '8N1 115200'
|
||||
*/
|
||||
virtual char* GetSettingsAsString() {
|
||||
return m_dcs.GetSettings();
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief Many operating characteristics are only possible for
|
||||
special devices. To avoid the need of a lot of different functions
|
||||
and to give the user a uniform interface, all this special
|
||||
operating instructions will covered by one Ioctl methode (like
|
||||
the linux ioctl call).
|
||||
The Ioctl command (cmd) has encoded in it whether the argument
|
||||
is an in parameter or out parameter, and the size of the
|
||||
argument args in bytes. Macros and defines used in specifying an
|
||||
ioctl request are located in iobase.h and the header file for
|
||||
the derivated device (for example in serportx.h).
|
||||
\param cmd one of SerialPortIoctls specify the ioctl request.
|
||||
\param args is a typeless pointer to a memory location, where
|
||||
Ioctl reads the request arguments or write the results.
|
||||
Please note, that an invalid memory location or size involving
|
||||
a buffer overflow or segmention fault!
|
||||
*/
|
||||
virtual int Ioctl(int cmd,void* args) {return -1;};
|
||||
|
||||
/*!
|
||||
\brief Opens a serial port in a user likely way. Insteed of
|
||||
using the Device Control Struct just input your parameter in a
|
||||
more intuitive manner.
|
||||
\param portname the name of the serial port
|
||||
\param baudrate any baudrate, also an unusual one, if your
|
||||
serial device support them
|
||||
\param protocol a string with the number of databits (5...8),
|
||||
the parity setting (N=None,O=Odd,E=Even,M=Mark,S=Space), also
|
||||
in lower case, and the count of stopbits (1...2)
|
||||
\param flowControl one of NoFlowControl, RtsCtsFlowControl or
|
||||
XonXoffFlowControl.
|
||||
\return the new file descriptor, or -1 if an error occurred
|
||||
*/
|
||||
int Open( const char* portname, int baudrate,
|
||||
const char* protocol = "8N1",
|
||||
FlowControl flowControl = NoFlowControl );
|
||||
|
||||
/*!
|
||||
\brief Opens the serial port with the given number.
|
||||
\note The port numbering starts with 1 (COM1 for windows and
|
||||
/dev/ttyS0 for Linux. Please note, that USB to RS232 converter
|
||||
in Linux are named as /dev/ttyUSBx and from there have to
|
||||
opened with their device name!
|
||||
\param number of the serial port count from 1
|
||||
\param baudrate any baudrate, also an unusual one, if your
|
||||
serial device support them
|
||||
\param protocol a string with the number of databits (5...8),
|
||||
the parity setting (N=None,O=Odd,E=Even,M=Mark,S=Space), also
|
||||
in lower case, and the count of stopbits (1...2)
|
||||
\param flowControl one of NoFlowControl, RtsCtsFlowControl or
|
||||
XonXoffFlowControl.
|
||||
\return the new file descriptor, or -1 if an error occurred
|
||||
*/
|
||||
int Open( const int portnumber, int baudrate,
|
||||
const char* protocol = "8N1",
|
||||
FlowControl flowControl = NoFlowControl );
|
||||
|
||||
// Open overrides and hides the IOBase::Open( const char*
|
||||
// devname, void* dcs ) of the base class! So bring it into scope
|
||||
// again!
|
||||
using IOBase::Open;
|
||||
|
||||
/*!
|
||||
\brief Sendbreak transmits a continuous stream of zero-valued
|
||||
bits for a specific duration.
|
||||
\param duration If duration is zero, it transmits
|
||||
zero-valued bits for at least 0.25 seconds, and not more that
|
||||
0.5 seconds. If duration is not zero, it sends zero-valued bits
|
||||
for duration*N seconds, where N is at least 0.25, and not more
|
||||
than 0.5.
|
||||
\return zero on success, -1 if an error occurs.
|
||||
*/
|
||||
virtual int SendBreak(int duration) = 0;
|
||||
|
||||
/*!
|
||||
\brief Set the baudrate (also non-standard)
|
||||
Please note: Non-standard baudrates like 70000 are not supported
|
||||
by each UART and depends on the RS232 chipset you apply.
|
||||
\param baudrate the new baudrate
|
||||
\return zero on success, -1 if an error occurs
|
||||
*/
|
||||
virtual int SetBaudrate( int baudrate ) = 0;
|
||||
|
||||
/*!
|
||||
\brief turn on status lines depending upon which bits (DSR and/or RTS)
|
||||
are set in flags.
|
||||
\param flags valid line flags are SERIAL_LINESTATE_DSR and/or
|
||||
SERIAL_LINESTATE_RTS
|
||||
\return zero on success, -1 if an error occurs
|
||||
*/
|
||||
virtual int SetLineState( SerialLineState flags ) = 0;
|
||||
|
||||
/*!
|
||||
\brief Set the parity bit to a firm state, for instance to use
|
||||
the parity bit as the ninth bit in a 9 bit dataword
|
||||
communication.
|
||||
\return zero on succes, a negative value if an error occurs
|
||||
*/
|
||||
virtual int SetParityBit( bool parity ) = 0;
|
||||
|
||||
/*!
|
||||
\brief check the given baudrate against a list of standard rates.
|
||||
\ return true, if the baudrate is a standard value, false
|
||||
otherwise
|
||||
*/
|
||||
static bool IsStandardRate( int rate );
|
||||
|
||||
};
|
||||
|
||||
} // namespace ctb
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef LIBCTB_TIMER_H_INCLUDED_
|
||||
#define LIBCTB_TIMER_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: timer.h
|
||||
// Purpose: simple wrapper file
|
||||
// Author: Joachim Buermann
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined (WIN32)
|
||||
# include "win32/timer.h"
|
||||
#else
|
||||
# include "linux/timer.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef LIBCTB_WIN32_GETOPT_H_INCLUDED_
|
||||
#define LIBCTB_WIN32_GETOPT_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: win32/getopt.h
|
||||
// Purpose:
|
||||
// Author: Joachim Buermann
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern char* optarg;
|
||||
extern int optind;
|
||||
|
||||
int getopt(int argc, char* argv[], char* optstring);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,414 @@
|
||||
/*
|
||||
*
|
||||
*
|
||||
* Win32 include file
|
||||
* for accessing the 32-bit GPIB DLL (gpib-32.dll)
|
||||
*
|
||||
*
|
||||
* Contains user variables (ibsta, iberr, ibcnt, ibcntl),
|
||||
* function prototypes and useful defined constants for
|
||||
* calling NI-488 and NI-488.2 routines from a Microsoft
|
||||
* C/C++ Win32 application.
|
||||
*
|
||||
*
|
||||
* Copyright 1998 National Instruments Corporation
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DECL_32_H // ensure we are only included once
|
||||
#define DECL_32_H
|
||||
|
||||
#include "windows.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* HANDY CONSTANTS FOR USE BY APPLICATION PROGRAMS ... */
|
||||
/***************************************************************************/
|
||||
#define UNL 0x3f /* GPIB unlisten command */
|
||||
#define UNT 0x5f /* GPIB untalk command */
|
||||
#define GTL 0x01 /* GPIB go to local */
|
||||
#define SDC 0x04 /* GPIB selected device clear */
|
||||
#define PPC 0x05 /* GPIB parallel poll configure */
|
||||
#define GET 0x08 /* GPIB group execute trigger */
|
||||
#define TCT 0x09 /* GPIB take control */
|
||||
#define LLO 0x11 /* GPIB local lock out */
|
||||
#define DCL 0x14 /* GPIB device clear */
|
||||
#define PPU 0.16 /* GPIB parallel poll unconfigure */
|
||||
#define SPE 0x18 /* GPIB serial poll enable */
|
||||
#define SPD 0x19 /* GPIB serial poll disable */
|
||||
#define PPE 0x60 /* GPIB parallel poll enable */
|
||||
#define PPD 0x70 /* GPIB parallel poll disable */
|
||||
|
||||
/* GPIB status bit vector : */
|
||||
/* global variable ibsta and wait mask */
|
||||
|
||||
#define ERR (1<<15) /* Error detected */
|
||||
#define TIMO (1<<14) /* Timeout */
|
||||
#define END (1<<13) /* EOI or EOS detected */
|
||||
#define SRQI (1<<12) /* SRQ detected by CIC */
|
||||
#define RQS (1<<11) /* Device needs service */
|
||||
#define CMPL (1<<8) /* I/O completed */
|
||||
#define LOK (1<<7) /* Local lockout state */
|
||||
#define REM (1<<6) /* Remote state */
|
||||
#define CIC (1<<5) /* Controller-in-Charge */
|
||||
#define ATN (1<<4) /* Attention asserted */
|
||||
#define TACS (1<<3) /* Talker active */
|
||||
#define LACS (1<<2) /* Listener active */
|
||||
#define DTAS (1<<1) /* Device trigger state */
|
||||
#define DCAS (1<<0) /* Device clear state */
|
||||
|
||||
/* Error messages returned in global variable iberr */
|
||||
|
||||
#define EDVR 0 /* System error */
|
||||
#define ECIC 1 /* Function requires GPIB board to be CIC */
|
||||
#define ENOL 2 /* Write function detected no Listeners */
|
||||
#define EADR 3 /* Interface board not addressed correctly*/
|
||||
#define EARG 4 /* Invalid argument to function call */
|
||||
#define ESAC 5 /* Function requires GPIB board to be SAC */
|
||||
#define EABO 6 /* I/O operation aborted */
|
||||
#define ENEB 7 /* Non-existent interface board */
|
||||
#define EDMA 8 /* Error performing DMA */
|
||||
#define EOIP 10 /* I/O operation started before previous */
|
||||
/* operation completed */
|
||||
#define ECAP 11 /* No capability for intended operation */
|
||||
#define EFSO 12 /* File system operation error */
|
||||
#define EBUS 14 /* Command error during device call */
|
||||
#define ESTB 15 /* Serial poll status byte lost */
|
||||
#define ESRQ 16 /* SRQ remains asserted */
|
||||
#define ETAB 20 /* The return buffer is full. */
|
||||
#define ELCK 21 /* Address or board is locked. */
|
||||
|
||||
/* EOS mode bits */
|
||||
|
||||
#define BIN (1<<12) /* Eight bit compare */
|
||||
#define XEOS (1<<11) /* Send END with EOS byte */
|
||||
#define REOS (1<<10) /* Terminate read on EOS */
|
||||
|
||||
/* Timeout values and meanings */
|
||||
|
||||
#define TNONE 0 /* Infinite timeout (disabled) */
|
||||
#define T10us 1 /* Timeout of 10 us (ideal) */
|
||||
#define T30us 2 /* Timeout of 30 us (ideal) */
|
||||
#define T100us 3 /* Timeout of 100 us (ideal) */
|
||||
#define T300us 4 /* Timeout of 300 us (ideal) */
|
||||
#define T1ms 5 /* Timeout of 1 ms (ideal) */
|
||||
#define T3ms 6 /* Timeout of 3 ms (ideal) */
|
||||
#define T10ms 7 /* Timeout of 10 ms (ideal) */
|
||||
#define T30ms 8 /* Timeout of 30 ms (ideal) */
|
||||
#define T100ms 9 /* Timeout of 100 ms (ideal) */
|
||||
#define T300ms 10 /* Timeout of 300 ms (ideal) */
|
||||
#define T1s 11 /* Timeout of 1 s (ideal) */
|
||||
#define T3s 12 /* Timeout of 3 s (ideal) */
|
||||
#define T10s 13 /* Timeout of 10 s (ideal) */
|
||||
#define T30s 14 /* Timeout of 30 s (ideal) */
|
||||
#define T100s 15 /* Timeout of 100 s (ideal) */
|
||||
#define T300s 16 /* Timeout of 300 s (ideal) */
|
||||
#define T1000s 17 /* Timeout of 1000 s (ideal) */
|
||||
|
||||
|
||||
/* IBLN Constants */
|
||||
#define NO_SAD 0
|
||||
#define ALL_SAD -1
|
||||
|
||||
|
||||
/* The following constants are used for the second parameter of the
|
||||
* ibconfig function. They are the "option" selection codes.
|
||||
*/
|
||||
#define IbcPAD 0x0001 /* Primary Address */
|
||||
#define IbcSAD 0x0002 /* Secondary Address */
|
||||
#define IbcTMO 0x0003 /* Timeout Value */
|
||||
#define IbcEOT 0x0004 /* Send EOI with last data byte? */
|
||||
#define IbcPPC 0x0005 /* Parallel Poll Configure */
|
||||
#define IbcREADDR 0x0006 /* Repeat Addressing */
|
||||
#define IbcAUTOPOLL 0x0007 /* Disable Auto Serial Polling */
|
||||
#define IbcCICPROT 0x0008 /* Use the CIC Protocol? */
|
||||
#define IbcIRQ 0x0009 /* Use PIO for I/O */
|
||||
#define IbcSC 0x000A /* Board is System Controller? */
|
||||
#define IbcSRE 0x000B /* Assert SRE on device calls? */
|
||||
#define IbcEOSrd 0x000C /* Terminate reads on EOS */
|
||||
#define IbcEOSwrt 0x000D /* Send EOI with EOS character */
|
||||
#define IbcEOScmp 0x000E /* Use 7 or 8-bit EOS compare */
|
||||
#define IbcEOSchar 0x000F /* The EOS character. */
|
||||
#define IbcPP2 0x0010 /* Use Parallel Poll Mode 2. */
|
||||
#define IbcTIMING 0x0011 /* NORMAL, HIGH, or VERY_HIGH timing. */
|
||||
#define IbcDMA 0x0012 /* Use DMA for I/O */
|
||||
#define IbcReadAdjust 0x0013 /* Swap bytes during an ibrd. */
|
||||
#define IbcWriteAdjust 0x014 /* Swap bytes during an ibwrt. */
|
||||
#define IbcSendLLO 0x0017 /* Enable/disable the sending of LLO. */
|
||||
#define IbcSPollTime 0x0018 /* Set the timeout value for serial polls. */
|
||||
#define IbcPPollTime 0x0019 /* Set the parallel poll length period. */
|
||||
#define IbcEndBitIsNormal 0x001A /* Remove EOS from END bit of IBSTA. */
|
||||
#define IbcUnAddr 0x001B /* Enable/disable device unaddressing. */
|
||||
#define IbcSignalNumber 0x001C /* Set UNIX signal number - unsupported */
|
||||
#define IbcBlockIfLocked 0x001D /* Enable/disable blocking for locked boards/devices */
|
||||
#define IbcHSCableLength 0x001F /* Length of cable specified for high speed timing.*/
|
||||
#define IbcIst 0x0020 /* Set the IST bit. */
|
||||
#define IbcRsv 0x0021 /* Set the RSV byte. */
|
||||
|
||||
/*
|
||||
* Constants that can be used (in addition to the ibconfig constants)
|
||||
* when calling the ibask() function.
|
||||
*/
|
||||
|
||||
#define IbaPAD IbcPAD
|
||||
#define IbaSAD IbcSAD
|
||||
#define IbaTMO IbcTMO
|
||||
#define IbaEOT IbcEOT
|
||||
#define IbaPPC IbcPPC
|
||||
#define IbaREADDR IbcREADDR
|
||||
#define IbaAUTOPOLL IbcAUTOPOLL
|
||||
#define IbaCICPROT IbcCICPROT
|
||||
#define IbaIRQ IbcIRQ
|
||||
#define IbaSC IbcSC
|
||||
#define IbaSRE IbcSRE
|
||||
#define IbaEOSrd IbcEOSrd
|
||||
#define IbaEOSwrt IbcEOSwrt
|
||||
#define IbaEOScmp IbcEOScmp
|
||||
#define IbaEOSchar IbcEOSchar
|
||||
#define IbaPP2 IbcPP2
|
||||
#define IbaTIMING IbcTIMING
|
||||
#define IbaDMA IbcDMA
|
||||
#define IbaReadAdjust IbcReadAdjust
|
||||
#define IbaWriteAdjust IbcWriteAdjust
|
||||
#define IbaSendLLO IbcSendLLO
|
||||
#define IbaSPollTime IbcSPollTime
|
||||
#define IbaPPollTime IbcPPollTime
|
||||
#define IbaEndBitIsNormal IbcEndBitIsNormal
|
||||
#define IbaUnAddr IbcUnAddr
|
||||
#define IbaSignalNumber IbcSignalNumber
|
||||
#define IbaBlockIfLocked IbcBlockIfLocked
|
||||
#define IbaHSCableLength IbcHSCableLength
|
||||
#define IbaIst IbcIst
|
||||
#define IbaRsv IbcRsv
|
||||
|
||||
#define IbaBNA 0x0200 /* A device's access board. */
|
||||
|
||||
|
||||
/* Values used by the Send 488.2 command. */
|
||||
#define NULLend 0x00 /* Do nothing at the end of a transfer.*/
|
||||
#define NLend 0x01 /* Send NL with EOI after a transfer. */
|
||||
#define DABend 0x02 /* Send EOI with the last DAB. */
|
||||
|
||||
/* Value used by the 488.2 Receive command.
|
||||
*/
|
||||
#define STOPend 0x0100
|
||||
|
||||
|
||||
/* Address type (for 488.2 calls) */
|
||||
|
||||
typedef short Addr4882_t; /* System dependent: must be 16 bits */
|
||||
|
||||
/*
|
||||
* This macro can be used to easily create an entry in address list
|
||||
* that is required by many of the 488.2 functions. The primary address goes in the
|
||||
* lower 8-bits and the secondary address goes in the upper 8-bits.
|
||||
*/
|
||||
#define MakeAddr(pad, sad) ((Addr4882_t)(((pad)&0xFF) | ((sad)<<8)))
|
||||
|
||||
/*
|
||||
* This value is used to terminate an address list. It should be
|
||||
* assigned to the last entry.
|
||||
*/
|
||||
#ifndef NOADDR
|
||||
#define NOADDR (Addr4882_t)((unsigned short)0xFFFF)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following two macros are used to "break apart" an address list
|
||||
* entry. They take an unsigned integer and return either the primary
|
||||
* or secondary address stored in the integer.
|
||||
*/
|
||||
#define GetPAD(val) ((val) & 0xFF)
|
||||
#define GetSAD(val) (((val) >> 8) & 0xFF)
|
||||
|
||||
/* iblines constants */
|
||||
|
||||
#define ValidEOI (short)0x0080
|
||||
#define ValidATN (short)0x0040
|
||||
#define ValidSRQ (short)0x0020
|
||||
#define ValidREN (short)0x0010
|
||||
#define ValidIFC (short)0x0008
|
||||
#define ValidNRFD (short)0x0004
|
||||
#define ValidNDAC (short)0x0002
|
||||
#define ValidDAV (short)0x0001
|
||||
#define BusEOI (short)0x8000
|
||||
#define BusATN (short)0x4000
|
||||
#define BusSRQ (short)0x2000
|
||||
#define BusREN (short)0x1000
|
||||
#define BusIFC (short)0x0800
|
||||
#define BusNRFD (short)0x0400
|
||||
#define BusNDAC (short)0x0200
|
||||
#define BusDAV (short)0x0100
|
||||
|
||||
/****
|
||||
**** typedef for ibnotify callback ****
|
||||
****/
|
||||
typedef int (__stdcall * GpibNotifyCallback_t)(int, int, int, long, PVOID);
|
||||
|
||||
#define IBNOTIFY_REARM_FAILED 0xE00A003F
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* iblockx and ibunlockx definitions --- for use with GPIB-ENET only !! */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
#define TIMMEDIATE -1
|
||||
#define TINFINITE -2
|
||||
#define MAX_LOCKSHARENAME_LENGTH 64
|
||||
|
||||
#if defined(UNICODE)
|
||||
#define iblockx iblockxW
|
||||
#else
|
||||
#define iblockx iblockxA
|
||||
#endif
|
||||
|
||||
extern int __stdcall iblockxA (int ud, int LockWaitTime, PCHAR LockShareName);
|
||||
extern int __stdcall iblockxW (int ud, int LockWaitTime, PWCHAR LockShareName);
|
||||
extern int __stdcall ibunlockx (int ud);
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* IBSTA, IBERR, IBCNT, IBCNTL and FUNCTION PROTOTYPES */
|
||||
/* ( only included if not accessing the 32-bit DLL directly ) */
|
||||
/***************************************************************************/
|
||||
#if !defined(GPIB_DIRECT_ACCESS)
|
||||
|
||||
/*
|
||||
* Set up access to the user variables (ibsta, iberr, ibcnt, ibcntl).
|
||||
* These are declared and exported by the 32-bit DLL. Separate copies
|
||||
* exist for each process that accesses the DLL. They are shared by
|
||||
* multiple threads of a single process.
|
||||
*/
|
||||
|
||||
extern int ibsta;
|
||||
extern int iberr;
|
||||
extern int ibcnt;
|
||||
extern long ibcntl;
|
||||
|
||||
|
||||
#if defined(UNICODE)
|
||||
#define ibbna ibbnaW
|
||||
#define ibfind ibfindW
|
||||
#define ibrdf ibrdfW
|
||||
#define ibwrtf ibwrtfW
|
||||
#else
|
||||
#define ibbna ibbnaA
|
||||
#define ibfind ibfindA
|
||||
#define ibrdf ibrdfA
|
||||
#define ibwrtf ibwrtfA
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Extern 32-bit GPIB DLL functions
|
||||
*/
|
||||
|
||||
/* NI-488 Function Prototypes */
|
||||
extern int __stdcall ibfindA (LPCSTR udname);
|
||||
extern int __stdcall ibbnaA (int ud, LPCSTR udname);
|
||||
extern int __stdcall ibrdfA (int ud, LPCSTR filename);
|
||||
extern int __stdcall ibwrtfA (int ud, LPCSTR filename);
|
||||
|
||||
extern int __stdcall ibfindW (LPCWSTR udname);
|
||||
extern int __stdcall ibbnaW (int ud, LPCWSTR udname);
|
||||
extern int __stdcall ibrdfW (int ud, LPCWSTR filename);
|
||||
extern int __stdcall ibwrtfW (int ud, LPCWSTR filename);
|
||||
|
||||
extern int __stdcall ibask (int ud, int option, PINT v);
|
||||
extern int __stdcall ibcac (int ud, int v);
|
||||
extern int __stdcall ibclr (int ud);
|
||||
extern int __stdcall ibcmd (int ud, PVOID buf, long cnt);
|
||||
extern int __stdcall ibcmda (int ud, PVOID buf, long cnt);
|
||||
extern int __stdcall ibconfig (int ud, int option, int v);
|
||||
extern int __stdcall ibdev (int boardID, int pad, int sad, int tmo, int eot, int eos);
|
||||
extern int __stdcall ibdiag (int ud, PVOID buf, long cnt);
|
||||
extern int __stdcall ibdma (int ud, int v);
|
||||
extern int __stdcall ibeos (int ud, int v);
|
||||
extern int __stdcall ibeot (int ud, int v);
|
||||
extern int __stdcall ibgts (int ud, int v);
|
||||
extern int __stdcall ibist (int ud, int v);
|
||||
extern int __stdcall iblines (int ud, PSHORT result);
|
||||
extern int __stdcall ibln (int ud, int pad, int sad, PSHORT listen);
|
||||
extern int __stdcall ibloc (int ud);
|
||||
extern int __stdcall ibnotify (int ud, int mask, GpibNotifyCallback_t Callback, PVOID RefData);
|
||||
extern int __stdcall ibonl (int ud, int v);
|
||||
extern int __stdcall ibpad (int ud, int v);
|
||||
extern int __stdcall ibpct (int ud);
|
||||
extern int __stdcall ibpoke (int ud, long option, long v);
|
||||
extern int __stdcall ibppc (int ud, int v);
|
||||
extern int __stdcall ibrd (int ud, PVOID buf, long cnt);
|
||||
extern int __stdcall ibrda (int ud, PVOID buf, long cnt);
|
||||
extern int __stdcall ibrpp (int ud, PCHAR ppr);
|
||||
extern int __stdcall ibrsc (int ud, int v);
|
||||
extern int __stdcall ibrsp (int ud, PCHAR spr);
|
||||
extern int __stdcall ibrsv (int ud, int v);
|
||||
extern int __stdcall ibsad (int ud, int v);
|
||||
extern int __stdcall ibsic (int ud);
|
||||
extern int __stdcall ibsre (int ud, int v);
|
||||
extern int __stdcall ibstop (int ud);
|
||||
extern int __stdcall ibtmo (int ud, int v);
|
||||
extern int __stdcall ibtrg (int ud);
|
||||
extern int __stdcall ibwait (int ud, int mask);
|
||||
extern int __stdcall ibwrt (int ud, PVOID buf, long cnt);
|
||||
extern int __stdcall ibwrta (int ud, PVOID buf, long cnt);
|
||||
|
||||
// GPIB-ENET only functions to support locking across machines
|
||||
extern int __stdcall iblock (int ud);
|
||||
extern int __stdcall ibunlock (int ud);
|
||||
|
||||
/**************************************************************************/
|
||||
/* Functions to access Thread-Specific copies of the GPIB global vars */
|
||||
|
||||
extern int __stdcall ThreadIbsta (void);
|
||||
extern int __stdcall ThreadIberr (void);
|
||||
extern int __stdcall ThreadIbcnt (void);
|
||||
extern long __stdcall ThreadIbcntl (void);
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/* NI-488.2 Function Prototypes */
|
||||
|
||||
extern void __stdcall AllSpoll (int boardID, Addr4882_t * addrlist, PSHORT results);
|
||||
extern void __stdcall DevClear (int boardID, Addr4882_t addr);
|
||||
extern void __stdcall DevClearList (int boardID, Addr4882_t * addrlist);
|
||||
extern void __stdcall EnableLocal (int boardID, Addr4882_t * addrlist);
|
||||
extern void __stdcall EnableRemote (int boardID, Addr4882_t * addrlist);
|
||||
extern void __stdcall FindLstn (int boardID, Addr4882_t * addrlist, Addr4882_t * results, int limit);
|
||||
extern void __stdcall FindRQS (int boardID, Addr4882_t * addrlist, PSHORT dev_stat);
|
||||
extern void __stdcall PPoll (int boardID, PSHORT result);
|
||||
extern void __stdcall PPollConfig (int boardID, Addr4882_t addr, int dataLine, int lineSense);
|
||||
extern void __stdcall PPollUnconfig (int boardID, Addr4882_t * addrlist);
|
||||
extern void __stdcall PassControl (int boardID, Addr4882_t addr);
|
||||
extern void __stdcall RcvRespMsg (int boardID, PVOID buffer, long cnt, int Termination);
|
||||
extern void __stdcall ReadStatusByte(int boardID, Addr4882_t addr, PSHORT result);
|
||||
extern void __stdcall Receive (int boardID, Addr4882_t addr, PVOID buffer, long cnt, int Termination);
|
||||
extern void __stdcall ReceiveSetup (int boardID, Addr4882_t addr);
|
||||
extern void __stdcall ResetSys (int boardID, Addr4882_t * addrlist);
|
||||
extern void __stdcall Send (int boardID, Addr4882_t addr, PVOID databuf, long datacnt, int eotMode);
|
||||
extern void __stdcall SendCmds (int boardID, PVOID buffer, long cnt);
|
||||
extern void __stdcall SendDataBytes (int boardID, PVOID buffer, long cnt, int eot_mode);
|
||||
extern void __stdcall SendIFC (int boardID);
|
||||
extern void __stdcall SendLLO (int boardID);
|
||||
extern void __stdcall SendList (int boardID, Addr4882_t * addrlist, PVOID databuf, long datacnt, int eotMode);
|
||||
extern void __stdcall SendSetup (int boardID, Addr4882_t * addrlist);
|
||||
extern void __stdcall SetRWLS (int boardID, Addr4882_t * addrlist);
|
||||
extern void __stdcall TestSRQ (int boardID, PSHORT result);
|
||||
extern void __stdcall TestSys (int boardID, Addr4882_t * addrlist, PSHORT results);
|
||||
extern void __stdcall Trigger (int boardID, Addr4882_t addr);
|
||||
extern void __stdcall TriggerList (int boardID, Addr4882_t * addrlist);
|
||||
extern void __stdcall WaitSRQ (int boardID, PSHORT result);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // DECL_32_H
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
#ifndef LIBCTB_WIN32_TIMER_H_INCLUDED_
|
||||
#define LIBCTB_WIN32_TIMER_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: win32/serport.h
|
||||
// Purpose:
|
||||
// Author: Joachim Buermann
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../serportx.h"
|
||||
#include <windows.h>
|
||||
|
||||
namespace ctb {
|
||||
|
||||
/*!
|
||||
\class SerialPort
|
||||
|
||||
\brief the win32 version
|
||||
*/
|
||||
class SerialPort : public SerialPort_x
|
||||
{
|
||||
protected:
|
||||
/*!
|
||||
\brief the win32 api equivalent for the Linux
|
||||
file descriptor
|
||||
*/
|
||||
HANDLE fd;
|
||||
/*!
|
||||
\brief a very special struct in the win32 api for controling
|
||||
an asynchronous serial communication through the com ports.
|
||||
*/
|
||||
OVERLAPPED m_ov;
|
||||
|
||||
/*!
|
||||
\brief The win32 API only allows to test for an existing
|
||||
break, framing, overrun or parity, not for the occured numbers.
|
||||
So every error event decrement this internal error struct and
|
||||
can request by an Ioctl call.
|
||||
*/
|
||||
SerialPort_EINFO einfo;
|
||||
|
||||
/*!
|
||||
\brief The win32 API doesn't have any function to detect the
|
||||
current state of the output lines RST and DTR (if someone knows
|
||||
some function, please contact me).
|
||||
So we save the state always after changing one or both lines
|
||||
(for example, on Open, SetLineState and ChangeLineState)
|
||||
*/
|
||||
int m_rtsdtr_state;
|
||||
|
||||
int CloseDevice();
|
||||
int OpenDevice(const char* devname, void* dcs);
|
||||
public:
|
||||
SerialPort();
|
||||
~SerialPort();
|
||||
|
||||
int ChangeLineState( SerialLineState flags );
|
||||
int ClrLineState( SerialLineState flags );
|
||||
int GetLineState();
|
||||
int Ioctl(int cmd,void* args);
|
||||
int IsOpen();
|
||||
int Read(char* buf,size_t len);
|
||||
int SendBreak(int duration);
|
||||
int SetBaudrate( int baudrate );
|
||||
int SetLineState( SerialLineState flags );
|
||||
int SetParityBit( bool parity );
|
||||
int Write(char* buf,size_t len);
|
||||
};
|
||||
|
||||
} // namespace ctb
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,140 @@
|
||||
#ifndef LIBCTB_WINDOWS_TIMER_H_INCLUDED_
|
||||
#define LIBCTB_WINDOWS_TIMER_H_INCLUDED_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: win32/timer.h
|
||||
// Purpose:
|
||||
// Author: Joachim Buermann
|
||||
// Copyright: (c) 2010 Joachim Buermann
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
namespace ctb {
|
||||
|
||||
/*!
|
||||
\brief A data struct, using from class timer.
|
||||
*/
|
||||
struct timer_control
|
||||
{
|
||||
/*!
|
||||
under win32, we used msec internally
|
||||
*/
|
||||
unsigned int msecs;
|
||||
/*!
|
||||
covers the adress of the exitflag
|
||||
*/
|
||||
int *exitflag;
|
||||
/*!
|
||||
the running thread steadily polls this variable (only under win32).
|
||||
If it's not zero, the thread terminate.
|
||||
*/
|
||||
MMRESULT stop;
|
||||
/*!
|
||||
covers the adress of the exit function. NULL, if
|
||||
there was no exit function.
|
||||
*/
|
||||
void* (*exitfnc)(void*);
|
||||
};
|
||||
|
||||
/*!
|
||||
\class Timer
|
||||
\brief A thread based timer class for handling timeouts in
|
||||
an easier way.
|
||||
|
||||
On starting every timer instance will create it's own thread.
|
||||
The thread makes simply nothing, until it's given time is over.
|
||||
After that, he set a variable, refer by it's adress to one
|
||||
and exit.
|
||||
|
||||
There are a lot of situations, which the timer class must handle.
|
||||
The timer instance leaves his valid range (for example, the
|
||||
timer instance is local inside a function, and the function fished)
|
||||
BEFORE the thread was ending. In this case, the destructor must
|
||||
terminate the thread in a correct way. (This is very different
|
||||
between the OS. threads are a system resource like file descriptors
|
||||
and must be deallocated after using it).
|
||||
|
||||
The thread should be asynchronously stopped. Means, under all
|
||||
circumstance, it must be possible, to finish the timer and start
|
||||
it again.
|
||||
|
||||
Several timer instance can be used simultanously.
|
||||
*/
|
||||
class Timer
|
||||
{
|
||||
protected:
|
||||
/*!
|
||||
\brief win32 needs this
|
||||
*/
|
||||
DWORD id;
|
||||
/*!
|
||||
\brief in win32 internal handle for the timer thread
|
||||
*/
|
||||
MMRESULT h;
|
||||
/*!
|
||||
control covers the time interval, the adress
|
||||
of the exitflag, and if not null, a function, which will
|
||||
be called on the end.
|
||||
*/
|
||||
timer_control control;
|
||||
/*!
|
||||
here we store the time interval, whilst the timer run.
|
||||
This is waste!!!
|
||||
*/
|
||||
unsigned int timer_secs;
|
||||
public:
|
||||
/*!
|
||||
The constructor creates an timer object with the given
|
||||
properties. The timer at this moment is not started. This
|
||||
will be done with the start() member function.
|
||||
\param msec time interval after that the the variable
|
||||
pointed by exitflag is setting to one.
|
||||
\param exitflag the adress of an integer, which was set
|
||||
to one after the given time interval.
|
||||
\warning The integer variable shouldn't leave it's valid
|
||||
range, before the timer was finished. So never take a
|
||||
local variable.
|
||||
\param exitfnc A function, which was called after msec.
|
||||
If you don't want this, refer a NULL pointer.
|
||||
*/
|
||||
Timer(unsigned int msec,int* exitflag,void*(*exitfnc)(void*));
|
||||
/*!
|
||||
the destructor. If his was called (for example by leaving the
|
||||
valid range of the timer object), the timer thread automaticaly
|
||||
will finished. The exitflag wouldn't be set, also the exitfnc
|
||||
wouldn't be called.
|
||||
*/
|
||||
~Timer();
|
||||
/*!
|
||||
starts the timer. But now a thread will created and started.
|
||||
After this, the timer thread will be running until he was stopped
|
||||
by calling stop() or reached his given time interval.
|
||||
*/
|
||||
int start();
|
||||
/*!
|
||||
stops the timer and canceled the timer thread. After timer::stop() a new
|
||||
start() will started the timer from beginning.
|
||||
*/
|
||||
int stop();
|
||||
};
|
||||
|
||||
/*!
|
||||
\fn kill_all_timer()
|
||||
\warning This function don't works under win32 and will be removed next
|
||||
time. So don't use that!
|
||||
*/
|
||||
void kill_all_timer();
|
||||
|
||||
/*!
|
||||
\fn
|
||||
A plattform independent function, to go to sleep for the given
|
||||
time interval.
|
||||
\param ms time interval in milli seconds
|
||||
*/
|
||||
void sleepms(unsigned int ms);
|
||||
|
||||
} // namespace ctb
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1 @@
|
||||
ciao
|
||||
Binary file not shown.
@@ -0,0 +1,455 @@
|
||||
import wxctb, sys, re
|
||||
|
||||
DCD = wxctb.LinestateDcd
|
||||
CTS = wxctb.LinestateCts
|
||||
DSR = wxctb.LinestateDsr
|
||||
DTR = wxctb.LinestateDtr
|
||||
RING = wxctb.LinestateRing
|
||||
RTS = wxctb.LinestateRts
|
||||
NULL = wxctb.LinestateNull
|
||||
|
||||
def abstract():
|
||||
import inspect
|
||||
caller = inspect.getouterframes(inspect.currentframe())[1][3]
|
||||
raise NotImplementedError(caller + ' must be implemented in subclass')
|
||||
|
||||
class IOBase:
|
||||
def __init__(self):
|
||||
self.device = None
|
||||
# set timeout to 1000ms (the default)
|
||||
self.timeout = 1000
|
||||
|
||||
def __del__(self):
|
||||
pass
|
||||
|
||||
def Close(self):
|
||||
if self.device:
|
||||
self.device.Close()
|
||||
|
||||
def GetTimeout(self):
|
||||
"""
|
||||
Returns the internal timeout value in milliseconds
|
||||
"""
|
||||
return self.timeout
|
||||
|
||||
def Ioctl(self,cmd,arg):
|
||||
if self.device:
|
||||
self.device.Ioctl(cmd,arg)
|
||||
|
||||
def Open(self):
|
||||
abstract()
|
||||
|
||||
def PutBack(self,char):
|
||||
return self.device.PutBack(char)
|
||||
|
||||
def Read(self,length):
|
||||
"""
|
||||
Try to read the given count of data (length) and returns the
|
||||
successfully readed number of data. The function never blocks.
|
||||
For example:
|
||||
readed = dev.Read(100)
|
||||
"""
|
||||
buf = "\x00"*(length+1)
|
||||
rd = self.device.Read(buf,length)
|
||||
return buf[0:rd]
|
||||
|
||||
def ReadBinary(self,eos="\n"):
|
||||
"""
|
||||
Special SCPI command. Read the next data coded as a SCPI
|
||||
binary format.
|
||||
A binary data transfer will be startet by '#'. The next byte
|
||||
tells the count of bytes for the binary length header,
|
||||
following by the length bytes. After these the data begins.
|
||||
For example:
|
||||
#500004xxxx
|
||||
The header length covers 5 Byte, the length of the binary
|
||||
data is 4 (x means the binary data bytes)
|
||||
"""
|
||||
try:
|
||||
eoslen = len(eos)
|
||||
b=self.Readv(2)
|
||||
if len(b) == 2:
|
||||
hl = int(b[1])
|
||||
b = self.Readv(hl)
|
||||
if len(b) == hl:
|
||||
dl = int(b)
|
||||
# don't left over the eos string or character in the
|
||||
# device input buffer
|
||||
data = self.Readv(dl+eoslen)
|
||||
# check, if the binary data block is complete
|
||||
if data[dl] == '#':
|
||||
# not complete, another block is following
|
||||
for c in data[dl:dl+eoslen]:
|
||||
self.PutBack(c)
|
||||
|
||||
data = data[:dl] + self.ReadBinary()
|
||||
return data
|
||||
except:
|
||||
pass
|
||||
return ''
|
||||
|
||||
def ReadUntilEOS(self,eos="\n",quota=0):
|
||||
"""
|
||||
ReadUntilEOS(eosString=\"\\n\",timeout=1000)
|
||||
Reads data until the given eos string was received (default is
|
||||
the linefeed character (0x0a) or the internal timeout
|
||||
(default 1000ms) was reached.
|
||||
ReadUntilEOS returns the result as the following tuple:
|
||||
['received string',state,readedBytes]
|
||||
If a timeout occurred, state is 0, otherwise 1
|
||||
"""
|
||||
return self.device.ReadUntilEOS("",0,eos,self.timeout,quota)
|
||||
|
||||
def Readv(self,length):
|
||||
"""
|
||||
Try to read the given count of data. Readv blocks until all data
|
||||
was readed successfully or the internal timeout, set with the
|
||||
class member function SetTimeout(timeout), was reached.
|
||||
Returns the readed data.
|
||||
"""
|
||||
buf = "\x00"*length
|
||||
rd = self.device.Readv(buf,length,self.timeout)
|
||||
return buf[0:rd]
|
||||
|
||||
def ResetBus(self):
|
||||
"""
|
||||
If the underlaying interface needs some special reset operations
|
||||
(for instance the GPIB distinguish between a normal device reset
|
||||
and a special bus reset), you can put some code here)
|
||||
"""
|
||||
pass
|
||||
|
||||
def SetTimeout(self,timeout):
|
||||
"""
|
||||
Set the internal timeout value in milliseconds for all blocked
|
||||
operations like ReadUntilEOS, Readv and Writev.
|
||||
"""
|
||||
self.timeout = timeout
|
||||
|
||||
def Write(self,string):
|
||||
"""
|
||||
Writes the given string to the device and returns immediately.
|
||||
Write returns the number of data bytes successfully written or a
|
||||
negativ number if an error occured. For some circumstances, not
|
||||
the complete string was written.
|
||||
So you have to verify the return value to check this out.
|
||||
"""
|
||||
return self.device.Write(string,len(string))
|
||||
|
||||
def Writev(self,string):
|
||||
"""
|
||||
Writes the given string to the device. The function blocks until
|
||||
the complete string was written or the internal timeout, set with
|
||||
SetTimeout(timeout), was reached.
|
||||
Writev returns the number of data successfully written or a
|
||||
negativ value, if an errors occurred.
|
||||
"""
|
||||
return self.device.Writev(string,len(string),self.timeout)
|
||||
|
||||
class SerialPort(IOBase):
|
||||
def __init__(self):
|
||||
IOBase.__init__(self)
|
||||
|
||||
def __del__(self):
|
||||
self.Close()
|
||||
|
||||
def ChangeLineState(self,lineState):
|
||||
"""
|
||||
Change (toggle) the state of each the lines given in the
|
||||
linestate parameter. Possible values are DTR and/or RTS.
|
||||
For example to toggle the RTS line only:
|
||||
dev.ChangeLineState(RTS)
|
||||
"""
|
||||
self.device.ChangeLineState(lineState)
|
||||
|
||||
def ClrLineState(self,lineState):
|
||||
"""
|
||||
Clear the lines given in the linestate parameter. Possible
|
||||
values are DTR and/or RTS. For example to clear only
|
||||
the RTS line:
|
||||
dev.ClrLineState(RTS)
|
||||
"""
|
||||
self.device.ClrLineState(lineState)
|
||||
|
||||
def GetAvailableBytes(self):
|
||||
"""
|
||||
Returns the available bytes in the input queue of the serial
|
||||
driver.
|
||||
"""
|
||||
n = wxctb.new_intp()
|
||||
wxctb.intp_assign(n, 0)
|
||||
self.device.Ioctl(wxctb.CTB_SER_GETINQUE,n)
|
||||
return wxctb.intp_value(n)
|
||||
|
||||
def GetCommErrors(self):
|
||||
"""
|
||||
Get the internal communication errors like breaks, framing,
|
||||
parity or overrun errors.
|
||||
Returns the count of each error as a tuple like this:
|
||||
(b,f,o,p) = dev.GetCommErrors()
|
||||
b: breaks, f: framing errors, o: overruns, p: parity errors
|
||||
"""
|
||||
einfo = wxctb.SerialPort_EINFO()
|
||||
self.device.Ioctl(wxctb.CTB_SER_GETEINFO,einfo)
|
||||
return einfo.brk,einfo.frame,einfo.overrun,einfo.parity
|
||||
|
||||
def GetLineState(self):
|
||||
"""
|
||||
Returns the current linestates of the CTS, DCD, DSR and RING
|
||||
signal line as an integer value with the appropriate bits or
|
||||
-1 on error.
|
||||
For example:
|
||||
lines = dev.GetLineState()
|
||||
if lines & CTS:
|
||||
print \"CTS is on\"
|
||||
"""
|
||||
return self.device.GetLineState()
|
||||
|
||||
def Open(self,devname,baudrate,protocol='8N1',handshake='no_handshake'):
|
||||
"""
|
||||
Open the device devname with the given baudrate, the protocol
|
||||
like '8N1' (default) and the use of the handshake [no_handshake
|
||||
(default), rtscts or xonxoff]
|
||||
For example:
|
||||
At Linux:
|
||||
dev = SerialPort()
|
||||
dev.Open(\"/dev/ttyS0\",115200)
|
||||
or with a datalen of 7 bits, even parity, 2 stopbits and rts/cts
|
||||
handshake:
|
||||
dev.Open(\"/dev/ttyS0\",115200,'7E2',True)
|
||||
At Windows:
|
||||
dev = SerialPort()
|
||||
dev.Open(\"COM1\",115200)
|
||||
dev.Open(\"COM1\",115200,'7E2',True)
|
||||
Returns the handle on success or a negativ value on failure.
|
||||
"""
|
||||
# the following parity values are valid:
|
||||
# N:None, O:Odd, E:Even, M:Mark, S:Space
|
||||
parity = {'N':0,'O':1,'E':2,'M':3,'S':4}
|
||||
# the regular expression ensures a valid value for the datalen
|
||||
# (5...8 bit) and the count of stopbits (1,2)
|
||||
reg=re.compile(r"(?P<w>[8765])"r"(?P<p>[NOEMS])"r"(?P<s>[12])")
|
||||
self.device = wxctb.SerialPort()
|
||||
dcs = wxctb.SerialPort_DCS()
|
||||
dcs.baud = baudrate
|
||||
res = reg.search(protocol)
|
||||
# handle the given protocol
|
||||
if res:
|
||||
dcs.wordlen = int(res.group('w'))
|
||||
dcs.stopbits = int(res.group('s'))
|
||||
dcs.parity = parity[res.group('p')]
|
||||
# valid handshake are no one, rts/cts or xon/xoff
|
||||
if handshake == 'rtscts':
|
||||
dcs.rtscts = True
|
||||
elif handshake == 'xonxoff':
|
||||
dcs.xonxoff = True
|
||||
|
||||
return self.device.Open(devname,dcs)
|
||||
|
||||
def Reset(self):
|
||||
"""
|
||||
Send a break for 0.25s.
|
||||
"""
|
||||
self.device.SendBreak(0)
|
||||
|
||||
def SetBaudrate(self,baudrate):
|
||||
"""
|
||||
Set the baudrate for the device.
|
||||
"""
|
||||
self.device.SetBaudrate(baudrate)
|
||||
|
||||
def SetLineState(self,lineState):
|
||||
"""
|
||||
Set the lines given in the linestate parameter. Possible
|
||||
values are DTR and/or RTS. For example to set both:
|
||||
dev.SetLineState( DTR | RTS)
|
||||
"""
|
||||
self.device.SetLineState(lineState)
|
||||
|
||||
def SetParityBit(self,parity):
|
||||
"""
|
||||
Set the parity bit explicitly to 0 or 1. Use this function, if
|
||||
you would like to simulate a 9 bit wordlen at what the ninth bit
|
||||
was represented by the parity bit value. For example:
|
||||
dev.SetParityBit( 0 )
|
||||
dev.Write('some data sent with parity 0')
|
||||
dev.SetParityBit( 1 )
|
||||
dev.Write('another sequence with parity 1')
|
||||
"""
|
||||
return self.device.SetParityBit( parity )
|
||||
|
||||
class GpibDevice(IOBase):
|
||||
"""
|
||||
GPIB class
|
||||
"""
|
||||
def __init__(self):
|
||||
IOBase.__init__(self)
|
||||
|
||||
def __del__(self):
|
||||
self.Close()
|
||||
|
||||
def FindListeners(self,board = 0):
|
||||
"""
|
||||
Returns the address of the connected devices as a list.
|
||||
If no device is listening, the list is empty. If an error
|
||||
occurs an IOError exception raised. For example:
|
||||
g = GPIB()
|
||||
listeners = g.FindListeners()
|
||||
"""
|
||||
listeners = wxctb.GPIB_x_FindListeners(board)
|
||||
if listeners < 0:
|
||||
raise IOError("GPIB board error")
|
||||
result = []
|
||||
for i in range(1,31):
|
||||
if listeners & (1 << i):
|
||||
result.append(i)
|
||||
return result
|
||||
|
||||
def GetEosChar(self):
|
||||
"""
|
||||
Get the internal EOS termination character (see SetEosChar).
|
||||
For example:
|
||||
g = GPIB()
|
||||
g.Open(\"gpib1\",1)
|
||||
eos = g.GetEosChar()
|
||||
"""
|
||||
eos = wxctb.new_intp()
|
||||
wxctb.intp_assign(eos, 0)
|
||||
self.device.Ioctl(wxctb.CTB_GPIB_GET_EOS_CHAR,eos)
|
||||
return wxctb.intp_value(eos)
|
||||
|
||||
def GetEosMode(self):
|
||||
"""
|
||||
Get the internal EOS mode (see SetEosMode).
|
||||
For example:
|
||||
g = GPIB()
|
||||
g.Open(\"gpib1\",1)
|
||||
eos = g.GetEosMode()
|
||||
"""
|
||||
mode = wxctb.new_intp()
|
||||
wxctb.intp_assign(mode, 0)
|
||||
self.device.Ioctl(wxctb.CTB_GPIB_GET_EOS_MODE,mode)
|
||||
return wxctb.intp_value(mode)
|
||||
|
||||
def GetError(self):
|
||||
errorString = " "*256
|
||||
self.device.GetError(errorString,256)
|
||||
return errorString
|
||||
|
||||
def GetSTB(self):
|
||||
"""
|
||||
Returns the value of the internal GPIB status byte register.
|
||||
"""
|
||||
stb = wxctb.new_intp()
|
||||
wxctb.intp_assign(stb, 0)
|
||||
self.device.Ioctl(wxctb.CTB_GPIB_GETRSP,stb)
|
||||
return wxctb.intp_value(stb)
|
||||
|
||||
# This is only for internal usage!!!
|
||||
def Ibrd(self,length):
|
||||
buf = "\x00"*length
|
||||
state = self.device.Ibrd(buf,length)
|
||||
return state,buf
|
||||
|
||||
# This is only for internal usage!!!
|
||||
def Ibwrt(self,string):
|
||||
return self.device.Ibwrt(string,len(string))
|
||||
|
||||
def Open(self,devname,adr,eosChar=10,eosMode=0x08|0x04):
|
||||
"""
|
||||
Open(gpibdevice,address,eosChar,eosMode)
|
||||
Opens a connected device at the GPIB bus. gpibdevice means the
|
||||
controller, (mostly \"gpib1\"), address the address of the desired
|
||||
device in the range 1...31. The eosChar defines the EOS character
|
||||
(default is linefeed), eosMode may be a combination of bits ORed
|
||||
together. The following bits can be used:
|
||||
0x04: Terminate read when EOS is detected.
|
||||
0x08: Set EOI (End or identify line) with EOS on write function
|
||||
0x10: Compare all 8 bits of EOS byte rather than low 7 bits
|
||||
(all read and write functions). Default is 0x12
|
||||
For example:
|
||||
dev = GPIB()
|
||||
dev.Open(\"gpib1\",17)
|
||||
Opens the device with the address 17, linefeed as EOS (default)
|
||||
and eos mode with 0x04 and 0x08.
|
||||
Open returns >= 0 or a negativ value, if something going wrong.
|
||||
"""
|
||||
self.device = wxctb.GpibDevice()
|
||||
dcs = wxctb.Gpib_DCS()
|
||||
dcs.m_address1 = adr
|
||||
dcs.m_eosChar = eosChar
|
||||
dcs.m_eosMode = eosMode
|
||||
result = self.device.Open(devname,dcs)
|
||||
return result
|
||||
|
||||
def Reset(self):
|
||||
"""
|
||||
Resets the connected device. In the GPIB definition, the device
|
||||
should be reset to it's initial state, so you can restart a
|
||||
formely lost communication.
|
||||
"""
|
||||
self.device.Ioctl(wxctb.CTB_RESET,None)
|
||||
|
||||
def ResetBus(self):
|
||||
"""
|
||||
The command asserts the GPIB interface clear (IFC) line for
|
||||
ast least 100us if the GPIB board is the system controller.
|
||||
This initializes the GPIB and makes the interface CIC and
|
||||
active controller with ATN asserted.
|
||||
Note! The IFC signal resets only the GPIB interface functions
|
||||
of the bus devices and not the internal device functions.
|
||||
For a device reset you should use the Reset() command above.
|
||||
"""
|
||||
self.device.Ioctl(wxctb.CTB_GPIB_RESET_BUS,None)
|
||||
|
||||
def SetEosChar(self,eos):
|
||||
"""
|
||||
Configure the end-of-string (EOS) termination character.
|
||||
Note! Defining an EOS byte does not cause the driver to
|
||||
automatically send that byte at the end of write I/O
|
||||
operations. The application is responsible for placing the
|
||||
EOS byte at the end of the data strings that it defines.
|
||||
(National Instruments NI-488.2M Function Reference Manual)
|
||||
For example:
|
||||
g = GPIB()
|
||||
g.Open(\"gpib1\",1)
|
||||
eos = g.GetEosChar(0x10)
|
||||
"""
|
||||
intp = wxctb.new_intp()
|
||||
wxctb.intp_assign(intp, eos)
|
||||
return self.device.Ioctl(wxctb.CTB_GPIB_SET_EOS_CHAR,intp)
|
||||
|
||||
def SetEosMode(self,mode):
|
||||
"""
|
||||
Set the EOS mode (handling).m_eosMode may be a combination
|
||||
of bits ORed together. The following bits can be used:
|
||||
0x04: Terminate read when EOS is detected.
|
||||
0x08: Set EOI (End or identify line) with EOS on write function
|
||||
0x10: Compare all 8 bits of EOS byte rather than low 7 bits
|
||||
(all read and write functions). For example:
|
||||
g = GPIB()
|
||||
g.Open(\"gpib1\",1)
|
||||
eos = g.GetEosMode(0x04 | 0x08)
|
||||
"""
|
||||
intp = wxctb.new_intp()
|
||||
wxctb.intp_assign(intp, mode)
|
||||
return self.device.Ioctl(wxctb.CTB_GPIB_SET_EOS_MODE,intp)
|
||||
|
||||
def GetKey():
|
||||
"""
|
||||
Returns the current pressed key or '\0', if no key is pressed.
|
||||
You can simply create a query loop with:
|
||||
while GetKey() == '\0':
|
||||
... make some stuff ...
|
||||
|
||||
"""
|
||||
return wxctb.GetKey()
|
||||
|
||||
def GetVersion():
|
||||
"""
|
||||
Returns the version of the ctb python module. The numbering
|
||||
has the following format: x.y.z
|
||||
x.y means the version of the underlaying ctb lib, z the version
|
||||
of the python port.
|
||||
"""
|
||||
return "0.16"
|
||||
@@ -0,0 +1,264 @@
|
||||
# This file was automatically generated by SWIG (http://www.swig.org).
|
||||
# Version 1.3.40
|
||||
#
|
||||
# Do not make changes to this file unless you know what you are doing--modify
|
||||
# the SWIG interface file instead.
|
||||
|
||||
from sys import version_info
|
||||
if version_info >= (2,6,0):
|
||||
def swig_import_helper():
|
||||
from os.path import dirname
|
||||
import imp
|
||||
fp = None
|
||||
try:
|
||||
fp, pathname, description = imp.find_module('_wxctb', [dirname(__file__)])
|
||||
except ImportError:
|
||||
import _wxctb
|
||||
return _wxctb
|
||||
if fp is not None:
|
||||
try:
|
||||
_mod = imp.load_module('_wxctb', fp, pathname, description)
|
||||
finally:
|
||||
fp.close()
|
||||
return _mod
|
||||
_wxctb = swig_import_helper()
|
||||
del swig_import_helper
|
||||
else:
|
||||
import _wxctb
|
||||
del version_info
|
||||
try:
|
||||
_swig_property = property
|
||||
except NameError:
|
||||
pass # Python < 2.2 doesn't have 'property'.
|
||||
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if (name == "this"):
|
||||
if type(value).__name__ == 'SwigPyObject':
|
||||
self.__dict__[name] = value
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
if (not static) or hasattr(self,name):
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
if (name == "thisown"): return self.this.own()
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError(name)
|
||||
|
||||
def _swig_repr(self):
|
||||
try: strthis = "proxy of " + self.this.__repr__()
|
||||
except: strthis = ""
|
||||
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||||
|
||||
try:
|
||||
_object = object
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
|
||||
|
||||
def _swig_setattr_nondynamic_method(set):
|
||||
def set_attr(self,name,value):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if hasattr(self,name) or (name == "this"):
|
||||
set(self,name,value)
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
return set_attr
|
||||
|
||||
|
||||
|
||||
def new_intp():
|
||||
return _wxctb.new_intp()
|
||||
new_intp = _wxctb.new_intp
|
||||
|
||||
def copy_intp(*args, **kwargs):
|
||||
return _wxctb.copy_intp(*args, **kwargs)
|
||||
copy_intp = _wxctb.copy_intp
|
||||
|
||||
def delete_intp(*args, **kwargs):
|
||||
return _wxctb.delete_intp(*args, **kwargs)
|
||||
delete_intp = _wxctb.delete_intp
|
||||
|
||||
def intp_assign(*args, **kwargs):
|
||||
return _wxctb.intp_assign(*args, **kwargs)
|
||||
intp_assign = _wxctb.intp_assign
|
||||
|
||||
def intp_value(*args, **kwargs):
|
||||
return _wxctb.intp_value(*args, **kwargs)
|
||||
intp_value = _wxctb.intp_value
|
||||
class timer_control(object):
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
|
||||
__repr__ = _swig_repr
|
||||
usecs = _swig_property(_wxctb.timer_control_usecs_get, _wxctb.timer_control_usecs_set)
|
||||
exitflag = _swig_property(_wxctb.timer_control_exitflag_get, _wxctb.timer_control_exitflag_set)
|
||||
exitfnc = _swig_property(_wxctb.timer_control_exitfnc_get, _wxctb.timer_control_exitfnc_set)
|
||||
timer_control_swigregister = _wxctb.timer_control_swigregister
|
||||
timer_control_swigregister(timer_control)
|
||||
|
||||
class Timer(object):
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
this = _wxctb.new_Timer(*args, **kwargs)
|
||||
try: self.this.append(this)
|
||||
except: self.this = this
|
||||
__swig_destroy__ = _wxctb.delete_Timer
|
||||
__del__ = lambda self : None;
|
||||
def start(self): return _wxctb.Timer_start(self)
|
||||
def stop(self): return _wxctb.Timer_stop(self)
|
||||
Timer_swigregister = _wxctb.Timer_swigregister
|
||||
Timer_swigregister(Timer)
|
||||
|
||||
|
||||
def sleepms(*args, **kwargs):
|
||||
return _wxctb.sleepms(*args, **kwargs)
|
||||
sleepms = _wxctb.sleepms
|
||||
CTB_RESET = _wxctb.CTB_RESET
|
||||
class IOBase(object):
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
|
||||
__repr__ = _swig_repr
|
||||
__swig_destroy__ = _wxctb.delete_IOBase
|
||||
__del__ = lambda self : None;
|
||||
def ClassName(self): return _wxctb.IOBase_ClassName(self)
|
||||
def Close(self): return _wxctb.IOBase_Close(self)
|
||||
def Ioctl(self, *args, **kwargs): return _wxctb.IOBase_Ioctl(self, *args, **kwargs)
|
||||
def IsOpen(self): return _wxctb.IOBase_IsOpen(self)
|
||||
def Open(self, *args, **kwargs): return _wxctb.IOBase_Open(self, *args, **kwargs)
|
||||
def PutBack(self, *args, **kwargs): return _wxctb.IOBase_PutBack(self, *args, **kwargs)
|
||||
def Read(self, *args, **kwargs): return _wxctb.IOBase_Read(self, *args, **kwargs)
|
||||
def ReadUntilEOS(self, *args, **kwargs): return _wxctb.IOBase_ReadUntilEOS(self, *args, **kwargs)
|
||||
def Readv(self, *args, **kwargs): return _wxctb.IOBase_Readv(self, *args, **kwargs)
|
||||
def Write(self, *args, **kwargs): return _wxctb.IOBase_Write(self, *args, **kwargs)
|
||||
def Writev(self, *args, **kwargs): return _wxctb.IOBase_Writev(self, *args, **kwargs)
|
||||
IOBase_swigregister = _wxctb.IOBase_swigregister
|
||||
IOBase_swigregister(IOBase)
|
||||
|
||||
ParityNone = _wxctb.ParityNone
|
||||
ParityOdd = _wxctb.ParityOdd
|
||||
ParityEven = _wxctb.ParityEven
|
||||
ParityMark = _wxctb.ParityMark
|
||||
ParitySpace = _wxctb.ParitySpace
|
||||
LinestateDcd = _wxctb.LinestateDcd
|
||||
LinestateCts = _wxctb.LinestateCts
|
||||
LinestateDsr = _wxctb.LinestateDsr
|
||||
LinestateDtr = _wxctb.LinestateDtr
|
||||
LinestateRing = _wxctb.LinestateRing
|
||||
LinestateRts = _wxctb.LinestateRts
|
||||
LinestateNull = _wxctb.LinestateNull
|
||||
class SerialPort_DCS(object):
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
baud = _swig_property(_wxctb.SerialPort_DCS_baud_get, _wxctb.SerialPort_DCS_baud_set)
|
||||
parity = _swig_property(_wxctb.SerialPort_DCS_parity_get, _wxctb.SerialPort_DCS_parity_set)
|
||||
wordlen = _swig_property(_wxctb.SerialPort_DCS_wordlen_get, _wxctb.SerialPort_DCS_wordlen_set)
|
||||
stopbits = _swig_property(_wxctb.SerialPort_DCS_stopbits_get, _wxctb.SerialPort_DCS_stopbits_set)
|
||||
rtscts = _swig_property(_wxctb.SerialPort_DCS_rtscts_get, _wxctb.SerialPort_DCS_rtscts_set)
|
||||
xonxoff = _swig_property(_wxctb.SerialPort_DCS_xonxoff_get, _wxctb.SerialPort_DCS_xonxoff_set)
|
||||
buf = _swig_property(_wxctb.SerialPort_DCS_buf_get, _wxctb.SerialPort_DCS_buf_set)
|
||||
def __init__(self):
|
||||
this = _wxctb.new_SerialPort_DCS()
|
||||
try: self.this.append(this)
|
||||
except: self.this = this
|
||||
__swig_destroy__ = _wxctb.delete_SerialPort_DCS
|
||||
__del__ = lambda self : None;
|
||||
def GetSettings(self): return _wxctb.SerialPort_DCS_GetSettings(self)
|
||||
SerialPort_DCS_swigregister = _wxctb.SerialPort_DCS_swigregister
|
||||
SerialPort_DCS_swigregister(SerialPort_DCS)
|
||||
|
||||
class SerialPort_EINFO(object):
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
brk = _swig_property(_wxctb.SerialPort_EINFO_brk_get, _wxctb.SerialPort_EINFO_brk_set)
|
||||
frame = _swig_property(_wxctb.SerialPort_EINFO_frame_get, _wxctb.SerialPort_EINFO_frame_set)
|
||||
overrun = _swig_property(_wxctb.SerialPort_EINFO_overrun_get, _wxctb.SerialPort_EINFO_overrun_set)
|
||||
parity = _swig_property(_wxctb.SerialPort_EINFO_parity_get, _wxctb.SerialPort_EINFO_parity_set)
|
||||
def __init__(self):
|
||||
this = _wxctb.new_SerialPort_EINFO()
|
||||
try: self.this.append(this)
|
||||
except: self.this = this
|
||||
__swig_destroy__ = _wxctb.delete_SerialPort_EINFO
|
||||
__del__ = lambda self : None;
|
||||
SerialPort_EINFO_swigregister = _wxctb.SerialPort_EINFO_swigregister
|
||||
SerialPort_EINFO_swigregister(SerialPort_EINFO)
|
||||
|
||||
CTB_SER_GETEINFO = _wxctb.CTB_SER_GETEINFO
|
||||
CTB_SER_GETBRK = _wxctb.CTB_SER_GETBRK
|
||||
CTB_SER_GETFRM = _wxctb.CTB_SER_GETFRM
|
||||
CTB_SER_GETOVR = _wxctb.CTB_SER_GETOVR
|
||||
CTB_SER_GETPAR = _wxctb.CTB_SER_GETPAR
|
||||
CTB_SER_GETINQUE = _wxctb.CTB_SER_GETINQUE
|
||||
CTB_SER_SETPAR = _wxctb.CTB_SER_SETPAR
|
||||
class SerialPort_x(IOBase):
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
|
||||
__repr__ = _swig_repr
|
||||
__swig_destroy__ = _wxctb.delete_SerialPort_x
|
||||
__del__ = lambda self : None;
|
||||
def ClassName(self): return _wxctb.SerialPort_x_ClassName(self)
|
||||
def ChangeLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_ChangeLineState(self, *args, **kwargs)
|
||||
def ClrLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_ClrLineState(self, *args, **kwargs)
|
||||
def GetLineState(self): return _wxctb.SerialPort_x_GetLineState(self)
|
||||
def GetSettingsAsString(self): return _wxctb.SerialPort_x_GetSettingsAsString(self)
|
||||
def Ioctl(self, *args, **kwargs): return _wxctb.SerialPort_x_Ioctl(self, *args, **kwargs)
|
||||
def SendBreak(self, *args, **kwargs): return _wxctb.SerialPort_x_SendBreak(self, *args, **kwargs)
|
||||
def SetBaudrate(self, *args, **kwargs): return _wxctb.SerialPort_x_SetBaudrate(self, *args, **kwargs)
|
||||
def SetLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_SetLineState(self, *args, **kwargs)
|
||||
def SetParityBit(self, *args, **kwargs): return _wxctb.SerialPort_x_SetParityBit(self, *args, **kwargs)
|
||||
IsStandardRate = staticmethod(_wxctb.SerialPort_x_IsStandardRate)
|
||||
SerialPort_x_swigregister = _wxctb.SerialPort_x_swigregister
|
||||
SerialPort_x_swigregister(SerialPort_x)
|
||||
|
||||
def SerialPort_x_IsStandardRate(*args, **kwargs):
|
||||
return _wxctb.SerialPort_x_IsStandardRate(*args, **kwargs)
|
||||
SerialPort_x_IsStandardRate = _wxctb.SerialPort_x_IsStandardRate
|
||||
|
||||
COM1 = "/dev/ttyS0"
|
||||
COM2 = "/dev/ttyS1"
|
||||
COM3 = "/dev/ttyS2"
|
||||
COM4 = "/dev/ttyS3"
|
||||
COM5 = "/dev/ttyS4"
|
||||
COM6 = "/dev/ttyS5"
|
||||
COM7 = "/dev/ttyS6"
|
||||
COM8 = "/dev/ttyS7"
|
||||
COM9 = "/dev/ttyS8"
|
||||
|
||||
class SerialPort(SerialPort_x):
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self):
|
||||
this = _wxctb.new_SerialPort()
|
||||
try: self.this.append(this)
|
||||
except: self.this = this
|
||||
__swig_destroy__ = _wxctb.delete_SerialPort
|
||||
__del__ = lambda self : None;
|
||||
def ChangeLineState(self, *args, **kwargs): return _wxctb.SerialPort_ChangeLineState(self, *args, **kwargs)
|
||||
def ClrLineState(self, *args, **kwargs): return _wxctb.SerialPort_ClrLineState(self, *args, **kwargs)
|
||||
def GetLineState(self): return _wxctb.SerialPort_GetLineState(self)
|
||||
def Ioctl(self, *args, **kwargs): return _wxctb.SerialPort_Ioctl(self, *args, **kwargs)
|
||||
def IsOpen(self): return _wxctb.SerialPort_IsOpen(self)
|
||||
def Read(self, *args, **kwargs): return _wxctb.SerialPort_Read(self, *args, **kwargs)
|
||||
def SendBreak(self, *args, **kwargs): return _wxctb.SerialPort_SendBreak(self, *args, **kwargs)
|
||||
def SetBaudrate(self, *args, **kwargs): return _wxctb.SerialPort_SetBaudrate(self, *args, **kwargs)
|
||||
def SetLineState(self, *args, **kwargs): return _wxctb.SerialPort_SetLineState(self, *args, **kwargs)
|
||||
def SetParityBit(self, *args, **kwargs): return _wxctb.SerialPort_SetParityBit(self, *args, **kwargs)
|
||||
def Write(self, *args, **kwargs): return _wxctb.SerialPort_Write(self, *args, **kwargs)
|
||||
SerialPort_swigregister = _wxctb.SerialPort_swigregister
|
||||
SerialPort_swigregister(SerialPort)
|
||||
|
||||
|
||||
def GetKey():
|
||||
return _wxctb.GetKey()
|
||||
GetKey = _wxctb.GetKey
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import getopt, time, sys
|
||||
|
||||
sys.path.insert( 0, r'/home/jb/project/libctb-0.16/python/module/linux')
|
||||
|
||||
import ctb
|
||||
|
||||
def main():
|
||||
|
||||
baudrate = 19200
|
||||
|
||||
devname = ""
|
||||
|
||||
protocol = '8N1'
|
||||
|
||||
try:
|
||||
opt,arg = getopt.getopt(sys.argv[1:],
|
||||
'b:d:p:',
|
||||
['baudrate=',
|
||||
'device=',
|
||||
'protocol='
|
||||
])
|
||||
|
||||
except getopt.GetoptError:
|
||||
print "usage: parity.py [options]\n"\
|
||||
"\t-b baudrate\n"\
|
||||
"\t--baudrate=baudrate"\
|
||||
"\t-d device\n"\
|
||||
"\t--device=serial device name like /dev/ttyS0 or COM1\n"\
|
||||
"\t-h\n"\
|
||||
"\t--help print this\n"\
|
||||
"\n"
|
||||
sys.exit(0)
|
||||
|
||||
for o,a in opt:
|
||||
|
||||
if o in ("-b","--baudrate"):
|
||||
|
||||
baudrate = int(a)
|
||||
|
||||
if o in ("-d","--device"):
|
||||
|
||||
devname = a
|
||||
|
||||
if o in ("-p","--protocol"):
|
||||
|
||||
protocol = a
|
||||
|
||||
|
||||
print "Using ctb version " + ctb.GetVersion()
|
||||
|
||||
dev = ctb.SerialPort()
|
||||
|
||||
if dev.Open( devname, baudrate, protocol ) < 0:
|
||||
|
||||
print "Cannot open " + devname + "\n"
|
||||
|
||||
# send the following string with a always set parity bit
|
||||
dev.SetParityBit( 1 )
|
||||
|
||||
dev.Writev( "Hello World" )
|
||||
|
||||
# send the following string with a always cleared parity bit
|
||||
dev.SetParityBit( 0 )
|
||||
|
||||
dev.Writev( "Hello World" )
|
||||
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import getopt, time, sys
|
||||
|
||||
sys.path.insert( 0, r'/home/jb/project/libctb-0.16/python/module/linux')
|
||||
|
||||
import ctb
|
||||
|
||||
def DataBlock():
|
||||
data = ''
|
||||
for c in range( 0, 256):
|
||||
data += '%c' % c
|
||||
|
||||
return data
|
||||
|
||||
def main():
|
||||
|
||||
baudrate = 19200
|
||||
|
||||
devname = ""
|
||||
|
||||
try:
|
||||
opt,arg = getopt.getopt(sys.argv[1:],
|
||||
'b:d:',
|
||||
['baudrate=',
|
||||
'device='
|
||||
])
|
||||
|
||||
except getopt.GetoptError:
|
||||
print "usage: protocol.py [options]\n"\
|
||||
"\t-b baudrate\n"\
|
||||
"\t--baudrate=baudrate"\
|
||||
"\t-d device\n"\
|
||||
"\t--device=serial device name like /dev/ttyS0 or COM1\n"\
|
||||
"\t-h\n"\
|
||||
"\t--help print this\n"\
|
||||
"\n"
|
||||
sys.exit(0)
|
||||
|
||||
for o,a in opt:
|
||||
|
||||
if o in ("-b","--baudrate"):
|
||||
|
||||
baudrate = int(a)
|
||||
|
||||
if o in ("-d","--device"):
|
||||
|
||||
devname = a
|
||||
|
||||
print "Using ctb version " + ctb.GetVersion()
|
||||
|
||||
dev = ctb.SerialPort()
|
||||
|
||||
protocols = [
|
||||
'8N1','8O1','8E1','8S1','8M1'
|
||||
]
|
||||
|
||||
dev.SetTimeout( 1000 )
|
||||
|
||||
for protocol in protocols:
|
||||
|
||||
if dev.Open( devname, baudrate, protocol ) < 0:
|
||||
|
||||
print "Cannot open " + devname + "\n"
|
||||
|
||||
sys.exit( 1 )
|
||||
|
||||
else:
|
||||
|
||||
print( "%i %s" % ( baudrate, protocol ) )
|
||||
|
||||
for i in range(0, 4 ):
|
||||
|
||||
dev.Writev( "\x33" )
|
||||
|
||||
time.sleep( 0.0006 )
|
||||
|
||||
dev.Writev( "\x31" )
|
||||
|
||||
time.sleep( 0.0006 )
|
||||
|
||||
time.sleep( 0.5 )
|
||||
|
||||
dev.Close()
|
||||
|
||||
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import getopt, time, sys
|
||||
|
||||
sys.path.insert( 0, r'/home/jb/project/libctb-0.16/python/module/linux')
|
||||
|
||||
import ctb
|
||||
|
||||
def main():
|
||||
|
||||
devname = ""
|
||||
|
||||
try:
|
||||
opt,arg = getopt.getopt(sys.argv[1:],
|
||||
'd:',
|
||||
['device='
|
||||
])
|
||||
|
||||
except getopt.GetoptError:
|
||||
print "usage: parity.py [options]\n"\
|
||||
"\t-d device\n"\
|
||||
"\t--device=serial device name like /dev/ttyS0 or COM1\n"\
|
||||
"\t-h\n"\
|
||||
"\t--help print this\n"\
|
||||
"\n"
|
||||
sys.exit(0)
|
||||
|
||||
for o,a in opt:
|
||||
|
||||
if o in ("-d","--device"):
|
||||
|
||||
devname = a
|
||||
|
||||
print "Using ctb version " + ctb.GetVersion()
|
||||
|
||||
dev = ctb.SerialPort()
|
||||
|
||||
if dev.Open( devname, 38400 ) < 0:
|
||||
|
||||
print "Cannot open " + devname + "\n"
|
||||
|
||||
dev.SetLineState( ctb.DTR )
|
||||
|
||||
dev.ClrLineState( ctb.RTS )
|
||||
|
||||
for i in range( 0, 100 ) :
|
||||
|
||||
time.sleep( 0.01 )
|
||||
|
||||
dev.ChangeLineState( ctb.DTR | ctb.RTS )
|
||||
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,353 @@
|
||||
|
||||
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><title>Python: module ctb</title>
|
||||
</head><body bgcolor="#f0f0f8">
|
||||
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
||||
<tr bgcolor="#7799ee">
|
||||
<td valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>ctb</strong></big></big></font></td
|
||||
><td align=right valign=bottom
|
||||
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/mnt/s/wxaddons/wxctb-0.9/SWIG/ctb.py">/mnt/s/wxaddons/wxctb-0.9/SWIG/ctb.py</a></font></td></tr></table>
|
||||
<p></p>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#aa55cc">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="re.html">re</a><br>
|
||||
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
|
||||
</td><td width="25%" valign=top><a href="wxctb.html">wxctb</a><br>
|
||||
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ee77aa">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl>
|
||||
<dt><font face="helvetica, arial"><a href="ctb.html#wxIOBase">wxIOBase</a>
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="ctb.html#wxGPIB">wxGPIB</a>
|
||||
</font></dt><dt><font face="helvetica, arial"><a href="ctb.html#wxSerialPort">wxSerialPort</a>
|
||||
</font></dt></dl>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="wxGPIB">class <strong>wxGPIB</strong></a>(<a href="ctb.html#wxIOBase">wxIOBase</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt><a href="#wxGPIB">wxGPIB</a> class<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="wxGPIB-GetError"><strong>GetError</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-GetSTB"><strong>GetSTB</strong></a>(self)</dt><dd><tt>Returns the value of the internal GPIB status byte register.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-Ibrd"><strong>Ibrd</strong></a>(self, length)</dt><dd><tt># This is only for internal usage!!!</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-Ibwrt"><strong>Ibwrt</strong></a>(self, string)</dt><dd><tt># This is only for internal usage!!!</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-Open"><strong>Open</strong></a>(self, devname, adr)</dt><dd><tt><a href="#wxGPIB-Open">Open</a>(gpibdevice,address)<br>
|
||||
Opens a connected device at the GPIB bus. gpibdevice means the<br>
|
||||
controller, (mostly "gpib1"), address the address of the desired<br>
|
||||
device in the range 1...31. For example:<br>
|
||||
dev = <a href="#wxGPIB">wxGPIB</a>()<br>
|
||||
dev.<a href="#wxGPIB-Open">Open</a>("gpib1",17)<br>
|
||||
Opens the device with the address 17.<br>
|
||||
Open returns >= 0 or a negativ value, if something going wrong.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-Reset"><strong>Reset</strong></a>(self)</dt><dd><tt>Resets the connected device. In the GPIB definition, the device<br>
|
||||
should be reset to it's initial state, so you can restart a<br>
|
||||
formely lost communication.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-ResetBus"><strong>ResetBus</strong></a>(self)</dt><dd><tt>The command asserts the GPIB interface clear (IFC) line for<br>
|
||||
ast least 100us if the GPIB board is the system controller.<br>
|
||||
This initializes the GPIB and makes the interface CIC and<br>
|
||||
active controller with ATN asserted.<br>
|
||||
Note! The IFC signal resets only the GPIB interface functions<br>
|
||||
of the bus devices and not the internal device functions.<br>
|
||||
For a device reset you should use the <a href="#wxGPIB-Reset">Reset</a>() command above.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-__del__"><strong>__del__</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-__init__"><strong>__init__</strong></a>(self)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="ctb.html#wxIOBase">wxIOBase</a>:<br>
|
||||
<dl><dt><a name="wxGPIB-Close"><strong>Close</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-GetTimeout"><strong>GetTimeout</strong></a>(self)</dt><dd><tt>Returns the internal timeout value in milliseconds</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-Ioctl"><strong>Ioctl</strong></a>(self, cmd, arg)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-PutBack"><strong>PutBack</strong></a>(self, char)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-Read"><strong>Read</strong></a>(self, length)</dt><dd><tt>Try to read the given count of data (length) and returns the<br>
|
||||
successfully readed number of data. The function never blocks.<br>
|
||||
For example:<br>
|
||||
readed = dev.<a href="#wxGPIB-Read">Read</a>(100)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-ReadBinary"><strong>ReadBinary</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>)</dt><dd><tt>Special SCPI command. Read the next data coded as a SCPI<br>
|
||||
binary format.<br>
|
||||
A binary data transfer will be startet by '#'. The next byte<br>
|
||||
tells the count of bytes for the binary length header,<br>
|
||||
following by the length bytes. After these the data begins.<br>
|
||||
For example:<br>
|
||||
#500004xxxx<br>
|
||||
The header length covers 5 Byte, the length of the binary<br>
|
||||
data is 4 (x means the binary data bytes)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-ReadUntilEOS"><strong>ReadUntilEOS</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>, quota<font color="#909090">=0</font>)</dt><dd><tt><a href="#wxGPIB-ReadUntilEOS">ReadUntilEOS</a>(eosString="\n",timeout=1000)<br>
|
||||
Reads data until the given eos string was received (default is<br>
|
||||
the linefeed character (0x0a) or the internal timeout<br>
|
||||
(default 1000ms) was reached.<br>
|
||||
ReadUntilEOS returns the result as the following tuple:<br>
|
||||
['received string',state,readedBytes]<br>
|
||||
If a timeout occurred, state is 0, otherwise 1</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-Readv"><strong>Readv</strong></a>(self, length)</dt><dd><tt>Try to read the given count of data. Readv blocks until all data<br>
|
||||
was readed successfully or the internal timeout, set with the<br>
|
||||
class member function <a href="#wxGPIB-SetTimeout">SetTimeout</a>(timeout), was reached.<br>
|
||||
Returns the readed data.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-SetTimeout"><strong>SetTimeout</strong></a>(self, timeout)</dt><dd><tt>Set the internal timeout value in milliseconds for all blocked<br>
|
||||
operations like ReadUntilEOS, Readv and Writev.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-Write"><strong>Write</strong></a>(self, string)</dt><dd><tt>Writes the given string to the device and returns immediately.<br>
|
||||
Write returns the number of data bytes successfully written or a<br>
|
||||
negativ number if an error occured. For some circumstances, not<br>
|
||||
the complete string was written.<br>
|
||||
So you have to verify the return value to check this out.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxGPIB-Writev"><strong>Writev</strong></a>(self, string)</dt><dd><tt>Writes the given string to the device. The function blocks until<br>
|
||||
the complete string was written or the internal timeout, set with<br>
|
||||
<a href="#wxGPIB-SetTimeout">SetTimeout</a>(timeout), was reached.<br>
|
||||
Writev returns the number of data successfully written or a<br>
|
||||
negativ value, if an errors occurred.</tt></dd></dl>
|
||||
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="wxIOBase">class <strong>wxIOBase</strong></a></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="wxIOBase-Close"><strong>Close</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-GetTimeout"><strong>GetTimeout</strong></a>(self)</dt><dd><tt>Returns the internal timeout value in milliseconds</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-Ioctl"><strong>Ioctl</strong></a>(self, cmd, arg)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-Open"><strong>Open</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-PutBack"><strong>PutBack</strong></a>(self, char)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-Read"><strong>Read</strong></a>(self, length)</dt><dd><tt>Try to read the given count of data (length) and returns the<br>
|
||||
successfully readed number of data. The function never blocks.<br>
|
||||
For example:<br>
|
||||
readed = dev.<a href="#wxIOBase-Read">Read</a>(100)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-ReadBinary"><strong>ReadBinary</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>)</dt><dd><tt>Special SCPI command. Read the next data coded as a SCPI<br>
|
||||
binary format.<br>
|
||||
A binary data transfer will be startet by '#'. The next byte<br>
|
||||
tells the count of bytes for the binary length header,<br>
|
||||
following by the length bytes. After these the data begins.<br>
|
||||
For example:<br>
|
||||
#500004xxxx<br>
|
||||
The header length covers 5 Byte, the length of the binary<br>
|
||||
data is 4 (x means the binary data bytes)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-ReadUntilEOS"><strong>ReadUntilEOS</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>, quota<font color="#909090">=0</font>)</dt><dd><tt><a href="#wxIOBase-ReadUntilEOS">ReadUntilEOS</a>(eosString="\n",timeout=1000)<br>
|
||||
Reads data until the given eos string was received (default is<br>
|
||||
the linefeed character (0x0a) or the internal timeout<br>
|
||||
(default 1000ms) was reached.<br>
|
||||
ReadUntilEOS returns the result as the following tuple:<br>
|
||||
['received string',state,readedBytes]<br>
|
||||
If a timeout occurred, state is 0, otherwise 1</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-Readv"><strong>Readv</strong></a>(self, length)</dt><dd><tt>Try to read the given count of data. Readv blocks until all data<br>
|
||||
was readed successfully or the internal timeout, set with the<br>
|
||||
class member function <a href="#wxIOBase-SetTimeout">SetTimeout</a>(timeout), was reached.<br>
|
||||
Returns the readed data.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-ResetBus"><strong>ResetBus</strong></a>(self)</dt><dd><tt>If the underlaying interface needs some special reset operations<br>
|
||||
(for instance the GPIB distinguish between a normal device reset<br>
|
||||
and a special bus reset), you can put some code here)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-SetTimeout"><strong>SetTimeout</strong></a>(self, timeout)</dt><dd><tt>Set the internal timeout value in milliseconds for all blocked<br>
|
||||
operations like ReadUntilEOS, Readv and Writev.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-Write"><strong>Write</strong></a>(self, string)</dt><dd><tt>Writes the given string to the device and returns immediately.<br>
|
||||
Write returns the number of data bytes successfully written or a<br>
|
||||
negativ number if an error occured. For some circumstances, not<br>
|
||||
the complete string was written.<br>
|
||||
So you have to verify the return value to check this out.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-Writev"><strong>Writev</strong></a>(self, string)</dt><dd><tt>Writes the given string to the device. The function blocks until<br>
|
||||
the complete string was written or the internal timeout, set with<br>
|
||||
<a href="#wxIOBase-SetTimeout">SetTimeout</a>(timeout), was reached.<br>
|
||||
Writev returns the number of data successfully written or a<br>
|
||||
negativ value, if an errors occurred.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-__del__"><strong>__del__</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxIOBase-__init__"><strong>__init__</strong></a>(self)</dt></dl>
|
||||
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="wxSerialPort">class <strong>wxSerialPort</strong></a>(<a href="ctb.html#wxIOBase">wxIOBase</a>)</font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="wxSerialPort-ChangeLineState"><strong>ChangeLineState</strong></a>(self, lineState)</dt><dd><tt>Change (toggle) the state of each the lines given in the<br>
|
||||
linestate parameter. Possible values are wxSERIAL_LINESTATE_DTR<br>
|
||||
(means the DTR signal) and/or wxSERIAL_LINESTATE_RTS (RTS signal).<br>
|
||||
For example to toggle the RTS line only:<br>
|
||||
dev.<a href="#wxSerialPort-ChangeLineState">ChangeLineState</a>(wxSERIAL_LINESTATE_RTS)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-ClrLineState"><strong>ClrLineState</strong></a>(self, lineState)</dt><dd><tt>Clear the lines given in the linestate parameter. Possible<br>
|
||||
values are wxSERIAL_LINESTATE_DTR (means the DTR signal) and/or<br>
|
||||
wxSERIAL_LINESTATE_RTS (RTS signal). For example to clear only<br>
|
||||
the RTS line:<br>
|
||||
dev.<a href="#wxSerialPort-ClrLineState">ClrLineState</a>(wxSERIAL_LINESTATE_RTS)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-GetAvailableBytes"><strong>GetAvailableBytes</strong></a>(self)</dt><dd><tt>Returns the available bytes in the input queue of the serial<br>
|
||||
driver.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-GetCommErrors"><strong>GetCommErrors</strong></a>(self)</dt><dd><tt>Get the internal communication errors like breaks, framing,<br>
|
||||
parity or overrun errors.<br>
|
||||
Returns the count of each error as a tuple like this:<br>
|
||||
(b,f,o,p) = dev.<a href="#wxSerialPort-GetCommErrors">GetCommErrors</a>()<br>
|
||||
b: breaks, f: framing errors, o: overruns, p: parity errors</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-GetLineState"><strong>GetLineState</strong></a>(self)</dt><dd><tt>Returns the current linestates of the CTS, DCD, DSR and RING<br>
|
||||
signal line as an integer value with the appropriate bits or<br>
|
||||
-1 on error.<br>
|
||||
For example:<br>
|
||||
lines = dev.<a href="#wxSerialPort-GetLineState">GetLineState</a>()<br>
|
||||
if lines & wxSERIAL_LINESTATE_CTS:<br>
|
||||
print "CTS is on"</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-Open"><strong>Open</strong></a>(self, devname, baudrate, protocol<font color="#909090">='8N1'</font>, handshake<font color="#909090">='no_handshake'</font>)</dt><dd><tt>Open the device devname with the given baudrate, the protocol<br>
|
||||
like '8N1' (default) and the use of the handshake [no_handshake<br>
|
||||
(default), rtscts or xonxoff]<br>
|
||||
For example:<br>
|
||||
At Linux:<br>
|
||||
dev = <a href="#wxSerialPort">wxSerialPort</a>()<br>
|
||||
dev.<a href="#wxSerialPort-Open">Open</a>("/dev/ttyS0",115200)<br>
|
||||
or with a datalen of 7 bits, even parity, 2 stopbits and rts/cts<br>
|
||||
handshake:<br>
|
||||
dev.<a href="#wxSerialPort-Open">Open</a>("/dev/ttyS0",115200,'7E2',True)<br>
|
||||
At Windows:<br>
|
||||
dev = <a href="#wxSerialPort">wxSerialPort</a>()<br>
|
||||
dev.<a href="#wxSerialPort-Open">Open</a>("COM1",115200)<br>
|
||||
dev.<a href="#wxSerialPort-Open">Open</a>("COM1",115200,'7E2',True)<br>
|
||||
Returns the handle on success or a negativ value on failure.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-Reset"><strong>Reset</strong></a>(self)</dt><dd><tt>Send a break for 0.25s.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-SetBaudRate"><strong>SetBaudRate</strong></a>(self, baudrate)</dt><dd><tt>Set the baudrate for the device.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-SetLineState"><strong>SetLineState</strong></a>(self, lineState)</dt><dd><tt>Set the lines given in the linestate parameter. Possible<br>
|
||||
values are wxSERIAL_LINESTATE_DTR (means the DTR signal) and/or<br>
|
||||
wxSERIAL_LINESTATE_RTS (RTS signal). For example to set both:<br>
|
||||
dev.<a href="#wxSerialPort-SetLineState">SetLineState</a>(wxSERIAL_LINESTATE_DTR | wxSERIAL_LINESTATE_RTS)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-__del__"><strong>__del__</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-__init__"><strong>__init__</strong></a>(self)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="ctb.html#wxIOBase">wxIOBase</a>:<br>
|
||||
<dl><dt><a name="wxSerialPort-Close"><strong>Close</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-GetTimeout"><strong>GetTimeout</strong></a>(self)</dt><dd><tt>Returns the internal timeout value in milliseconds</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-Ioctl"><strong>Ioctl</strong></a>(self, cmd, arg)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-PutBack"><strong>PutBack</strong></a>(self, char)</dt></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-Read"><strong>Read</strong></a>(self, length)</dt><dd><tt>Try to read the given count of data (length) and returns the<br>
|
||||
successfully readed number of data. The function never blocks.<br>
|
||||
For example:<br>
|
||||
readed = dev.<a href="#wxSerialPort-Read">Read</a>(100)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-ReadBinary"><strong>ReadBinary</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>)</dt><dd><tt>Special SCPI command. Read the next data coded as a SCPI<br>
|
||||
binary format.<br>
|
||||
A binary data transfer will be startet by '#'. The next byte<br>
|
||||
tells the count of bytes for the binary length header,<br>
|
||||
following by the length bytes. After these the data begins.<br>
|
||||
For example:<br>
|
||||
#500004xxxx<br>
|
||||
The header length covers 5 Byte, the length of the binary<br>
|
||||
data is 4 (x means the binary data bytes)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-ReadUntilEOS"><strong>ReadUntilEOS</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>, quota<font color="#909090">=0</font>)</dt><dd><tt><a href="#wxSerialPort-ReadUntilEOS">ReadUntilEOS</a>(eosString="\n",timeout=1000)<br>
|
||||
Reads data until the given eos string was received (default is<br>
|
||||
the linefeed character (0x0a) or the internal timeout<br>
|
||||
(default 1000ms) was reached.<br>
|
||||
ReadUntilEOS returns the result as the following tuple:<br>
|
||||
['received string',state,readedBytes]<br>
|
||||
If a timeout occurred, state is 0, otherwise 1</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-Readv"><strong>Readv</strong></a>(self, length)</dt><dd><tt>Try to read the given count of data. Readv blocks until all data<br>
|
||||
was readed successfully or the internal timeout, set with the<br>
|
||||
class member function <a href="#wxSerialPort-SetTimeout">SetTimeout</a>(timeout), was reached.<br>
|
||||
Returns the readed data.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-ResetBus"><strong>ResetBus</strong></a>(self)</dt><dd><tt>If the underlaying interface needs some special reset operations<br>
|
||||
(for instance the GPIB distinguish between a normal device reset<br>
|
||||
and a special bus reset), you can put some code here)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-SetTimeout"><strong>SetTimeout</strong></a>(self, timeout)</dt><dd><tt>Set the internal timeout value in milliseconds for all blocked<br>
|
||||
operations like ReadUntilEOS, Readv and Writev.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-Write"><strong>Write</strong></a>(self, string)</dt><dd><tt>Writes the given string to the device and returns immediately.<br>
|
||||
Write returns the number of data bytes successfully written or a<br>
|
||||
negativ number if an error occured. For some circumstances, not<br>
|
||||
the complete string was written.<br>
|
||||
So you have to verify the return value to check this out.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="wxSerialPort-Writev"><strong>Writev</strong></a>(self, string)</dt><dd><tt>Writes the given string to the device. The function blocks until<br>
|
||||
the complete string was written or the internal timeout, set with<br>
|
||||
<a href="#wxSerialPort-SetTimeout">SetTimeout</a>(timeout), was reached.<br>
|
||||
Writev returns the number of data successfully written or a<br>
|
||||
negativ value, if an errors occurred.</tt></dd></dl>
|
||||
|
||||
</td></tr></table></td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#eeaa77">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl><dt><a name="-GetKey"><strong>GetKey</strong></a>()</dt><dd><tt>Returns the current pressed key or ' | ||||