Subversion Repositories factorylink.valmet

Rev

Rev 8 | Blame | Compare with Previous | Last modification | View Log | Download

/*
 ******************************************************************************
 *  Copyright 1996 DeltaLink bv. All Rights Reserved.
 ******************************************************************************
 *
 * Module Name : val_com.h
 *
 * Version/Rev : 1.00
 * Author/Date : Ed Smits
 * Description : Serial utility functions for protocol driver
 *
 *-----------------------------------------------------------------------------
 *
 *------------------------------  Revision Log  -------------------------------
 * Date     Time  Name    Function/Revision
 * -------- ----- ------- -----------------------------------------------------
 * 27-09-96 09:00 Marcel  First Start
 *
 *
 *-----------------------------------------------------------------------------
 */

#ifndef _VAL_SERIAL_DEFS_INCLUDED
#define _VAL_SERIAL_DEFS_INCLUDED 1

/*
 *-----------------------------------------------------------------------------
 *  Includes
 *-----------------------------------------------------------------------------
 */
#include <serial.h>


/*
 *-----------------------------------------------------------------------------
 *  Defines
 *-----------------------------------------------------------------------------
 */

#define SERIAL_INI_FILE        "imx_ser.txt"
#define PORT_XLATE             "PORT"

#ifdef NT
  #define PORT_NAME    "PORT_NT"
#endif

/* define default values */
#define BAUDRATE_DEFAULT       9600L
#define DATABITS_DEFAULT       8
#define PARITY_DEFAULT         SER_EVEN
#define STOPBITS_DEFAULT       SER_ONESTOPBIT
#define RTS_CTS_DEFAULT        0
#define DTR_DSR_DEFAULT        0
#define XON_DEFAULT            0x00
#define XOFF_DEFAULT           0x00
      

/* the usual control characters */
#define EOT   4
#define ACK   6
#define NAK   21
#define ENQ   5
#define SOH   1
#define STX   2
#define ETX   3

/*
 *-----------------------------------------------------------------------------
 *  Function prototypes
 *-----------------------------------------------------------------------------
 */

/*
 * function prototypes
 * val_ser.c
 */
int   Com_Ini_Load( TASK_ID *T);
int   Com_Build_Device( COMPORT **port, ushort id, uint rx_len, uint tx_len, char *tcp_addr, uint tcp_port);
char *Com_Format_Get_Item( char *buf, char *format);
int   Com_Get_Dev_Error( VAL_DEVICE * val_dev);
void  Com_Set_Dev_Error( VAL_DEVICE * val_dev, int error);
int   Com_Initialised( VAL_PHYS_DEV * phys_dev);
int   Com_Init( VAL_PHYS_DEV * phys_dev);
int   Com_Send(VAL_PHYS_DEV * phys_dev, int len, unsigned char * buf );
int   Com_Receive(VAL_PHYS_DEV * phys_dev, int bufsize, char * buf , int * received);
int   COM_TCP_disconnect( VAL_PHYS_DEV * phys_dev);
//void   Com_LogBuffer( unsigned char * str, unsigned char * buffer, int len);
//void   Com_LogConsole( unsigned char * str);
//#define Com_LogConsole1(s1, a1) { char msg[100]; sprintf(msg, s1,a1); Com_LogConsole(msg); }
//int     Serial_Ini_Load( TASK_ID *);
//int     Serial_Build_Device( COMPORT **, ushort, uint, uint);

#endif /* _VAL_SERIAL_DEFS_INCLUDED */