Commit 66d70e76 authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

examples

parent c31bad81
Loading
Loading
Loading
Loading

examples/ChangeLog

0 → 100644
+22 −0
Original line number Diff line number Diff line
5 April 2005
TAG CVS: PACKETLIB_1_3_4
+ added the possibility to have an even number of byte in the definition of a block
+ addedd the Packet::printPacketOutputStream()
+ correction of the [SourceDataFieldBlock] not found keyword into the SDFBlockFixed
+ correction of the calculation of the dimension with tail

22 March 2005
TAG CVS: PACKETLIB_1_3_4_BETA2
PacketLib 1.3.4 beta 2
+ correct the bug for the setFieldValue4_13 and 3_13 
+ added the exception generation when for the 24 bit field value there are an out of range:
#define U24BITINTGEGERUNSIGNED_MAX 16777215
#define U24BITINTGEGERSIGNED_MIN -8388607
#define U24BITINTGEGERSIGNED_MAX 8388607

9 March 2005 (1.3.4 beta)
+ modified the management of the fields (class PartOfPacket). Now a field should be divided between two words

2 March 2005 (1.3.3)
+ bug of the InputFile::isEOF()
+ added PTC/PFC 4/13 3/14 3/13 

examples/Makefile

0 → 100644
+160 −0
Original line number Diff line number Diff line
#############################################################################
# Makefile for install: PacketLib
# Project:  PacketLib
# Use make variable_name=' options ' to override the variables or make -e to
# override the file variables with the environment variables
# 		make CFLAGS='-g' or make prefix='/usr'
#############################################################################

SHELL = /bin/sh

####### 1) Project names and system

#SYSTEM: linux or QNX
SYSTEM = linux
PROJECT=PacketLib

####### 2) Directories for the installation

# Prefix for each installed program. Only ABSOLUTE PATH
prefix=/usr/local
exec_prefix=$(prefix)
# The directory to install the binary files in.
bindir=$(exec_prefix)/bin
# The directory to install the local configuration file.
datadir=$(exec_prefix)/share
# The directory to install the libraries in.
libdir=$(exec_prefix)/lib
# The directory to install the info files in.
infodir=$(exec_prefix)/info
# The directory to install the include files in.
includedir=$(exec_prefix)/include

####### 3) Directories for the compiler

OBJECTS_DIR = obj
SOURCE_DIR = examples
LIB_DESTDIR = lib
INCLUDE_DIR = include
LIB_NAME = libpacket
VER_FILE_NAME = PlVersion.h

####### 4) Compiler, tools and options

CC       = gcc
CXX      = g++
#Insert the optional parameter to the compiler. The CFLAGS could be changed externally by the user
#- g3
CFLAGS   = -O2 -O0 
#-O2 -O0 -g3
#Set INCPATH to add the inclusion paths
INCPATH = -I $(includedir)
#Insert the implicit parameter to the compiler:
ALL_CFLAGS = -fexceptions -Wall $(INCPATH) $(CFLAGS)
ifeq ($(SYSTEM), QNX)
	ALL_CFLAGS += -Vgcc_ntox86_gpp -lang-c++
endif
#Use CPPFLAGS for the preprocessor
CPPFLAGS = 
#Set LIBS for addition library
LIBS = -lstdc++ -lpacket
ifeq ($(SYSTEM), QNX)
	LIBS += -lsocket
endif
LINK     = g++
#for link
LFLAGS = -shared -Wl,-soname,$(TARGET1) -Wl,-rpath,$(DESTDIR)
AR       = ar cqs
TAR      = tar -cf
GZIP     = gzip -9f
COPY     = cp -f
COPY_FILE= $(COPY) -p
COPY_DIR = $(COPY) -pR
DEL_FILE = rm -f
SYMLINK  = ln -sf
DEL_DIR  = rm -rf
MOVE     = mv -f
CHK_DIR_EXISTS= test -d
MKDIR    = mkdir -p

####### 5) VPATH

VPATH=$(SOURCE_DIR):$(INCLUDE_DIR):
vpath %.o $(OBJECTS_DIR)

####### 6) Files of the project
	
INCLUDE=$(foreach dir,$(INCLUDE_DIR), $(wildcard $(dir)/*.h))
OBJECTS = in.o msgqclient.o msgqserver.o out.o

####### 7) Only for library generation

TARGET   = $(LIB_NAME).so.$(shell cat version)
TARGETA	= $(LIB_NAME).a
TARGETD	= $(LIB_NAME).so.$(shell cat version)
TARGET0	= $(LIB_NAME).so
TARGET1	= $(LIB_NAME).so.$(shell cut version -f 1 -d '.')
TARGET2	= $(LIB_NAME).so.$(shell cut version -f 1 -d '.').$(shell cut version -f 2 -d '.')

####### 8) Preliminar operations

$(shell  cut $(INCLUDE_DIR)/$(VER_FILE_NAME) -f 3 > version)
#WARNING: use -d ' ' if in the version.h the separator is a space

####### 9) Pattern rules

%.o : %.cpp
	$(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c $< -o $(OBJECTS_DIR)/$@
	
####### 10) Build rules

all: makeobjdir  $(OBJECTS)	
		$(CC) $(CPPFLAGS) $(ALL_CFLAGS) -o $(SOURCE_DIR)/in $(OBJECTS_DIR)/in.o $(LIBS)
		$(CC) $(CPPFLAGS) $(ALL_CFLAGS) -o $(SOURCE_DIR)/out $(OBJECTS_DIR)/out.o $(LIBS)
		$(CC) $(CPPFLAGS) $(ALL_CFLAGS) -o $(SOURCE_DIR)/msgqclient $(OBJECTS_DIR)/msgqclient.o $(LIBS)
		$(CC) $(CPPFLAGS) $(ALL_CFLAGS) -o $(SOURCE_DIR)/msgqserver $(OBJECTS_DIR)/msgqserver.o $(LIBS)
				
makeobjdir:
	test -d $(OBJECTS_DIR) || mkdir -p $(OBJECTS_DIR)
	
#clean: delete all files from the current directory that are normally created by building the program. 
clean:
	$(DEL_FILE) $(OBJECTS_DIR)/*.o
	$(DEL_FILE) *~ core *.core
	$(DEL_FILE) version
	$(DEL_FILE) prefix	
	$(DEL_FILE) $(SOURCE_DIR)/msgqserver
	$(DEL_FILE) $(SOURCE_DIR)/msgqclient
	$(DEL_FILE) $(SOURCE_DIR)/in
	$(DEL_FILE) $(SOURCE_DIR)/out
	test $(OBJECTS_DIR) = . || $(DEL_DIR) $(OBJECTS_DIR)

	
#Delete all files from the current directory that are created by configuring or building the program. 
distclean: clean

#install: compile the program and copy the executables, libraries, 
#and so on to the file names where they should reside for actual use. 
install: 
	$(shell echo $(prefix) > prefix)

	# For library installation
	$(COPY_FILE) $(LIB_DESTDIR)/$(TARGETA) $(libdir)
	$(COPY_FILE) $(LIB_DESTDIR)/$(TARGET0) $(libdir)
	$(COPY_FILE) $(LIB_DESTDIR)/$(TARGET1) $(libdir)
	$(COPY_FILE) $(LIB_DESTDIR)/$(TARGET2) $(libdir)
	$(COPY_FILE) $(LIB_DESTDIR)/$(TARGETD) $(libdir)
	test -d $(includedir) || mkdir -p $(includedir)	
	$(COPY_FILE) $(LIB_DESTDIR)/* $(libdir)
	$(COPY_FILE) $(INCLUDE) $(includedir)

#uninstall: delete all the installed files--the copies that the `install' target creates.
uninstall:
	#For library uninstall
	$(DEL_FILE) $(libdir)/$(TARGETA)
	$(DEL_FILE) $(libdir)/$(TARGETD)
	$(DEL_FILE) $(libdir)/$(TARGET0)
	$(DEL_FILE) $(libdir)/$(TARGET1)
	$(DEL_FILE) $(libdir)/$(TARGET2)
	$(DEL_FILE) $(addprefix $(includedir)/, $(notdir $(INCLUDE)))

examples/README

0 → 100644
+42 −0
Original line number Diff line number Diff line
DISTRIBUTION
The directory of this distribution of PacketLib are:
- doc: containing the documentation of the PacketLib (Reference Manual, Interface Control Document and Programmer's Guide)
- examples: some examples and some PacketLib configuration files, used in the Interface Control Document and in the Programmer's Guide.
- include: the include files of the library.
- lib: static and dynamic binary library
- model: a Rational Rose file with the UML model of the library
- ref/html the doxygen documentation of the library (same content of the Reference Manual)

HOW TO INSTALL PACKETLIB
To install PacketLib:

make install

and the include and lib files will be copied in the /usr/local/include and /usr/local/lib (need root permission).
If you want to change the installation path use 

make prefix='newpath' install

but it is necessary to add newpath in the LD_LIBRARY_PATH environment variable anche change the include path of the Makefile (-I option of the compiler).

UNINSTALL THE PACKETLIB
To uninstall the PacketLib

make uninstall

or 

make prefix='installation_path' uninstall

EXAMPLES
Use 

make 

to build the examples in the examples directory.

make clean 

if you want to clean the file built.

The description of the examples are present in the Programmer's Guide, in the section of the examples.
 No newline at end of file
+241 −0
Original line number Diff line number Diff line
-- name of packet
39.01
[PacketHeader]
-- file in cui e' presente la descrizione dell'header
headerESATM.header
[DataFieldHeader]
-- field 0
Sync Marker MSB
16
65499
-- field 1
Sync Marker LSB
16
37461
-- field 2
CRC flag
2
0b11
-- field 3
Packet Type
6
none
-- field 4
Packet Subtype
8
1
-- field 5
MM Page ID
16
none
--field 6
MM Packet Counter
16
none
--field 7
Century
8
32
--field 8
APID Sequence Counter
8
nome
--field 9
OBT12
8
none
--field 10
OBT13
8
none
--field 11
OBT14
8
none
--field 12
OBT15
8
none
--field 13
OBT16
8
none
--field 14
Not used
4
0
--field 15
OBT17
4
none
--field 16
OBT18
8
none
--field 17
OBT19
8
none
--field 18
Mode
8
none
--field 19
Pkt. Struct ID
4
1
-- field 20
Redundancy ID
4
1
[SourceDataField]
-- type of packet: noblock, block, rblock (with recoursive block)
rblock
[RBlock Configuration]
-- fixed part present (yes | no)
yes
-- variable part present (yes | no). If yes, add [RBlockX] sections.
yes
--number of rblock (if variable part is present)
1
[Fixed Part]
--field 0 - SOURCE DATA FIELD HEADER ----------------------------------------
Quaternion 1H
16
none
--field 1: parte bassa del float
Quaternion 1L
16
none
--field 2: parte alta del float
Quaternion 2H
16
none
--field 3: parte bassa del float
Quaternion 2L
16
none
--field 4: parte alta del float
Quaternion 3H
16
none
--field 5: parte bassa del float
Quaternion 3L
16
none
--field 6: parte alta del float
Quaternion 4H
16
none
--field 7: parte bassa del float
Quaternion 4L
16
none
--field 8: parte alta
GPS Position XH
16
none
--field 9: parte bassa
GPS Position XL
16
none
--field 10: parte alta
GPS Position YH
16
none
--field 11: parte bassa
GPS Position YL
16
none
--field 12: parte alta
GPS Position ZH
16
none
--field 13: parte bassa
GPS Position ZL
16
none
--field 14
Spare OCID
4
0
--field 15
Orbital phase
2
none
--field 16
Recovery sub-phase
1
none
--field 17
Grid configuration mode
4
none
--field 18
LUT 3/4 X
3
none
--field 19
LUT 3/4 Z: H
2
none
--field 20
LUT 3/4 Z: L
1
none
--field 21
LUT AC
3
none
--field 22
LUT R-TRIGGER
3
none
--field 23
LUT DIS
3
none
--field 24
LUT COEF
3
none
--field 25
LUT C-DIS
3
none
--field 26 (Number of grid events 1<=n<=73)
Number of Events
16
none
[RBlock1]
--type of number of blocks of this variable part: fixed = number of block fixed equals to max number of block (fixed | variable)
variable
--number of blocks for fixed value into variable part, max number of blocks for variable value into variable part (73)
73
-- for variable block, number of level of headers in which is present the field with the number of blocks of the variable part (0: fixed part)
0
-- for variable block, index of field of the header which rappresent the number of events (the number of blocks) of the packet
26
-- for variable block, valore da sommare per ottenere il numero di eventi (blocchi) reali
0
rblock_type_E.rblock
[Identifiers]
-- ID0 APID
-- field number
3
-- type (0 header, 1 data field)
0
-- value
767
-- ID1 type
3
1
39
-- ID2 subtype
4
1
1
[Tail]
CRC
16
none
+125 −0
Original line number Diff line number Diff line
-- name of packet
BURST events (LAYOUT 3)
[PacketHeader]
-- file in cui e' presente la descrizione dell'header
headerESATM.header
[DataFieldHeader]
-- field 0
Spare
6
none
-- field 1
Checksum flag
2
none
-- field 2
Packet Type
4
none
-- field 3
Packet subtype
4
none
-- field 4
Time Tag second (MSB)
16
none
-- field 5
Time Tag second (LSB)
16
none
-- field 6
Time Tag millisecond
16
none
-- field 7
Spare
12
none
-- field 8
Nevents
4
none
[SourceDataField]
block
variable
--type of number of block: fixed = number of block fixed equals to max number of block (fixed | variable)
variable
--supposed number (or max number) of block
79
--index of field in the [DataFieldHeader] section wich rappresent the number of event (the number of block) of the packet
8
-- offset to be added to the value given by the field m of the Data Field Header in order to obtain the correct value of the number of blocks 
0
[SourceDataFieldBlockFixed]
-- number (or max number) of element
32
-- index of field in the [SourceDataFieldBlockFixed] section wich rappresent the number of element (the number of bar) of the block
2
-- valore da sommare per ottenere il numero di element reali
1
-- field 0
1
1
none
-- field 1
spare
10
none
-- field 2
Number of bars - 1
5
none
-- field 3
TE Internal Counter (MSB)
16
none
-- field 4
TE Internal Counter (LSB)
16
none
[SourceDataFieldBlockVariable]
-- field 0
0
1
0
-- field 1
0
1
0
-- field 2
Bar ID (2 MSB)
2
none
-- field 3
PDA PHA (12 bits)
12
none
-- field 4
0
1
0
-- field 5
Bar ID (3 LSB)
3
none
-- field 6
PDB PHA (12 bits)
12
none
[Identifiers]
-- id0 APID
-- field number
3
-- type (0 header, 1 data field)
0
-- value
1294
--id1 type
2
1
15
--id2 subtype
3
1
3
Loading