Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » usage of LENGTHTO and UNIT(elements)(usage of LENGTHTO and UNIT(elements))
usage of LENGTHTO and UNIT(elements) [message #1853081] Fri, 17 June 2022 02:15 Go to next message
lou ban is currently offline lou banFriend
Messages: 17
Registered: June 2020
Junior Member
as the struct in the images

what I do is use noOfPktFillter represent the count of packetFilterList elements,
But whatever I do, the decoded struct show noOfPktFillter := '0000'B, while in the encodedNasMessage, which should be '0010'B

do I has a wrong usage of LENGTHTO and UNIT(elements)?


thanks very much

[Updated on: Fri, 17 June 2022 02:17]

Report message to a moderator

Re: usage of LENGTHTO and UNIT(elements) [message #1853084 is a reply to message #1853081] Fri, 17 June 2022 06:01 Go to previous messageGo to next message
Gábor Szalai is currently offline Gábor SzalaiFriend
Messages: 138
Registered: December 2015
Senior Member
The order of the fields are wrong, Either change the order of the fields in the type definition or apply the FIELDORDER variant.

By default the RAW encoder puts the fields into the octet right to left direction.

Re: usage of LENGTHTO and UNIT(elements) [message #1853086 is a reply to message #1853084] Fri, 17 June 2022 06:25 Go to previous messageGo to next message
lou ban is currently offline lou banFriend
Messages: 17
Registered: June 2020
Junior Member
thanks for your reply

But this doesnot work

I have configured this way before
type record TrafficFlowTemplate{
    IEI8_Type        iei    optional,
    Type4Length_Type    iel,
    B3_Type        tftOperationCode,
    B1_Type         eBit,
    B4_Type        noOfPktFilter,
    record of PacketFilter    packetFilterList    optional,
    record of TftParameter    parameterList    optional,
}with{
    variant    (iel)    "LENGTHTO(tftOperationCode, eBit, noOfPktFilter,  packetFilterList, parameterList)"

    variant    (tftOperationCode, eBit, noOfPktFilter)    "FIELDORDER(msb)"

    variant    (parameterList)    "PRESENCE(eBit = '1'B)

    variant (noOfPktFilter)    "LENGTHTO(packetFilterList)"
    variant (noOfpktFilter)    "UNIT(elements)"
}


BUT no matter what the encoded code is, the noOfPktFilter will be decoded as '0000'B, and packetFilterList is omit

it seems the statements
    variant (noOfPktFilter)    "LENGTHTO(packetFilterList)"
    variant (noOfpktFilter)    "UNIT(elements)"

affects the decoding of noOfPktFilter

Re: usage of LENGTHTO and UNIT(elements) [message #1853088 is a reply to message #1853086] Fri, 17 June 2022 06:48 Go to previous messageGo to next message
Gábor Szalai is currently offline Gábor SzalaiFriend
Messages: 138
Registered: December 2015
Senior Member
The LENGTHTO and the UNIT can't effect the decoding of the noOfPktFilter field only the packetFilterList. Are the value of the tftOperationCode and eBit correct?

Please change the order of the fields in the type definition.

The FIELDORDER attribute is not transitive, practically it effects only the basic types.
Re: usage of LENGTHTO and UNIT(elements) [message #1853089 is a reply to message #1853088] Fri, 17 June 2022 06:54 Go to previous messageGo to next message
Gábor Szalai is currently offline Gábor SzalaiFriend
Messages: 138
Registered: December 2015
Senior Member
If the LinkedEpsBearerId is not "type bit4 LinkedEpsBearerId" it won't be encoded/decoded as you think.

Re: usage of LENGTHTO and UNIT(elements) [message #1853091 is a reply to message #1853089] Fri, 17 June 2022 09:17 Go to previous messageGo to next message
lou ban is currently offline lou banFriend
Messages: 17
Registered: June 2020
Junior Member
it still puzzles me

let me show the difference

if I configure as
type record TrafficFlowTemplate{
    IEI8_Type        iei    optional,
    Type4Length_Type    iel,
    B3_Type        tftOperationCode,
    B1_Type         eBit,
    B4_Type        noOfPktFilter,
    record of PacketFilter    packetFilterList    optional,
    record of TftParameter    parameterList    optional,
}with{
    variant    (iel)    "LENGTHTO(tftOperationCode, eBit, noOfPktFilter,  packetFilterList, parameterList)"

    variant    (tftOperationCode, eBit, noOfPktFilter)    "FIELDORDER(msb)"

    variant    (parameterList)    "PRESENCE(eBit = '1'B)

    variant (noOfPktFilter)    "LENGTHTO(packetFilterList)"
    variant (noOfpktFilter)    "UNIT(elements)"
}


then the decoded situation show in decoded_with_UNIT.jpg

if I configure as
type record TrafficFlowTemplate{
    IEI8_Type        iei    optional,
    Type4Length_Type    iel,
    B3_Type        tftOperationCode,
    B1_Type         eBit,
    B4_Type        noOfPktFilter,
    record of PacketFilter    packetFilterList    optional,
    record of TftParameter    parameterList    optional,
}with{
    variant    (iel)    "LENGTHTO(tftOperationCode, eBit, noOfPktFilter,  packetFilterList, parameterList)"

    variant    (tftOperationCode, eBit, noOfPktFilter)    "FIELDORDER(msb)"

    variant    (parameterList)    "PRESENCE(eBit = '1'B)

    // variant (noOfPktFilter)    "LENGTHTO(packetFilterList)"
    // variant (noOfpktFilter)    "UNIT(elements)"
}


then the decoded situation show in decoded_without_UNIT.jpg

there is no other different except the above configuration

you can ignore the decoding of the previous part (outside the red frame), and the LinkedEpsBearerId is 4 bit

and I cannot change the order of the fields, This is explicit in the protocol documentation

[Updated on: Fri, 17 June 2022 09:33]

Report message to a moderator

Re: usage of LENGTHTO and UNIT(elements) [message #1853092 is a reply to message #1853091] Fri, 17 June 2022 10:27 Go to previous messageGo to next message
Gábor Szalai is currently offline Gábor SzalaiFriend
Messages: 138
Registered: December 2015
Senior Member
The handling of the bitstring as length field is broken.

Please change the type of the length field to integer.
Re: usage of LENGTHTO and UNIT(elements) [message #1853132 is a reply to message #1853092] Mon, 20 June 2022 03:38 Go to previous messageGo to next message
lou ban is currently offline lou banFriend
Messages: 17
Registered: June 2020
Junior Member
thank you very much

I solved the problem by changing the type of the length field to integer
Re: usage of LENGTHTO and UNIT(elements) [message #1853160 is a reply to message #1853132] Tue, 21 June 2022 07:13 Go to previous message
Gábor Szalai is currently offline Gábor SzalaiFriend
Messages: 138
Registered: December 2015
Senior Member
The correction has been merged into the TITAN repository.
Previous Topic:usage of PRESENCE
Next Topic:JSON decode error - float values
Goto Forum:
  


Current Time: Wed Nov 06 18:24:47 GMT 2024

Powered by FUDForum. Page generated in 0.04032 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top