Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Projects
Eclipse Titan
titan.TestPorts.SocketCANasp
Commits
77a50aac
Commit
77a50aac
authored
Nov 22, 2016
by
Elemer Lelik
Browse files
Headers and Isobus
parent
edbf054a
Changes
16
Hide whitespace changes
Inline
Side-by-side
demo/Isobus.ttcn
View file @
77a50aac
...
...
@@ -11,7 +11,7 @@
// File: Isobus.ttcn
// Description: Encoder / Decoder for Isobus message frames
//
// Revision R1A
module
Isobus
{
import
from
General_Types
all
...
...
@@ -31,11 +31,6 @@ with { extension "prototype(convert) encode(RAW)" }
external
function
decode_CAN_frame_j1939mod
(
in
octetstring
data
)
return
CAN_frame_j1939mod
with
{
extension
"prototype(convert) decode(RAW)"
}
const
octetstring
ISOBUS_PRIORITY_MASK
:=
'
1
C000000
'
O
;
const
octetstring
ISOBUS_RESERVED_MASK
:=
'02000000'O
;
const
octetstring
ISOBUS_DATAPAGE_MASK
:=
'01000000'O
;
...
...
@@ -95,15 +90,7 @@ with { variant "" }
type
record
CAN_frame_j1939
{
J1939
can_j1939
,
AnyIsoBusPdu
can_pdu
}
with
{
variant
(
can_pdu
)
"CROSSTAG(
vt2ecu, can_j1939.pf = 'E6'O; //230
ecu2vt, can_j1939.pf = 'E7'O; //231
requestForAddressClaimed, can_j1939.pf = 'EA'O; //234
cannotClaimSourceAddress, {can_j1939.pf = 'EE'O, can_j1939.ps = 'FF'O, can_j1939.sa = 'FE'O}; //238 all and conjuction needed!!!!!!
addressClaimed, {can_j1939.pf = 'EE'O, can_j1939.ps = 'FF'O}; //238 all and conjuction needed!!!!!!
commandedAddress, {can_j1939.pf = 'FE'O, can_j1939.ps = 'D8'O})"
//254 all and conjuction needed!!!!!!
}
}
with
{
variant
""
}
type
record
CAN_frame_j1939mod
{
...
...
@@ -153,32 +140,19 @@ function can2j1939frame(CAN_frame p_can_frame) return CAN_frame_j1939 {
}
function
canid2j1939
(
in
CAN_id
p_can_id
)
return
J1939
{
var
bitstring
v_can_id_bitstring
var
Priority
v_priority
var
BIT1
v_reserved
// BIT1
var
BIT1
v_datapage
// BIT1
var
OCT1
v_pduformat
// OCT1
var
OCT1
v_pduspecifc
// OCT1
var
OCT1
v_sourceaddress
// OCT1
var
PGN
v_pgn
var
J1939
v_j1939
//---------------------------------------------------------------------------------------
v_can_id_bitstring
:=
oct2bit
(
p_can_id
)
v_priority
:=
substr
(
v_can_id_bitstring
,
3
,
3
)
v_reserved
:=
v_can_id_bitstring
[
6
]
v_datapage
:=
v_can_id_bitstring
[
7
]
v_pduformat
:=
p_can_id
[
1
]
//(p_can_id and4b ISOBUS_PDUFORMAT_MASK) >> 2 // shift 16 bits = 2 octets
v_pduspecifc
:=
p_can_id
[
2
]
// (p_can_id and4b ISOBUS_PDUSPECIFIC_MASK) >> 1 // shift 8 bits = 1 octet
v_sourceaddress
:=
p_can_id
[
3
]
//(p_can_id and4b ISOBUS_SOURCEADDRESS_MASK)
if
(
oct2int
(
v_pduformat
)
<
240
)
{
v_pgn
:=
bit2int
(
v_reserved
)
*
2
*
256
*
256
+
bit2int
(
v_datapage
)
*
256
*
256
+
oct2int
(
v_pduformat
)
*
256
var
bitstring
v_can_id_bitstring
:=
oct2bit
(
p_can_id
)
var
J1939
v_j1939
}
else
{
v_pgn
:=
bit2int
(
v_reserved
)
*
2
*
256
*
256
+
bit2int
(
v_datapage
)
*
256
*
256
+
oct2int
(
v_pduformat
)
*
256
+
oct2int
(
v_pduspecifc
)
}
v_j1939
:=
{
/*pgn := v_pgn, */
prio
:=
v_priority
,
res
:=
v_reserved
,
dp
:=
v_datapage
,
pf
:=
v_pduformat
,
ps
:=
v_pduspecifc
,
sa
:=
v_sourceaddress
}
return
v_j1939
v_j1939
.
prio
:=
substr
(
v_can_id_bitstring
,
0
,
6
);
//3 ,3
v_j1939
.
res
:=
v_can_id_bitstring
[
6
];
v_j1939
.
dp
:=
v_can_id_bitstring
[
7
];
v_j1939
.
pf
:=
p_can_id
[
1
];
//(p_can_id and4b ISOBUS_PDUFORMAT_MASK) >> 2 // shift 16 bits = 2 octets
v_j1939
.
ps
:=
p_can_id
[
2
];
// (p_can_id and4b ISOBUS_PDUSPECIFIC_MASK) >> 1 // shift 8 bits = 1 octet
v_j1939
.
sa
:=
p_can_id
[
3
];
//(p_can_id and4b ISOBUS_SOURCEADDRESS_MASK)
return
v_j1939
}
//********************************************************************************-
...
...
demo/IsobusCMMessageTypes.ttcn
View file @
77a50aac
/* Copyright (c) 2010, 2016 Ericsson AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Michael Josenhans
******************************************************************************/
module
IsobusCMMessageTypes
{
import
from
General_Types
all
import
from
IsobusMessageTypes
all
...
...
demo/IsobusMessageTypes.ttcn
View file @
77a50aac
/*
/* Copyright (c) 2010, 2016 Ericsson AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Michael Josenhans
*/
*****************************************************************************
*/
module
IsobusMessageTypes
{
...
...
demo/IsobusNMMessageTypes.ttcn
View file @
77a50aac
/*
/* Copyright (c) 2010, 2016 Ericsson AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Michael Josenhans
*/
*****************************************************************************
*/
module
IsobusNMMessageTypes
{
...
...
demo/IsobusVTMessageTypes.ttcn
View file @
77a50aac
/* Copyright (c) 2010, 2016 Ericsson AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Michael Josenhans
******************************************************************************/
module
IsobusVTMessageTypes
{
import
from
General_Types
all
...
...
demo/Isobus_Templates.ttcn
View file @
77a50aac
/* Copyright (c) 2010, 2016 Ericsson AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Michael Josenhans
******************************************************************************/
module
Isobus_Templates
{
import
from
IsobusMessageTypes
all
...
...
demo/Isobustest.ttcn
View file @
77a50aac
...
...
@@ -11,7 +11,6 @@
// File: Isobustest.ttcn
// Description: Encoder / Decoder for Isobus message frames
//
// Revision R1A
module
Isobustest
{
...
...
demo/Isotp.ttcn
View file @
77a50aac
...
...
@@ -13,7 +13,7 @@
// File: Isotp.ttcn
// Description: Isotp base
//
// Revision R1A
module
Isotp
{
...
...
demo/Isotptest.ttcn
View file @
77a50aac
/* Copyright (c) 2010, 2016 Ericsson AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Michael Josenhans
******************************************************************************/
module
Isotptest
{
import
from
General_Types
all
...
...
demo/J1939.ttcn
View file @
77a50aac
/* Copyright (c) 2010, 2016 Ericsson AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Michael Josenhans
******************************************************************************/
module
J1939
{
import
from
General_Types
all
;
...
...
demo/SocketCAN.cfg
View file @
77a50aac
...
...
@@ -9,7 +9,7 @@
# Michael Josenhans
##############################################################################
// Revision R1A
[LOGGING]
FileMask := LOG_ALL | DEBUG | MATCHING
...
...
demo/SocketCAN_BCM_test.ttcn
View file @
77a50aac
...
...
@@ -11,7 +11,6 @@
// File: SocketCAN_BCM_test.ttcn
// Description: SocketCAN testcases for CAN_BCM frames
//
// Revision R1A
module
SocketCAN_BCM_test
{
...
...
demo/SocketCAN_RAW_test.ttcn
View file @
77a50aac
...
...
@@ -11,7 +11,7 @@
// File: SocketCAN_RAW_test.ttcn
// Description: SocketCAN testcases for CAN_RAW frames
//
// Revision R1A
module
SocketCAN_RAW_test
...
...
demo/SocketCAN_broken_tests.cfg
View file @
77a50aac
...
...
@@ -9,7 +9,7 @@
# Michael Josenhans
##############################################################################
// Revision R1A
[LOGGING]
FileMask := LOG_ALL
...
...
demo/SocketCANtest.ttcn
View file @
77a50aac
...
...
@@ -11,7 +11,7 @@
// File: SocketCANtest.ttcn
// Description: SocketCAN port type test
//
// Revision R1A
module
SocketCANtest
{
...
...
demo/initscript.sh
View file @
77a50aac
...
...
@@ -9,7 +9,7 @@
# Michael Josenhans
##############################################################################
# Revision R1A
#!/bin/bash
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment