Commit 52e539f6 authored by Maxime Perrotin's avatar Maxime Perrotin
parents 296b10d4 ac3b8492
......@@ -84,15 +84,15 @@ typedef struct {
void __po_hi_c_mil_1553_conf_t_devname_Initialize(__po_hi_c_mil_1553_conf_t_devname val);
void __po_hi_c_mil_1553_conf_t_Initialize(__po_hi_c_mil_1553_conf_t* pVal);
#define ERR_MIL_1553_CONF_T 101 /**/
#define ERR_MIL_1553_CONF_T 105 /**/
#define ERR_MIL_1553_CONF_T_DEVNAME 29 /**/
#define ERR_MIL_1553_CONF_T_STANDARD 36 /**/
#define ERR_MIL_1553_CONF_T_MODE 47 /**/
#define ERR_MIL_1553_CONF_T_BUS 58 /**/
#define ERR_MIL_1553_CONF_T_TERMADDR 69 /**/
#define ERR_MIL_1553_CONF_T_BROADCAST 80 /**/
#define ERR_MIL_1553_CONF_T_RXBLOCK 87 /**/
#define ERR_MIL_1553_CONF_T_TXBLOCK 94 /**/
#define ERR_MIL_1553_CONF_T_STANDARD_2 43 /**/
#define ERR_MIL_1553_CONF_T_MODE_2 55 /**/
#define ERR_MIL_1553_CONF_T_BUS_2 67 /**/
#define ERR_MIL_1553_CONF_T_TERMADDR_2 79 /**/
#define ERR_MIL_1553_CONF_T_BROADCAST 84 /**/
#define ERR_MIL_1553_CONF_T_RXBLOCK 91 /**/
#define ERR_MIL_1553_CONF_T_TXBLOCK 98 /**/
flag __po_hi_c_mil_1553_conf_t_IsConstraintValid(const __po_hi_c_mil_1553_conf_t* pVal, int* pErrCode);
......
......@@ -3,19 +3,32 @@
#include <stddef.h>
#if (!defined(_MSC_VER) || _MSC_VER >= 1800)
# ifndef SWIG
# include <stdbool.h>
# endif
#else
typedef unsigned char bool;
#define true 1
#define false 0
#endif
#ifdef __cplusplus
extern "C" {
#endif
# include <cstdint>
# include <cinttypes>
/* C99 check */
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || _MSC_VER >= 1900
# include <stdbool.h>
# include <stdint.h>
# include <inttypes.h>
#else /* No C++ nor C99 */
# ifndef _MSC_VER
typedef unsigned char bool;
# define true 1u
# define false 0u
# endif /* _MSC_VER */
typedef unsigned char uint8_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
#endif /* C++/C99 */
#ifndef NULL
#define NULL 0
......@@ -37,29 +50,51 @@ extern "C" {
#define FP_WORD_SIZE 8
#endif
#ifndef PRId32
#define PRId32 "d"
#endif
#ifndef PRId64
#define PRId64 "lld"
#endif
#ifndef PRIu32
#define PRIu32 "u"
#endif
#ifndef PRIu64
#define PRIu64 "llu"
#endif
#define OBJECT_IDENTIFIER_MAX_LENGTH 20
typedef float asn1Real32;
typedef double asn1Real64;
typedef uint8_t byte;
typedef int32_t asn1SccSint32;
typedef uint32_t asn1SccUint32;
typedef unsigned char byte;
typedef int asn1SccSint32;
typedef unsigned int asn1SccUint32;
typedef long long asn1SccSint64;
typedef unsigned long long asn1SccUint64;
typedef int64_t asn1SccSint64;
typedef uint64_t asn1SccUint64;
#if WORD_SIZE==8
typedef asn1SccUint64 asn1SccUint;
typedef asn1SccSint64 asn1SccSint;
#define ASN1SCC_PRId PRId64
#define ASN1SCC_PRIu PRIu64
#else
typedef asn1SccUint32 asn1SccUint;
typedef asn1SccSint32 asn1SccSint;
#define ASN1SCC_PRId PRId32
#define ASN1SCC_PRIu PRIu32
#endif
asn1SccUint int2uint(asn1SccSint v);
asn1SccSint uint2int(asn1SccUint v, int uintSizeInBytes);
#if FP_WORD_SIZE==8
typedef asn1Real64 asn1Real;
#else
......@@ -80,14 +115,29 @@ typedef bool flag;
typedef char NullType;
typedef struct {
struct BitStream_t;
//typedef void(*PushDataFnc)(struct BitStream_t* pThis, void* pushDataPrm);
//typedef void(*FetchDataFnc)(struct BitStream_t* pThis, void* fetchDataPrm);
typedef struct BitStream_t {
byte* buf;
long count;
long currentByte;
/* Next available bit for writting. Possible vallues 0..7, 0 is most significant bit of current byte*/
/* Next available bit for writting.
Possible vallues 0..7, 0 is most significant
bit of current byte*/
int currentBit;
//PushDataFnc pushData;
void* pushDataPrm;
//FetchDataFnc fetchData;
void* fetchDataPrm;
} BitStream;
typedef struct {
byte* buf;
long count;
......@@ -123,30 +173,78 @@ typedef struct {
#define ERR_INVALID_BER_FILE 201
#define ERR_BER_LENGTH_MISMATCH 202
int GetCharIndex(char ch, byte allowedCharSet[], int setLen);
flag OctetString_equal(int len1, int len2, const byte arr1[], const byte arr2[]);
flag BitString_equal(int nBitsLength1, int nBitsLength2, const byte arr1[], const byte arr2[]);
void ObjectIdentifier_Init(Asn1ObjectIdentifier *pVal);
flag ObjectIdentifier_equal(const Asn1ObjectIdentifier *pVal1, const Asn1ObjectIdentifier *pVal2);
flag ObjectIdentifier_isValid(const Asn1ObjectIdentifier *pVal);
flag RelativeOID_isValid(const Asn1ObjectIdentifier *pVal);
/* Time Classes
Asn1LocalTime, // TIME-OF-DAY ::= TIME(SETTINGS "Basic=Time Time=HMS Local-or-UTC=L")
Asn1UtcTime, // TIME(SETTINGS "Basic=Time Time=HMS Local-or-UTC=Z")
Asn1LocalTimeWithTimeZone, // TIME(SETTINGS "Basic=Time Time=HMS Local-or-UTC=LD")
Asn1Date, // DATE ::= TIME(SETTINGS "Basic=Date Date=YMD Year=Basic")
Asn1Date_LocalTime, // DATE-TIME ::= TIME(SETTINGS "Basic=Date-Time Date=YMD Year=Basic Time=HMS Local-or-UTC=L")
Asn1Date_UtcTime, // TIME(SETTINGS "Basic=Date-Time Date=YMD Year=Basic Time=HMS Local-or-UTC=Z")
Asn1Date_LocalTimeWithTimeZone // TIME(SETTINGS "Basic=Date-Time Date=YMD Year=Basic Time=HMS Local-or-UTC=LD")
*/
typedef struct {
int sign; //-1 or +1
int hours;
int mins;
} Asn1TimeZone;
int GetCharIndex(char ch, byte allowedCharSet[], int setLen);
typedef struct {
int hours;
int mins;
int secs;
int fraction;
Asn1TimeZone tz;
} Asn1TimeWithTimeZone;
typedef struct {
int hours;
int mins;
int secs;
int fraction;
} Asn1UtcTime;
typedef struct {
int hours;
int mins;
int secs;
int fraction;
} Asn1LocalTime;
typedef asn1SccUint BerTag;
typedef struct {
int years;
int months;
int days;
} Asn1Date;
typedef struct {
Asn1Date date;
Asn1LocalTime time;
} Asn1DateLocalTime;
typedef struct {
Asn1Date date;
Asn1UtcTime time;
} Asn1DateUtcTime;
typedef struct {
Asn1Date date;
Asn1TimeWithTimeZone time;
} Asn1DateTimeWithTimeZone;
typedef enum {
Asn1TC_LocalTimeStamp,
Asn1TC_UtcTimeStamp,
Asn1TC_LocalTimeTZStamp
} Asn1TimeZoneClass;
typedef asn1SccUint BerTag;
#if WORD_SIZE==8
extern const asn1SccUint64 ber_aux[];
......@@ -154,9 +252,6 @@ extern const asn1SccUint64 ber_aux[];
extern const asn1SccUint32 ber_aux[];
#endif
#define CHECK_BIT_STREAM(pBitStrm) assert((pBitStrm)->currentByte*8+(pBitStrm)->currentBit<=(pBitStrm)->count*8)
#ifdef _MSC_VER
......
......@@ -65,15 +65,15 @@ void __po_hi_c_ip_conf_t_gateway_Initialize(__po_hi_c_ip_conf_t_gateway val);
void __po_hi_c_ip_conf_t_dns_Initialize(__po_hi_c_ip_conf_t_dns val);
void __po_hi_c_ip_conf_t_Initialize(__po_hi_c_ip_conf_t* pVal);
#define ERR_IP_CONF_T 79 /**/
#define ERR_IP_CONF_T 81 /**/
#define ERR_IP_CONF_T_DEVNAME 15 /**/
#define ERR_IP_CONF_T_ADDRESS 22 /**/
#define ERR_IP_CONF_T_BROADCAST 29 /**/
#define ERR_IP_CONF_T_NETMASK 36 /**/
#define ERR_IP_CONF_T_GATEWAY 43 /**/
#define ERR_IP_CONF_T_DNS 50 /**/
#define ERR_IP_CONF_T_VERSION 57 /**/
#define ERR_IP_CONF_T_PORT 68 /**/
#define ERR_IP_CONF_T_VERSION_2 64 /**/
#define ERR_IP_CONF_T_PORT_2 76 /**/
flag __po_hi_c_ip_conf_t_IsConstraintValid(const __po_hi_c_ip_conf_t* pVal, int* pErrCode);
extern const __po_hi_c_ip_conf_t localhost1;
......
......@@ -73,13 +73,13 @@ void __po_hi_c_serial_conf_t_bits_Initialize(__po_hi_c_serial_conf_t_bits* pVal)
void __po_hi_c_serial_conf_t_sending_wait_Initialize(__po_hi_c_serial_conf_t_sending_wait* pVal);
void __po_hi_c_serial_conf_t_Initialize(__po_hi_c_serial_conf_t* pVal);
#define ERR_SERIAL_CONF_T 65 /**/
#define ERR_SERIAL_CONF_T 67 /**/
#define ERR_SERIAL_CONF_T_DEVNAME 15 /**/
#define ERR_SERIAL_CONF_T_SPEED 22 /**/
#define ERR_SERIAL_CONF_T_PARITY 33 /**/
#define ERR_SERIAL_CONF_T_BITS 44 /**/
#define ERR_SERIAL_CONF_T_SENDING_WAIT 51 /**/
#define ERR_SERIAL_CONF_T_USE_PARITYBIT 58 /**/
#define ERR_SERIAL_CONF_T_SPEED_2 29 /**/
#define ERR_SERIAL_CONF_T_PARITY_2 41 /**/
#define ERR_SERIAL_CONF_T_BITS 46 /**/
#define ERR_SERIAL_CONF_T_SENDING_WAIT 53 /**/
#define ERR_SERIAL_CONF_T_USE_PARITYBIT 60 /**/
flag __po_hi_c_serial_conf_t_IsConstraintValid(const __po_hi_c_serial_conf_t* pVal, int* pErrCode);
extern const __po_hi_c_serial_conf_t linux_ttyS0;
......
......@@ -57,15 +57,15 @@ typedef struct {
void __po_hi_c_spacewire_conf_t_devname_Initialize(__po_hi_c_spacewire_conf_t_devname val);
void __po_hi_c_spacewire_conf_t_Initialize(__po_hi_c_spacewire_conf_t* pVal);
#define ERR_SPACEWIRE_CONF_T 90 /**/
#define ERR_SPACEWIRE_CONF_T 93 /**/
#define ERR_SPACEWIRE_CONF_T_DEVNAME 22 /**/
#define ERR_SPACEWIRE_CONF_T_NODEADDR 29 /**/
#define ERR_SPACEWIRE_CONF_T_COREFREQ 40 /**/
#define ERR_SPACEWIRE_CONF_T_CLOCKDIV 51 /**/
#define ERR_SPACEWIRE_CONF_T_USE_ROUTER 62 /**/
#define ERR_SPACEWIRE_CONF_T_REMOVE_PROT_ID 69 /**/
#define ERR_SPACEWIRE_CONF_T_RXBLOCK 76 /**/
#define ERR_SPACEWIRE_CONF_T_TXBLOCK 83 /**/
#define ERR_SPACEWIRE_CONF_T_NODEADDR_2 36 /**/
#define ERR_SPACEWIRE_CONF_T_COREFREQ_2 48 /**/
#define ERR_SPACEWIRE_CONF_T_CLOCKDIV_2 60 /**/
#define ERR_SPACEWIRE_CONF_T_USE_ROUTER 65 /**/
#define ERR_SPACEWIRE_CONF_T_REMOVE_PROT_ID 72 /**/
#define ERR_SPACEWIRE_CONF_T_RXBLOCK 79 /**/
#define ERR_SPACEWIRE_CONF_T_TXBLOCK 86 /**/
flag __po_hi_c_spacewire_conf_t_IsConstraintValid(const __po_hi_c_spacewire_conf_t* pVal, int* pErrCode);
extern const __po_hi_c_spacewire_conf_t leon_rasta_spw_sender;
......
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2018 ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2020 ESA & ISAE.
*/
#ifndef __PO_HI_COMMON_H__
......
......@@ -6,19 +6,16 @@
## This file has been built for a generic RTEMS integration
MANAGERS = sem rtmon msg timer io
LIBS = #-lrtemsall -lc
RTEMS_USES_NEWLIB = no
MANAGERS = all
LIBS = -lrtemsall -lc
# PolyORB-HI/C specific flags
POHI_CFLAGS = -DRTEMS_POSIX -DLEON_RTEMS $(GCC_GENERIC_FLAGS)
# PolyORb-HI/C specific flags
POHI_CFLAGS = -DRTEMS_POSIX -DLEON_RTEMS $(GCC_GENERIC_FLAGS) -Wl,--wrap=printf -Wl,--wrap=puts -Wl,--wrap=putchar
# RTEMS/AIR specific flags
POHI_CFLAGS += -DAIR_HYPERVISOR -I$(AIR_ROOT)/pmk/core/include \
-I$(AIR_ROOT)/pmk/arch/sparc/include \
-I$(AIR_ROOT)/install/libs/imaspex/include/ -I./ -B./ -I../common/ \
-B../common/ -DRTEMS5 -B$(AIR_LIBS)/imaspex/ -B$(AIR_LIBS)/libprintf/ \
-B$(AIR_LIBS)/libair/
POHI_CFLAGS += -DAIR_HYPERVISOR -I$(AIR_ROOT)/pmk/core/include \
-I$(AIR_ROOT)/pmk/arch/sparc/include \
-I$(AIR_ROOT)/install/libs/imaspex/include/
LD_LIBS = $(AIR_LIBS)/libprintf/libprintf.a \
$(AIR_LIBS)/libair/libair.a $(AIR_LIBS)/imaspex/imaspex.a
......@@ -26,19 +23,12 @@ $(AIR_LIBS)/libair/libair.a $(AIR_LIBS)/imaspex/imaspex.a
LINK_LIBS += $(AIR_LIBS)/libprintf/libprintf.a \
$(AIR_LIBS)/libair/libair.a $(AIR_LIBS)/imaspex/imaspex.a
# The RTEMS_MAKEFILE_PATH is defined by the user for the specific CPU and BSP
RTEMS_MAKEFILE_PATH=$(AIR_POS)/rtems5/rtems5-install/sparc-rtems5/leon3
include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(PROJECT_ROOT)/make/leaf.cfg
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
CPPFLAGS += -DAIR_HYPERVISOR./ -I./ -B./ -I../common/ -B../common/ \
-DRTEMS5 -B$(AIR_LIBS)/imaspex/ -B$(AIR_LIBS)/libprintf/ \
-B$(AIR_LIBS)/libair/
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--wrap=printf -Wl,--wrap=puts \
-Wl,--wrap=putchar
CPPFLAGS += -DAIR_HYPERVISOR./ -I./ -B./ -I../common/ -B../common/ -B$(AIR_LIBS)/libprintf/ -B$(AIR_LIBS)/libair/
##############################################################################
# RTEMS_API is defined as part of RTEMS BSP Makefile. It reports the
......@@ -71,8 +61,8 @@ ifeq ($(RTEMS_API),4.12)
endif
ifeq ($(RTEMS_API),5)
POHI_CFLAGS += -DRTEMS5
TARGET_LDFLAGS += -lm
POHI_CFLAGS += -DRTEMS412
TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
endif
##############################################################################
......@@ -101,8 +91,17 @@ ifeq ($(RTEMS_BSP),leon2)
POHI_CFLAGS += -DGRLEON2
endif
ifdef USE_GPROF
TARGET_LDFLAGS+=-Wl,--wrap,Clock_isr -pg
EXTERNAL_OBJECTS+=po_hi_gprof_rtems_leon.o
TARGET_INCLUDE+=-I$(RTEMS_MAKEFILE_PATH)/lib/include/
target-objects:
$(CC) $(INCLUDE) $(TARGET_INCLUDE) -D__PO_HI_USE_GPROF -Wall -c -o po_hi_gprof_rtems_leon.o $(RUNTIME_PATH)/src/po_hi_gprof_rtems_leon.c
else
target-objects:
endif
LINK_LIBS+=-lm
target-clean:
target-objects:
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2020 ESA & ISAE.
*/
/* Note, this file is from RCC1.3rc4 sample directory.
*
* Any modification there should be carefully weighted.
......
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2020 ESA & ISAE.
*/
/* Note, this file is from RCC1.3rc4 sample directory.
*
* Any modification there should be carefully weighted.
......
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2020 ESA & ISAE.
*/
#include <bsp/gr_leon4_n2x.h>
// Things are always moving around in RTEMS - adapt.
......
......@@ -137,17 +137,13 @@ flag __po_hi_c_mil_1553_conf_t_IsConstraintValid(const __po_hi_c_mil_1553_conf_t
ret = ((1 <= strlen(pVal->devname)) && (strlen(pVal->devname) <= 20));
*pErrCode = ret ? 0 : ERR_MIL_1553_CONF_T_DEVNAME;
if (ret) {
ret = (((pVal->standard == __po_hi_c_mil1553a)) || ((pVal->standard == __po_hi_c_mil1553b)));
*pErrCode = ret ? 0 : ERR_MIL_1553_CONF_T_STANDARD;
ret = __po_hi_c_Standard_T_IsConstraintValid((&(pVal->standard)), pErrCode);
if (ret) {
ret = (((((pVal->mode == __po_hi_c_controller)) || ((pVal->mode == __po_hi_c_terminal)))) || ((pVal->mode == __po_hi_c_monitor)));
*pErrCode = ret ? 0 : ERR_MIL_1553_CONF_T_MODE;
ret = __po_hi_c_Mode_T_IsConstraintValid((&(pVal->mode)), pErrCode);
if (ret) {
ret = (((((((pVal->bus == __po_hi_c_none)) || ((pVal->bus == __po_hi_c_bus_a)))) || ((pVal->bus == __po_hi_c_bus_b)))) || ((pVal->bus == __po_hi_c_both)));
*pErrCode = ret ? 0 : ERR_MIL_1553_CONF_T_BUS;
ret = __po_hi_c_Bus_T_IsConstraintValid((&(pVal->bus)), pErrCode);
if (ret) {
ret = (pVal->termaddr <= 31UL);
*pErrCode = ret ? 0 : ERR_MIL_1553_CONF_T_TERMADDR;
ret = __po_hi_c_Node_Addr_T_IsConstraintValid((&(pVal->termaddr)), pErrCode);
}
}
}
......
AUTOMAKE_OPTIONS = no-dependencies
C_FILES = $(srcdir)/1553.c \
$(srcdir)/ip.c \
$(srcdir)/serial.c \
$(srcdir)/spacewire.c
ASN_FILES = $(srcdir)/1553.asn \
$(srcdir)/ip.asn \
$(srcdir)/serial.asn \
$(srcdir)/spacewire.asn
C_FILES = $(srcdir)/1553.c $(srcdir)/ip.c $(srcdir)/serial.c \
$(srcdir)/spacewire.c $(srcdir)/bluetooth.c
ASN_FILES = $(srcdir)/1553.asn $(srcdir)/ip.asn $(srcdir)/serial.asn \
$(srcdir)/spacewire.asn $(srcdir)/bluetooth.asn
csrc = ${shell $(CYGPATH_U) '$(OCARINA_RUNTIME)/polyorb-hi-c/src/drivers/configuration'}
t:
echo $(shell shell which asn1.exe)
echo `shell which asn1.exe`
$(srcdir)/1553.c:
mono $(shell which asn1.exe) -c -typePrefix __po_hi_c_ 1553.asn
sed -e 's/Mil\_1553\_Conf\_T/mil\_1553\_conf\_t/g' 1553.h > 1553new.h
......@@ -61,6 +52,17 @@ $(srcdir)/serial.c:
mv serial.h ../../../include/drivers/configuration/
mv asn1crt.h ../../../include/drivers/configuration/
$(srcdir)/bluetooth.c:
mono $$(which asn1.exe) -c -typePrefix __po_hi_c_ bluetooth.asn
sed -e 's/Bluetooth\_Conf\_T/bluetooth\_conf\_t/g' bluetooth.h > bluetoothnew.h
mv bluetoothnew.h bluetooth.h
echo "#if (defined (__PO_HI_NEED_DRIVER_BLUETOOTH))\n" > bluetoothnew.c
sed -e 's/Bluetooth\_Conf\_T/bluetooth\_conf\_t/g' bluetooth.c >> bluetoothnew.c
echo "\n#endif" >> bluetoothnew.c
mv bluetoothnew.c bluetooth.c
mv bluetooth.h ../../../include/drivers/configuration/
mv asn1crt.h ../../../include/drivers/configuration/
regenerate:
rm -f $(C_FILES)
for v in $(C_FILES); do $(MAKE) $$v ; done
......
......@@ -5,42 +5,6 @@
#include "asn1crt.h"
int GetCharIndex(char ch, byte Set[], int setLen)
{
int i=0;
for(i=0; i<setLen; i++)
if (ch == Set[i])
return i;
return 0;
}
void ByteStream_Init(ByteStream* pStrm, byte* buf, long count)
{
pStrm->count = count;
pStrm->buf = buf;
memset(pStrm->buf,0x0,(size_t)count);
pStrm->currentByte = 0;
pStrm->EncodeWhiteSpace = FALSE;
}
void ByteStream_AttachBuffer(ByteStream* pStrm, unsigned char* buf, long count)
{
pStrm->count = count;
pStrm->buf = buf;
pStrm->currentByte = 0;
}
asn1SccSint ByteStream_GetLength(ByteStream* pStrm)
{
return pStrm->currentByte;
}
#if WORD_SIZE==8
const asn1SccUint64 ber_aux[] = {
0xFF,
......@@ -59,8 +23,6 @@ const asn1SccUint32 ber_aux[] = {
0xFF000000 };
#endif
asn1SccUint int2uint(asn1SccSint v) {
asn1SccUint ret = 0;
if (v < 0) {
......@@ -84,7 +46,14 @@ asn1SccSint uint2int(asn1SccUint v, int uintSizeInBytes) {
return -(asn1SccSint)(~v) - 1;
}
int GetCharIndex(char ch, byte Set[], int setLen)
{
int i=0;
for(i=0; i<setLen; i++)
if (ch == Set[i])
return i;
return 0;
}
/*
......@@ -130,7 +99,3 @@ flag ObjectIdentifier_equal(const Asn1ObjectIdentifier *pVal1, const Asn1ObjectI
return FALSE;
}
}
......@@ -188,12 +188,10 @@ flag __po_hi_c_ip_conf_t_IsConstraintValid(const __po_hi_c_ip_conf_t* pVal, int*
}
if (ret) {
if (pVal->exist.version) {
ret = (((pVal->version == __po_hi_c_ipv4)) || ((pVal->version == __po_hi_c_ipv6)));
*pErrCode = ret ? 0 : ERR_IP_CONF_T_VERSION;
ret = __po_hi_c_Version_T_IsConstraintValid((&(pVal->version)), pErrCode);
}
if (ret) {
ret = (pVal->port <= 16535UL);
*pErrCode = ret ? 0 : ERR_IP_CONF_T_PORT;
ret = __po_hi_c_Port_T_IsConstraintValid((&(pVal->port)), pErrCode);
}
}
}
......
......@@ -175,13 +175,11 @@ flag __po_hi_c_serial_conf_t_IsConstraintValid(const __po_hi_c_serial_conf_t* pV
*pErrCode = ret ? 0 : ERR_SERIAL_CONF_T_DEVNAME;
if (ret) {
if (pVal->exist.speed) {
ret = (((((((((((pVal->speed == __po_hi_c_b9600)) || ((pVal->speed == __po_hi_c_b19200)))) || ((pVal->speed == __po_hi_c_b38400)))) || ((pVal->speed == __po_hi_c_b57600)))) || ((pVal->speed == __po_hi_c_b115200)))) || ((pVal->speed == __po_hi_c_b230400)));
*pErrCode = ret ? 0 : ERR_SERIAL_CONF_T_SPEED;
ret = __po_hi_c_Baudrate_T_IsConstraintValid((&(pVal->speed)), pErrCode);
}
if (ret) {
if (pVal->exist.parity) {
ret = (((pVal->parity == __po_hi_c_even)) || ((pVal->parity == __po_hi_c_odd)));
*pErrCode = ret ? 0 : ERR_SERIAL_CONF_T_PARITY;
ret = __po_hi_c_Parity_T_IsConstraintValid((&(pVal->parity)), pErrCode);
}
if (ret) {
if (pVal->exist.bits) {
......
......@@ -146,17 +146,14 @@ flag __po_hi_c_spacewire_conf_t_IsConstraintValid(const __po_hi_c_spacewire_conf
ret = ((1 <= strlen(pVal->devname)) && (strlen(pVal->devname) <= 20));
*pErrCode = ret ? 0 : ERR_SPACEWIRE_CONF_T_DEVNAME;
if (ret) {
ret = (pVal->nodeaddr <= 255UL);
*pErrCode = ret ? 0 : ERR_SPACEWIRE_CONF_T_NODEADDR;
ret = __po_hi_c_Node_Addr_T_IsConstraintValid((&(pVal->nodeaddr)), pErrCode);
if (ret) {
if (pVal->exist.corefreq) {
ret = (pVal->corefreq <= 4294967295UL);
*pErrCode = ret ? 0 : ERR_SPACEWIRE_CONF_T_COREFREQ;
ret = __po_hi_c_Core_Frequence_T_IsConstraintValid((&(pVal->corefreq)), pErrCode);
}
if (ret) {
if (pVal->exist.clockdiv) {
ret = (pVal->clockdiv <= 255UL);
*pErrCode = ret ? 0 : ERR_SPACEWIRE_CONF_T_CLOCKDIV;
ret = __po_hi_c_Clock_Division_T_IsConstraintValid((&(pVal->clockdiv)), pErrCode);
}
}
}
......
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2018 ESA & ISAE.
* Copyright (C) 2018-2020 ESA & ISAE.
*/
/* This driver relies on the GRSPW2 Packet library proposed in RTEMS
......
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2011-2018 ESA & ISAE.
* Copyright (C) 2011-2020 ESA & ISAE.
*/
#include <deployment.h>
......
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2010-2018 ESA & ISAE.
* Copyright (C) 2010-2020 ESA & ISAE.
*/
#include <deployment.h>
......
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2010-2018 ESA & ISAE.
* Copyright (C) 2010-2020 ESA & ISAE.
*/
#include <deployment.h>
......
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2018 ESA & ISAE.
* Copyright (C) 2018-2020 ESA & ISAE.
*/
#include <stdio.h>
......
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2018 ESA & ISAE.
* Copyright (C) 2018-2020 ESA & ISAE.
*/
#include <deployment.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment