Skip to content
Snippets Groups Projects
Commit e87ea45a authored by Sebastien Leport's avatar Sebastien Leport
Browse files

add Makefile.linux

write_read() modified for compiling with linux
parent 89ee7ea5
Branches
Tags
No related merge requests found
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/CYBERSTAR/src/CYBERSTARx1000.cpp,v 1.6 2007-03-07 14:28:44 sebleport Exp $";
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/CYBERSTAR/src/CYBERSTARx1000.cpp,v 1.7 2007-03-19 13:22:59 sebleport Exp $";
//+=============================================================================
//
// file : CYBERSTARx1000.cpp
......@@ -13,9 +13,14 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
//
// $Author: sebleport $
//
// $Revision: 1.6 $
// $Revision: 1.7 $
//
// $Log: not supported by cvs2svn $
// Revision 1.6 2007/03/07 14:28:44 sebleport
// UNKNOWN device state deleted
// Reset commande deleted
// some device user's guide changes
//
// Revision 1.5 2006/04/27 09:24:51 sebleport
// - attributes are no more polled
// - add a breaktime in write_read function
......@@ -617,9 +622,13 @@ void CYBERSTARx1000::write_windowCenterPosition(Tango::WAttribute &attr)
{
DEBUG_STREAM << "write_read(): entering... cmd_to_send =" << cmd_to_send << endl;
#ifdef WIN32
Tango::DevString response="";
long nb_char_written;
try
{
// Construct a dedicated DevVarCharArray with validation char <LF>
Tango::DevVarCharArray *LF = new Tango::DevVarCharArray();
LF->length(1);
......@@ -634,9 +643,45 @@ void CYBERSTARx1000::write_windowCenterPosition(Tango::WAttribute &attr)
if(!init_CYBERSTARx1000_done)
init_CYBERSTARx1000();
//- init proxy done so :
//- send command
mySerial->command_inout("DevSerWriteString", cmd_to_send.c_str(),nb_char_written);
mySerial->command_inout("DevSerWriteChar",LF,nb_char_written);
//- response expected
if (read_required)
{
long readMode = 2; //- SL_LINE : waits for LF (newline set in device Serial)
mySerial->command_inout("DevSerReadString", readMode, response);
}
return string(response);
}//endtry
#endif
#ifdef __linux
response="";
long nb_char_written;
try
{
// Construct a dedicated DevVarCharArray with validation char <LF>
Tango::DevVarCharArray *LF = new Tango::DevVarCharArray();
LF->length(1);
(*LF)[0] = 10;
// create a serialline device proxy if it don't exist
if(!mySerial)
init_proxy_Serialline();
//DEBUG_STREAM << "write_read(): entering... init_CYBERSTARx1000() " << endl;
if(!init_CYBERSTARx1000_done)
init_CYBERSTARx1000();
//- send command
mySerial->command_inout("DevSerWriteString", cmd_to_send.c_str(),nb_char_written);
......@@ -649,10 +694,12 @@ void CYBERSTARx1000::write_windowCenterPosition(Tango::WAttribute &attr)
mySerial->command_inout("DevSerReadString", readMode, response);
}
return string(response);
return response;
}//endtry
#endif
catch(Tango::DevFailed &df)
{
ERROR_STREAM << df << std::endl;
......
......@@ -8,9 +8,14 @@
//
// $Author: sebleport $
//
// $Revision: 1.5 $
// $Revision: 1.6 $
//
// $Log: not supported by cvs2svn $
// Revision 1.5 2007/03/07 14:28:44 sebleport
// UNKNOWN device state deleted
// Reset commande deleted
// some device user's guide changes
//
// Revision 1.4 2006/04/27 09:27:37 sebleport
// - attributes are no more polled
// - add a breaktime in write_read function
......@@ -38,7 +43,7 @@
#include <tango.h>
#include "PogoHelper.h"
#include "XString.h"
#include "Xstring.h"
#include <math.h>
#include "DeviceProxyHelper.h"
......@@ -46,7 +51,7 @@
/**
* @author $Author: sebleport $
* @version $Revision: 1.5 $
* @version $Revision: 1.6 $
*/
// Add your own constants definitions here.
......
#=============================================================================
#
# file : Makefile.h
#
# description : Makefile for DeviceServer
#
# $Author: hardion $
#
# $Revision: 1.3 $
#
# $Log: Makefile.linux,v $
# Revision 1.3 2006/03/14 14:57:34 hardion
# * Update Makefile process to allow compilation of library
#
# Revision 1.2 2006/01/05 16:51:30 hardion
# * Update Makefile.linux and tango.opt for library use
#
#
#=============================================================================
#=============================================================================
# OUTPUT_TYPE can be one of the following :
# - 'STATIC_LIB' for a static library (.a)
# - 'DYNAMIC_LIB' for a dynamic library (.so)
# - 'DEVICE' for a device server (will automatically include and link
# with Tango dependencies)
# - 'SIMPLE_EXE' for an executable with no dependency (for exemple the test tool
# of a library with no Tango dependencies)
#
OUTPUT_TYPE = DEVICE
#=============================================================================
# PACKAGE_NAME is the name of the library/device/exe you want to build
# - for a device server, PACKAGE_NAME will be prefixed by 'ds_'
# - for a library (static or dynamic), PACKAGE_NAME will be prefixed by 'lib'
# - for a simple executable, PACKAGE_NAME will be the name of the executable
#
PACKAGE_NAME = CYBERSTARx1000
#=============================================================================
# INC_DIR_USER is the list of all include path needed by your sources
# - for a device server, tango dependencies are automatically appended
# - '-I ../include' and '-I .' are automatically appended in all cases
#
#=============================================================================
# LIB_DIR_USER is the list of user library directories
# - for a device server, tango libraries directories are automatically appended
# - '-L ../lib' is automatically appended in all cases
#
#=============================================================================
# LFLAGS_USR is the list of user link flags
# - for a device server, tango libraries directories are automatically appended
# - '-ldl -lpthread' is automatically appended in all cases
#
# !!! ATTENTION !!!
# Be aware that the order matters.
# For example if you must link with libA, and if libA depends itself on libB
# you must use '-lA -lB' in this order as link flags, otherwise you will get
# 'undefined reference' errors
#
#=============================================================================
# CXXFLAGS_USR lists the compilation flags specific for your library/device/exe
# This is the place where to put your compile-time macros using '-Dmy_macro'
#
#
# include Standard TANGO compilation options
#
include $(SOLEIL_ROOT)/env/tango.opt
#=============================================================================
# SVC_OBJS is the list of all objects needed to make the output
#
SVC_OBJS = $(OBJDIR)/ClassFactory.o \
$(OBJDIR)/main.o \
$(OBJDIR)/$(PACKAGE_NAME)Class.o \
$(OBJDIR)/$(PACKAGE_NAME).o \
$(OBJDIR)/$(PACKAGE_NAME)StateMachine.o
#
# Verbose mode
#
#.SILENT:
#
# include common targets
#
include $(SOLEIL_ROOT)/env/common_target.opt
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment