Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
regression-suites
Commits
a03252fc
Commit
a03252fc
authored
Jan 31, 2018
by
Thanassis Tsiodras
Browse files
Add a test for uPython with RTEMS4.12/Leon3 target.
parent
a8bc85f4
Changes
11
Hide whitespace changes
Inline
Side-by-side
Demo_uPy_Basic_RTEMS412_Leon3/.gitignore
0 → 100644
View file @
a03252fc
my_function.zip
Demo_uPy_Basic_RTEMS412_Leon3/DataView.asn
0 → 100644
View file @
a03252fc
TASTE-Dataview DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
-- A few simple types to start with ASN.1
MyInteger ::= T-UInt8
MyReal ::= REAL (0.0 .. 1000.0)
MyBool ::= BOOLEAN
MyEnum ::= ENUMERATED { hello, world, howareyou }
MySeq ::= SEQUENCE {
input-data MyInteger,
output-data MyInteger,
validity ENUMERATED { valid, invalid }
}
MyChoice ::= CHOICE {
a BOOLEAN,
b MySeq
}
MySeqOf ::= SEQUENCE (SIZE (2)) OF MyEnum
MyOctStr ::= OCTET STRING (SIZE (3))
-- You can also declare constants
myVar MySeqOf ::= { hello, world }
END
Demo_uPy_Basic_RTEMS412_Leon3/DeploymentView.aadl
0 → 100644
View file @
a03252fc
---------------------------------------------------
-- AADL2.0
-- TASTE
--
--
---------------------------------------------------
PACKAGE deploymentview::DV::Node1
PUBLIC
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS leon3_partition
END leon3_partition;
PROCESS IMPLEMENTATION leon3_partition.others
END leon3_partition.others;
END deploymentview::DV::Node1;
PACKAGE deploymentview::DV
PUBLIC
WITH ocarina_processors_leon;
WITH deploymentview::DV::Node1;
WITH Taste;
WITH Deployment;
WITH interfaceview::IV;
WITH TASTE_DV_Properties;
SYSTEM Node1
END Node1;
SYSTEM IMPLEMENTATION Node1.others
SUBCOMPONENTS
IV_my_function : SYSTEM interfaceview::IV::my_function.others {
Taste::coordinates => "1067 1174 1621 1508";
Taste::FunctionName => "my_function";
};
leon3_partition : PROCESS deploymentview::DV::Node1::leon3_partition.others {
Taste::coordinates => "759 953 2273 1712";
Deployment::Port_Number => 0;
};
leon3_rtems412_posix : PROCESSOR ocarina_processors_leon::leon3.rtems412_posix {
Taste::coordinates => "570 736 2462 1820";
};
PROPERTIES
Taste::APLC_Binding => (reference (leon3_partition)) APPLIES TO IV_my_function;
Actual_Processor_Binding => (reference (leon3_rtems412_posix)) APPLIES TO leon3_partition;
END Node1.others;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
Node1 : SYSTEM Node1.others {
Taste::coordinates => "333 426 2698 1975";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
END deploymentview.others;
PROPERTIES
Taste::coordinates => "0 0 2970 2100";
Taste::version => "1.3.20";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("../../../tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
Demo_uPy_Basic_RTEMS412_Leon3/InterfaceView.aadl
0 → 100644
View file @
a03252fc
---------------------------------------------------
-- AADL2.0
-- TASTE
--
--
---------------------------------------------------
PACKAGE interfaceview::FV::my_function
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_my_cycle
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_my_cycle;
SUBPROGRAM IMPLEMENTATION PI_my_cycle.others
END PI_my_cycle.others;
END interfaceview::FV::my_function;
PACKAGE interfaceview::IV
PUBLIC
WITH interfaceview::FV::my_function;
WITH interfaceview::FV;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM my_function
FEATURES
PI_my_cycle : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::my_function::PI_my_cycle.others {
Taste::coordinates => "995 1559";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 500 ms;
Taste::Deadline => 500 ms;
Taste::InterfaceName => "my_cycle";
};
PROPERTIES
Source_Language => (Micropython);
END my_function;
SYSTEM IMPLEMENTATION my_function.others
SUBCOMPONENTS
my_cycle_impl : SUBPROGRAM interfaceview::FV::my_function::PI_my_cycle.others {
Compute_Execution_Time => 0 ms .. 0 ms;
};
CONNECTIONS
OpToPICnx_my_cycle_impl : SUBPROGRAM ACCESS my_cycle_impl -> PI_my_cycle;
END my_function.others;
SYSTEM interfaceview
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
my_function : SYSTEM interfaceview::IV::my_function.others {
Taste::coordinates => "415 385 2170 1559";
};
END interfaceview.others;
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
Taste::coordinates => "0 0 2970 2100";
Taste::version => "1.3.19";
END interfaceview::IV;
PACKAGE interfaceview::FV
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
END interfaceview::FV;
Demo_uPy_Basic_RTEMS412_Leon3/InterfaceView.md5
0 → 100644
View file @
a03252fc
33cbfc253f2e4982b9858606b450edfe InterfaceView.aadl
Demo_uPy_Basic_RTEMS412_Leon3/README
0 → 100644
View file @
a03252fc
Demo_uPY_Basic
This is the simplest possible system: a single Function with a cyclic PI.
The Function is implemented as a MicroPython module and the cyclic PI is
implemented as a MicroPython function within that module.
The expected output of the built binary is to print some start up statistics
and then print a counter every second, going from 0 to 9 and then wrapping
back around to 0.
Demo_uPy_Basic_RTEMS412_Leon3/build-script.sh
0 → 100755
View file @
a03252fc
#!/bin/bash -e
# This script will build your TASTE system.
# You should not change this file as it was automatically generated.
# If you need additional preprocessing, there are three hook files
# that you can provide and that are called dring the build:
# user_init_pre.sh, user_init_post.sh and user_init_last.sh
# These files will never get overwritten by TASTE.'
# Inside these files you may set some environment variables:
# C_INCLUDE_PATH=/usr/include/xenomai/analogy/:${C_INCLUDE_PATH}
# unset USE_POHIC
CWD
=
$(
pwd
)
if
[
-t
1
]
;
then
COLORON
=
"
\e
[1m
\e
[32m"
COLOROFF
=
"
\e
[0m"
else
COLORON
=
""
COLOROFF
=
""
fi
INFO
=
"
${
COLORON
}
[INFO]
${
COLOROFF
}
"
if
[
-f
user_init_pre.sh
]
then
echo
-e
"
${
INFO
}
Executing user-defined init script"
source
user_init_pre.sh
fi
# Use PolyORB-HI-C runtime
USE_POHIC
=
1
# Detect models from Ellidiss tools v2, and convert them to 1.3
INTERFACEVIEW
=
InterfaceView.aadl
grep
"version =>
\"
2"
InterfaceView.aadl
>
/dev/null
&&
{
echo
-e
"
${
INFO
}
Converting interface view from V2 to V1.3"
TASTE
--load-interface-view
InterfaceView.aadl
--export-interface-view-to-1_3
__iv_1_3.aadl
INTERFACEVIEW
=
__iv_1_3.aadl
}
;
if
[
-z
"
$DEPLOYMENTVIEW
"
]
then
DEPLOYMENTVIEW
=
DeploymentView.aadl
fi
# Detect models from Ellidiss tools v2, and convert them to 1.3
grep
"version =>
\"
2"
"
$DEPLOYMENTVIEW
"
>
/dev/null
&&
{
echo
-e
"
${
INFO
}
Converting deployment view from V2 to V1.3"
TASTE
--load-deployment-view
"
$DEPLOYMENTVIEW
"
--export-deployment-view-to-1_3
__dv_1_3.aadl
DEPLOYMENTVIEW
=
__dv_1_3.aadl
}
;
SKELS
=
"./"
# Check if Dataview references existing files
mono
$(
which taste-extract-asn-from-design.exe
)
-i
"
$INTERFACEVIEW
"
-j
/tmp/dv.asn
cd
"
$SKELS
"
&&
rm
-f
my_function.zip
&&
zip my_function my_function/
*
&&
cd
$OLDPWD
[
!
-z
"
$CLEANUP
"
]
&&
rm
-rf
binary
*
if
[
-f
ConcurrencyView.pro
]
then
ORCHESTRATOR_OPTIONS+
=
" -w ConcurrencyView.pro "
fi
if
[
-f
user_init_post.sh
]
then
echo
-e
"
${
INFO
}
Executing user-defined post-init script"
source
user_init_post.sh
fi
if
[
!
-z
"
$USE_POHIC
"
]
then
OUTPUTDIR
=
binary.c
ORCHESTRATOR_OPTIONS+
=
" -p "
elif
[
!
-z
"
$USE_POHIADA
"
]
then
OUTPUTDIR
=
binary.ada
else
OUTPUTDIR
=
binary
fi
cd
"
$CWD
"
&&
assert-builder-ocarina.py
\
--fast
\
--debug
\
--aadlv2
\
--keep-case
\
--interfaceView
"
$INTERFACEVIEW
"
\
--deploymentView
"
$DEPLOYMENTVIEW
"
\
-o
"
$OUTPUTDIR
"
\
--subMicroPython
my_function:
"
$SKELS
"
/my_function.zip
\
$ORCHESTRATOR_OPTIONS
if
[
-f
user_init_last.sh
]
then
echo
-e
"
${
INFO
}
Executing user-defined post-build script"
source
user_init_last.sh
fi
Demo_uPy_Basic_RTEMS412_Leon3/my_function/asn1crt.h
0 → 100644
View file @
a03252fc
#ifndef ASN1SCC_ASN1CRT_H_
#define ASN1SCC_ASN1CRT_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
#ifndef NULL
#define NULL 0
#endif
#ifndef TRUE
#define TRUE true
#endif
#ifndef FALSE
#define FALSE false
#endif
#ifndef WORD_SIZE
#define WORD_SIZE 8
#endif
typedef
int
asn1SccSint32
;
typedef
unsigned
int
asn1SccUint32
;
typedef
unsigned
char
byte
;
typedef
long
long
asn1SccSint64
;
typedef
unsigned
long
long
asn1SccUint64
;
#if WORD_SIZE==8
typedef
asn1SccUint64
asn1SccUint
;
typedef
asn1SccSint64
asn1SccSint
;
#else
typedef
asn1SccUint32
asn1SccUint
;
typedef
asn1SccSint32
asn1SccSint
;
#endif
#ifdef _MSC_VER
# ifndef INFINITY
# define INFINITY (DBL_MAX+DBL_MAX)
# endif
# ifndef NAN
# define NAN (INFINITY-INFINITY)
# endif
#endif
typedef
bool
flag
;
typedef
char
NullType
;
typedef
struct
{
byte
*
buf
;
long
count
;
long
currentByte
;
/* Next available bit for writting. Possible vallues 0..7, 0 is most significant bit of current byte*/
int
currentBit
;
}
BitStream
;
typedef
struct
{
byte
*
buf
;
long
count
;
long
currentByte
;
flag
EncodeWhiteSpace
;
}
ByteStream
;
typedef
struct
{
int
TokenID
;
char
Value
[
100
];
}
Token
;
typedef
struct
{
char
Name
[
50
];
char
Value
[
100
];
}
XmlAttribute
;
typedef
struct
{
XmlAttribute
attrs
[
20
];
int
nCount
;
}
XmlAttributeArray
;
#define ERR_INSUFFICIENT_DATA 101
#define ERR_INCORRECT_PER_STREAM 102
#define ERR_INVALID_CHOICE_ALTERNATIVE 103
#define ERR_INVALID_ENUM_VALUE 104
#define ERR_INVALID_XML_FILE 200
#define ERR_INVALID_BER_FILE 201
#define ERR_BER_LENGTH_MISMATCH 202
/* Bit strean functions */
void
BitStream_Init
(
BitStream
*
pBitStrm
,
unsigned
char
*
buf
,
long
count
);
void
BitStream_AttachBuffer
(
BitStream
*
pBitStrm
,
unsigned
char
*
buf
,
long
count
);
void
BitStream_AppendBit
(
BitStream
*
pBitStrm
,
flag
v
);
void
BitStream_AppendBits
(
BitStream
*
pBitStrm
,
const
byte
*
srcBuffer
,
int
nBitsToWrite
);
void
BitStream_AppendByte
(
BitStream
*
pBitStrm
,
byte
v
,
flag
negate
);
void
BitStream_AppendByte0
(
BitStream
*
pBitStrm
,
byte
v
);
void
ByteStream_Init
(
ByteStream
*
pStrm
,
byte
*
buf
,
long
count
);
void
ByteStream_AttachBuffer
(
ByteStream
*
pStrm
,
unsigned
char
*
buf
,
long
count
);
asn1SccSint
ByteStream_GetLength
(
ByteStream
*
pStrm
);
asn1SccSint
BitStream_GetLength
(
BitStream
*
pBitStrm
);
void
BitStream_AppendBitOne
(
BitStream
*
pBitStrm
);
void
BitStream_AppendBitZero
(
BitStream
*
pBitStrm
);
flag
BitStream_ReadBit
(
BitStream
*
pBitStrm
,
flag
*
v
);
flag
BitStream_ReadBits
(
BitStream
*
pBitStrm
,
byte
*
BuffToWrite
,
int
nBitsToRead
);
flag
BitStream_ReadByte
(
BitStream
*
pBitStrm
,
byte
*
v
);
/* Integer functions */
void
BitStream_EncodeUnConstraintWholeNumber
(
BitStream
*
pBitStrm
,
asn1SccSint
v
);
void
BitStream_EncodeSemiConstraintWholeNumber
(
BitStream
*
pBitStrm
,
asn1SccSint
v
,
asn1SccSint
min
);
void
BitStream_EncodeSemiConstraintPosWholeNumber
(
BitStream
*
pBitStrm
,
asn1SccUint
v
,
asn1SccUint
min
);
void
BitStream_EncodeConstraintWholeNumber
(
BitStream
*
pBitStrm
,
asn1SccSint
v
,
asn1SccSint
min
,
asn1SccSint
max
);
void
BitStream_EncodeConstraintPosWholeNumber
(
BitStream
*
pBitStrm
,
asn1SccUint
v
,
asn1SccUint
min
,
asn1SccUint
max
);
flag
BitStream_DecodeUnConstraintWholeNumber
(
BitStream
*
pBitStrm
,
asn1SccSint
*
v
);
flag
BitStream_DecodeSemiConstraintWholeNumber
(
BitStream
*
pBitStrm
,
asn1SccSint
*
v
,
asn1SccSint
min
);
flag
BitStream_DecodeSemiConstraintPosWholeNumber
(
BitStream
*
pBitStrm
,
asn1SccUint
*
v
,
asn1SccUint
min
);
flag
BitStream_DecodeConstraintWholeNumber
(
BitStream
*
pBitStrm
,
asn1SccSint
*
v
,
asn1SccSint
min
,
asn1SccSint
max
);
flag
BitStream_DecodeConstraintPosWholeNumber
(
BitStream
*
pBitStrm
,
asn1SccUint
*
v
,
asn1SccUint
min
,
asn1SccUint
max
);
void
BitStream_EncodeReal
(
BitStream
*
pBitStrm
,
double
v
);
flag
BitStream_DecodeReal
(
BitStream
*
pBitStrm
,
double
*
v
);
void
CalculateMantissaAndExponent
(
double
d
,
int
*
exp
,
asn1SccUint64
*
mantissa
);
double
GetDoubleByMantissaAndExp
(
asn1SccUint
mantissa
,
int
exp
);
int
GetNumberOfBitsForNonNegativeInteger
(
asn1SccUint
v
);
int
GetCharIndex
(
char
ch
,
byte
allowedCharSet
[],
int
setLen
);
/*
db ,ad8888ba, 888b 88 88888888888 88
d88b d8"' `"8b 8888b 88 88 ,d ""
d8'`8b d8' 88 `8b 88 88 88
d8' `8b 88 88 `8b 88 88aaaaa 88 88 8b,dPPYba, ,adPPYba, MM88MMM 88 ,adPPYba, 8b,dPPYba, ,adPPYba,
d8YaaaaY8b 88 88 `8b 88 88""""" 88 88 88P' `"8a a8" "" 88 88 a8" "8a 88P' `"8a I8[ ""
d8""""""""8b Y8, 88 `8b 88 88 88 88 88 88 8b 88 88 8b d8 88 88 `"Y8ba,
d8' `8b Y8a. .a8P 88 `8888 88 "8a, ,a88 88 88 "8a, ,aa 88, 88 "8a, ,a8" 88 88 aa ]8I
d8' `8b `"Y8888Y"' 88 `888 88 `"YbbdP'Y8 88 88 `"Ybbd8"' "Y888 88 `"YbbdP"' 88 88 `"YbbdP"
*/
void
Acn_AlignToNextByte
(
BitStream
*
pBitStrm
);
void
Acn_AlignToNextWord
(
BitStream
*
pBitStrm
);
void
Acn_AlignToNextDWord
(
BitStream
*
pBitStrm
);
/*ACN Integer functions*/
void
Acn_Enc_Int_PositiveInteger_ConstSize
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
,
int
encodedSizeInBits
);
void
Acn_Enc_Int_PositiveInteger_ConstSize_8
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
void
Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_16
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
void
Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_32
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
void
Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_64
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
void
Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_16
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
void
Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_32
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
void
Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_64
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
void
Acn_Enc_Int_PositiveInteger_VarSize_LengthEmbedded
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
void
Acn_Enc_Int_TwosComplement_ConstSize
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
,
int
encodedSizeInBits
);
void
Acn_Enc_Int_TwosComplement_ConstSize_8
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
);
void
Acn_Enc_Int_TwosComplement_ConstSize_big_endian_16
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
);
void
Acn_Enc_Int_TwosComplement_ConstSize_big_endian_32
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
);
void
Acn_Enc_Int_TwosComplement_ConstSize_big_endian_64
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
);
void
Acn_Enc_Int_TwosComplement_ConstSize_little_endian_16
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
);
void
Acn_Enc_Int_TwosComplement_ConstSize_little_endian_32
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
);
void
Acn_Enc_Int_TwosComplement_ConstSize_little_endian_64
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
);
void
Acn_Enc_Int_TwosComplement_VarSize_LengthEmbedded
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
);
void
Acn_Enc_Int_BCD_ConstSize
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
,
int
encodedSizeInNibbles
);
void
Acn_Enc_Int_BCD_VarSize_LengthEmbedded
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
void
Acn_Enc_Int_BCD_VarSize_NullTerminated
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
/*encoding ends when 'F' is reached*/
void
Acn_Enc_SInt_ASCII_ConstSize
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
,
int
encodedSizeInBytes
);
void
Acn_Enc_SInt_ASCII_VarSize_LengthEmbedded
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
);
void
Acn_Enc_SInt_ASCII_VarSize_NullTerminated
(
BitStream
*
pBitStrm
,
asn1SccSint
intVal
);
/*encoding ends when 0x0 is reached*/
void
Acn_Enc_UInt_ASCII_ConstSize
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
,
int
encodedSizeInBytes
);
void
Acn_Enc_UInt_ASCII_VarSize_LengthEmbedded
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
void
Acn_Enc_UInt_ASCII_VarSize_NullTerminated
(
BitStream
*
pBitStrm
,
asn1SccUint
intVal
);
/*encoding ends when 0x0 is reached*/
/*ACN Decode Integer functions*/
flag
Acn_Dec_Int_PositiveInteger_ConstSize
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
,
int
encodedSizeInBits
);
flag
Acn_Dec_Int_PositiveInteger_ConstSize_8
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
flag
Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_16
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
flag
Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_32
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
flag
Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_64
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
flag
Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_16
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
flag
Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_32
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
flag
Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_64
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
flag
Acn_Dec_Int_PositiveInteger_VarSize_LengthEmbedded
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
flag
Acn_Dec_Int_TwosComplement_ConstSize
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
,
int
encodedSizeInBits
);
flag
Acn_Dec_Int_TwosComplement_ConstSize_8
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
);
flag
Acn_Dec_Int_TwosComplement_ConstSize_big_endian_16
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
);
flag
Acn_Dec_Int_TwosComplement_ConstSize_big_endian_32
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
);
flag
Acn_Dec_Int_TwosComplement_ConstSize_big_endian_64
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
);
flag
Acn_Dec_Int_TwosComplement_ConstSize_little_endian_16
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
);
flag
Acn_Dec_Int_TwosComplement_ConstSize_little_endian_32
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
);
flag
Acn_Dec_Int_TwosComplement_ConstSize_little_endian_64
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
);
flag
Acn_Dec_Int_TwosComplement_VarSize_LengthEmbedded
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
);
flag
Acn_Dec_Int_BCD_ConstSize
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
,
int
encodedSizeInNibbles
);
flag
Acn_Dec_Int_BCD_VarSize_LengthEmbedded
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
/*encoding ends when 'F' is reached*/
flag
Acn_Dec_Int_BCD_VarSize_NullTerminated
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
flag
Acn_Dec_SInt_ASCII_ConstSize
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
,
int
encodedSizeInBytes
);
flag
Acn_Dec_SInt_ASCII_VarSize_LengthEmbedded
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
);
flag
Acn_Dec_SInt_ASCII_VarSize_NullTerminated
(
BitStream
*
pBitStrm
,
asn1SccSint
*
pIntVal
);
flag
Acn_Dec_UInt_ASCII_ConstSize
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
,
int
encodedSizeInBytes
);
flag
Acn_Dec_UInt_ASCII_VarSize_LengthEmbedded
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
flag
Acn_Dec_UInt_ASCII_VarSize_NullTerminated
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pIntVal
);
/*flag Acn_Dec_Int_ASCII_NullTerminated_FormattedInteger(BitStream* pBitStrm, const char* format, asn1SccSint* pIntVal);*/
/* Boolean Decode */
flag
BitStream_ReadBitPattern
(
BitStream
*
pBitStrm
,
const
byte
*
patternToRead
,
int
nBitsToRead
,
flag
*
pBoolValue
);
/*Real encoding functions*/
void
Acn_Enc_Real_IEEE754_32_big_endian
(
BitStream
*
pBitStrm
,
double
realValue
);
void
Acn_Enc_Real_IEEE754_64_big_endian
(
BitStream
*
pBitStrm
,
double
realValue
);
void
Acn_Enc_Real_IEEE754_32_little_endian
(
BitStream
*
pBitStrm
,
double
realValue
);
void
Acn_Enc_Real_IEEE754_64_little_endian
(
BitStream
*
pBitStrm
,
double
realValue
);
flag
Acn_Dec_Real_IEEE754_32_big_endian
(
BitStream
*
pBitStrm
,
double
*
pRealValue
);
flag
Acn_Dec_Real_IEEE754_64_big_endian
(
BitStream
*
pBitStrm
,
double
*
pRealValue
);
flag
Acn_Dec_Real_IEEE754_32_little_endian
(
BitStream
*
pBitStrm
,
double
*
pRealValue
);
flag
Acn_Dec_Real_IEEE754_64_little_endian
(
BitStream
*
pBitStrm
,
double
*
pRealValue
);
/*String functions*/
void
Acn_Enc_String_Ascii_FixSize
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
const
char
*
strVal
);
void
Acn_Enc_String_Ascii_Null_Teminated
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
char
null_character
,
const
char
*
strVal
);
void
Acn_Enc_String_Ascii_External_Field_Determinant
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
const
char
*
strVal
);
void
Acn_Enc_String_Ascii_Internal_Field_Determinant
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
asn1SccSint
min
,
const
char
*
strVal
);
void
Acn_Enc_String_CharIndex_FixSize
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
byte
allowedCharSet
[],
int
charSetSize
,
const
char
*
strVal
);
void
Acn_Enc_String_CharIndex_External_Field_Determinant
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
byte
allowedCharSet
[],
int
charSetSize
,
const
char
*
strVal
);
void
Acn_Enc_String_CharIndex_Internal_Field_Determinant
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
byte
allowedCharSet
[],
int
charSetSize
,
asn1SccSint
min
,
const
char
*
strVal
);
flag
Acn_Dec_String_Ascii_FixSize
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
char
*
strVal
);
flag
Acn_Dec_String_Ascii_Null_Teminated
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
char
null_character
,
char
*
strVal
);
flag
Acn_Dec_String_Ascii_External_Field_Determinant
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
asn1SccSint
extSizeDeterminatFld
,
char
*
strVal
);
flag
Acn_Dec_String_Ascii_Internal_Field_Determinant
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
asn1SccSint
min
,
char
*
strVal
);
flag
Acn_Dec_String_CharIndex_FixSize
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
byte
allowedCharSet
[],
int
charSetSize
,
char
*
strVal
);
flag
Acn_Dec_String_CharIndex_External_Field_Determinant
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
byte
allowedCharSet
[],
int
charSetSize
,
asn1SccSint
extSizeDeterminatFld
,
char
*
strVal
);
flag
Acn_Dec_String_CharIndex_Internal_Field_Determinant
(
BitStream
*
pBitStrm
,
asn1SccSint
max
,
byte
allowedCharSet
[],
int
charSetSize
,
asn1SccSint
min
,
char
*
strVal
);
/* Length Determinant functions*/
void
Acn_Enc_Length
(
BitStream
*
pBitStrm
,
asn1SccUint
lengthValue
,
int
lengthSizeInBits
);
flag
Acn_Dec_Length
(
BitStream
*
pBitStrm
,
asn1SccUint
*
pLengthValue
,
int
lengthSizeInBits
);
void
BitStream_AppendNBitZero
(
BitStream
*
pBitStrm
,
int
nbits
);
void
BitStream_EncodeNonNegativeInteger
(
BitStream
*
pBitStrm
,
asn1SccUint
v
);
void
BitStream_AppendNBitOne
(
BitStream
*
pBitStrm
,
int
nbits
);
void
BitStream_EncodeNonNegativeIntegerNeg
(
BitStream
*
pBitStrm
,
asn1SccUint
v
,
flag
negate
);
flag
BitStream_DecodeNonNegativeInteger
(
BitStream
*
pBitStrm
,
asn1SccUint
*
v
,
int
nBits
);
flag
BitStream_ReadPartialByte
(
BitStream
*
pBitStrm
,
byte
*
v
,
byte
nbits
);
void
BitStream_AppendPartialByte
(
BitStream
*
pBitStrm
,
byte
v
,
byte
nbits
,
flag
negate
);