Issue with unknow subtypes [solved] [message #1713444] |
Wed, 04 November 2015 08:57 |
Johannes Bro Messages: 56 Registered: June 2015 |
Member |
|
|
Hi all,
i contact with a strange behavior, see the comment at code:
import from LibMy_TypesAndValues all;
import from LibMy_Interface all;
/* Only this type will not be importet fom Lib, its strange */
type octetstring octet length(1);
/* Templates */
template MyDLLheader mDLLh(integer l, octet c):={
leng := l,
controllField := c,
manufacturerID := '86CE'O,
originatorAddress := '01000080'O,
version := '23'O,
typ := '07'O
};
...
Here the LibMy_TypesAndValues.ttcn:
module LibMy_TypesAndValues
{
type octetstring MyAddress length (4);
type octetstring MyMfield length (2);
type octetstring MyCRC length (2);
type octetstring MySignature length (2);
type octetstring octet length (1);
type record MyDLLheader
{
integer leng,
octet controllField,
MyMfield manufacturerID,
MyAddress originatorAddress,
octet version,
octet typ
}with { variant "" }
...
Any idea ?
br Johannes
[Updated on: Wed, 04 November 2015 10:03] Report message to a moderator
|
|
|
|
Re: Issue with unknow subtypes [message #1713456 is a reply to message #1713444] |
Wed, 04 November 2015 09:25 |
|
Hi Johannes,
what is the error message you get ?
I tried
module mod2
{
import from LibMy_TypesAndValues all;
/* Only this type will not be importet fom Lib, its strange */
//type octetstring octet length(1);
/* Templates */
template MyDLLheader mDLLh(integer l, octet c):={
leng := l,
controllField := c,
manufacturerID := '86CE'O,
originatorAddress := '01000080'O,
version := '23'O,
typ := '07'O
};
template octet t_octet:='AA'O;
}
and it compiled with no problem, so octet is imported.
What makes you think it is not?
Best regards
Elemer
|
|
|
Re: Issue with unknow subtypes [message #1713464 is a reply to message #1713456] |
Wed, 04 November 2015 09:54 |
Johannes Bro Messages: 56 Registered: June 2015 |
Member |
|
|
Hi,
sorry its was to less explanation. It's not like you thought. But your answers helped me to find the mistake.
I need this redefinition of octet subtype otherwise it wasn't compilable. This message occur: It is not possible to resolve this reference unambigously, as it can be resolved to `@LibInterTestsys_TypesAndValues.octet' and to `@LibMys_TypesAndValues.octet'.
I did import another Lib on a other place witch also contain also a octet type...
The solution is to use another Lib for types which i need on more as one point. Then I just import this Lib.
Thank you very much for you fast reply and sorry for this mistake...
best regards
[Updated on: Wed, 04 November 2015 09:56] Report message to a moderator
|
|
|
Re: Issue with unknow subtypes [message #1713472 is a reply to message #1713464] |
Wed, 04 November 2015 11:42 |
|
Hi Johannes, great news.
If you have a type defined with the same name in several modules , you can refer them differentiatedly by using the module name as a prefix:
in your case octet refers to the type octet defined in the same module, while LibMys_TypesAndValues.octet refers to the type octet defined in the module LibMys_TypesAndValues.
So it's not compulsory to rename the type, but you have to face the expense of longer references.
Best regards
Elemer
|
|
|
Powered by
FUDForum. Page generated in 0.02103 seconds