Welcome,
Guest
|
TOPIC:
any type of message 01 Sep 2007 15:48 #7206
|
Hi, I have a doubt concerning to access a field in a record of any type
of message. For example, I have a union type that can be : Setup, CallProc, etc... All messages have a field called CallReference. And I want to know the CallReference value, it does not matter if it is a setup or callProc message. Is there any other way instead of using "ischosen" for all possible messages? Something like : anytype.CallReference. Thanks, Adriana |
Please Log in to join the conversation. |
any type of message 03 Sep 2007 08:30 #7207
|
Hi Adriana,
the only way if you define a "top-level" message like type record DSS1Message { octetstring protDiscriminator length (1), bitstring reserved length (4), bitstring callReference length (12), bitstring reserved1 length (1), bitstring messageType length (7), union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body } In this case the "message types" differ in the value of the messageType field and in their body only. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Saturday, September 01, 2007 5:49 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: any type of message Hi, I have a doubt concerning to access a field in a record of any type of message. For example, I have a union type that can be : Setup, CallProc, etc... All messages have a field called CallReference. And I want to know the CallReference value, it does not matter if it is a setup or callProc message. Is there any other way instead of using "ischosen" for all possible messages? Something like : anytype.CallReference. Thanks, Adriana |
Please Log in to join the conversation. |
any type of message 03 Sep 2007 09:58 #7210
|
Hi Gyorgy, thanks for your answer.
If I change the format of DSS1Message, probably I'll need to change the functions: external function enc_PDU_DSS1(in PDU_DSS1 pdu) return octetstring; external function dec_PDU_DSS1(in octetstring stream) return PDU_DSS1; If so, how can I change that functions? Thanks, Adriana ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: Monday, September 03, 2007 5:30 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Adriana, the only way if you define a "top-level" message like type record DSS1Message { octetstring protDiscriminator length (1), bitstring reserved length (4), bitstring callReference length (12), bitstring reserved1 length (1), bitstring messageType length (7), union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body } In this case the "message types" differ in the value of the messageType field and in their body only. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Saturday, September 01, 2007 5:49 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: any type of message Hi, I have a doubt concerning to access a field in a record of any type of message. For example, I have a union type that can be : Setup, CallProc, etc... All messages have a field called CallReference. And I want to know the CallReference value, it does not matter if it is a setup or callProc message. Is there any other way instead of using "ischosen" for all possible messages? Something like : anytype.CallReference. Thanks, Adriana |
Please Log in to join the conversation. |
any type of message 03 Sep 2007 10:18 #7211
|
Hi,
not the TTCN-3 declaration of the external functions (youn should call your top-level PDU " PDU_DSS1" to align it with the external functions declaration. If the functions are written in C++, for example, you shall sort the message bodies according to the message type field by a switch/case construct and call the decoding functions for the different message bodies. This is not a problem at messahe decoding either as the place of the message type field is fix (but even if it was not fix, you could find it by decoding the fields before it step-by-step. In other languages it is similar, maybe you have to use a series of if/else -s to sort the bodies based on the message type field. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Monday, September 03, 2007 11:58 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, thanks for your answer. If I change the format of DSS1Message, probably I'll need to change the functions: external function enc_PDU_DSS1(in PDU_DSS1 pdu) return octetstring; external function dec_PDU_DSS1(in octetstring stream) return PDU_DSS1; If so, how can I change that functions? Thanks, Adriana ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: Monday, September 03, 2007 5:30 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Adriana, the only way if you define a "top-level" message like type record DSS1Message { octetstring protDiscriminator length (1), bitstring reserved length (4), bitstring callReference length (12), bitstring reserved1 length (1), bitstring messageType length (7), union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body } In this case the "message types" differ in the value of the messageType field and in their body only. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Saturday, September 01, 2007 5:49 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: any type of message Hi, I have a doubt concerning to access a field in a record of any type of message. For example, I have a union type that can be : Setup, CallProc, etc... All messages have a field called CallReference. And I want to know the CallReference value, it does not matter if it is a setup or callProc message. Is there any other way instead of using "ischosen" for all possible messages? Something like : anytype.CallReference. Thanks, Adriana |
Please Log in to join the conversation. |
any type of message 03 Sep 2007 10:24 #7212
|
Hi Gyorgy,
A small comment: You should change ‘message’ to something else, as ‘message’ is a TTCN-3 keyword. :-) The example you give will not compile correctly. Cheers, Claude. union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body Blue Cactus Consulting phone: +49 (0)30 9606 7985 Edinburger Str. 39 fax: +49 (0)30 9606 7987 13349 Berlin mobile: +49 (0)174 701 6792 Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it. _____ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: 03 September 2007 12:18 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi, not the TTCN-3 declaration of the external functions (youn should call your top-level PDU " PDU_DSS1" to align it with the external functions declaration. If the functions are written in C++, for example, you shall sort the message bodies according to the message type field by a switch/case construct and call the decoding functions for the different message bodies. This is not a problem at messahe decoding either as the place of the message type field is fix (but even if it was not fix, you could find it by decoding the fields before it step-by-step. In other languages it is similar, maybe you have to use a series of if/else -s to sort the bodies based on the message type field. BR, Gyorgy _____ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Monday, September 03, 2007 11:58 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, thanks for your answer. If I change the format of DSS1Message, probably I’ll need to change the functions: external function enc_PDU_DSS1(in PDU_DSS1 pdu) return octetstring; external function dec_PDU_DSS1(in octetstring stream) return PDU_DSS1; If so, how can I change that functions? Thanks, Adriana _____ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: Monday, September 03, 2007 5:30 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Adriana, the only way if you define a "top-level" message like type record DSS1Message { octetstring protDiscriminator length (1), bitstring reserved length (4), bitstring callReference length (12), bitstring reserved1 length (1), bitstring messageType length (7), union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body } In this case the "message types" differ in the value of the messageType field and in their body only. BR, Gyorgy _____ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Saturday, September 01, 2007 5:49 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: any type of message Hi, I have a doubt concerning to access a field in a record of any type of message. For example, I have a union type that can be : Setup, CallProc, etc… All messages have a field called CallReference. And I want to know the CallReference value, it does not matter if it is a setup or callProc message. Is there any other way instead of using “ischosen” for all possible messages? Something like : anytype.CallReference. Thanks, Adriana |
Please Log in to join the conversation. |
any type of message 03 Sep 2007 10:27 #7213
|
Of corse the space was not meant there, the field name is messageBody.
BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Claude Desroches Sent: Monday, September 03, 2007 12:25 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, A small comment: You should change 'message' to something else, as 'message' is a TTCN-3 keyword. :-) The example you give will not compile correctly. Cheers, Claude. union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body Blue Cactus Consulting phone: +49 (0)30 9606 7985 Edinburger Str. 39 fax: +49 (0)30 9606 7987 13349 Berlin mobile: +49 (0)174 701 6792 Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it. ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: 03 September 2007 12:18 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi, not the TTCN-3 declaration of the external functions (youn should call your top-level PDU " PDU_DSS1" to align it with the external functions declaration. If the functions are written in C++, for example, you shall sort the message bodies according to the message type field by a switch/case construct and call the decoding functions for the different message bodies. This is not a problem at messahe decoding either as the place of the message type field is fix (but even if it was not fix, you could find it by decoding the fields before it step-by-step. In other languages it is similar, maybe you have to use a series of if/else -s to sort the bodies based on the message type field. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Monday, September 03, 2007 11:58 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, thanks for your answer. If I change the format of DSS1Message, probably I'll need to change the functions: external function enc_PDU_DSS1(in PDU_DSS1 pdu) return octetstring; external function dec_PDU_DSS1(in octetstring stream) return PDU_DSS1; If so, how can I change that functions? Thanks, Adriana ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: Monday, September 03, 2007 5:30 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Adriana, the only way if you define a "top-level" message like type record DSS1Message { octetstring protDiscriminator length (1), bitstring reserved length (4), bitstring callReference length (12), bitstring reserved1 length (1), bitstring messageType length (7), union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body } In this case the "message types" differ in the value of the messageType field and in their body only. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Saturday, September 01, 2007 5:49 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: any type of message Hi, I have a doubt concerning to access a field in a record of any type of message. For example, I have a union type that can be : Setup, CallProc, etc... All messages have a field called CallReference. And I want to know the CallReference value, it does not matter if it is a setup or callProc message. Is there any other way instead of using "ischosen" for all possible messages? Something like : anytype.CallReference. Thanks, Adriana |
Please Log in to join the conversation. |
any type of message 03 Sep 2007 10:41 #7214
|
Ah! :-)
Cheers, Claude. Blue Cactus Consulting phone: +49 (0)30 9606 7985 Edinburger Str. 39 fax: +49 (0)30 9606 7987 13349 Berlin mobile: +49 (0)174 701 6792 Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it. _____ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: 03 September 2007 12:27 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Of corse the space was not meant there, the field name is messageBody. BR, Gyorgy _____ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Claude Desroches Sent: Monday, September 03, 2007 12:25 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, A small comment: You should change ‘message’ to something else, as ‘message’ is a TTCN-3 keyword. :-) The example you give will not compile correctly. Cheers, Claude. union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body Blue Cactus Consulting phone: +49 (0)30 9606 7985 Edinburger Str. 39 fax: +49 (0)30 9606 7987 13349 Berlin mobile: +49 (0)174 701 6792 Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it. _____ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: 03 September 2007 12:18 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi, not the TTCN-3 declaration of the external functions (youn should call your top-level PDU " PDU_DSS1" to align it with the external functions declaration. If the functions are written in C++, for example, you shall sort the message bodies according to the message type field by a switch/case construct and call the decoding functions for the different message bodies. This is not a problem at messahe decoding either as the place of the message type field is fix (but even if it was not fix, you could find it by decoding the fields before it step-by-step. In other languages it is similar, maybe you have to use a series of if/else -s to sort the bodies based on the message type field. BR, Gyorgy _____ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Monday, September 03, 2007 11:58 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, thanks for your answer. If I change the format of DSS1Message, probably I’ll need to change the functions: external function enc_PDU_DSS1(in PDU_DSS1 pdu) return octetstring; external function dec_PDU_DSS1(in octetstring stream) return PDU_DSS1; If so, how can I change that functions? Thanks, Adriana _____ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: Monday, September 03, 2007 5:30 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Adriana, the only way if you define a "top-level" message like type record DSS1Message { octetstring protDiscriminator length (1), bitstring reserved length (4), bitstring callReference length (12), bitstring reserved1 length (1), bitstring messageType length (7), union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body } In this case the "message types" differ in the value of the messageType field and in their body only. BR, Gyorgy _____ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Saturday, September 01, 2007 5:49 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: any type of message Hi, I have a doubt concerning to access a field in a record of any type of message. For example, I have a union type that can be : Setup, CallProc, etc… All messages have a field called CallReference. And I want to know the CallReference value, it does not matter if it is a setup or callProc message. Is there any other way instead of using “ischosen” for all possible messages? Something like : anytype.CallReference. Thanks, Adriana |
Please Log in to join the conversation. |
any type of message 03 Sep 2007 12:46 #7215
|
Hi Gyorgy,
I've coded as you said: type union PDU_DSS1 { DSS1_message dss1Message } type record DSS1_message { BIT8 escape optional, OCT1 protocolDiscriminator ('08'O), DSS1_CallReference callReference, PDU_DSS1_msgBody messageBody } type union PDU_DSS1_msgBody { PDU_DSS1_Alerting alerting, PDU_DSS1_CallProceeding callProceeding, PDU_DSS1_CongestionControl congestionControl, PDU_DSS1_Connect dss1_connect, PDU_DSS1_ConnectAcknowledge connectAcknowledge, PDU_DSS1_Disconnect dss1_disconnect, PDU_DSS1_Facility facility, PDU_DSS1_Hold hold, PDU_DSS1_HoldAcknowledge holdAcknowledge, So, PDU_DSS1 is still the hole message, but I had an error while executing: Dynamic test case error: Internal error: While RAW-encoding type '@DSS1_Types.PDU_DSS1': No RAW descriptor available for type '@DSS1_Types.PDU_DSS1'. Thanks, Adriana ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: Monday, September 03, 2007 7:27 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Of corse the space was not meant there, the field name is messageBody. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Claude Desroches Sent: Monday, September 03, 2007 12:25 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, A small comment: You should change 'message' to something else, as 'message' is a TTCN-3 keyword. :-) The example you give will not compile correctly. Cheers, Claude. union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body Blue Cactus Consulting phone: +49 (0)30 9606 7985 Edinburger Str. 39 fax: +49 (0)30 9606 7987 13349 Berlin mobile: +49 (0)174 701 6792 Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it. ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: 03 September 2007 12:18 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi, not the TTCN-3 declaration of the external functions (youn should call your top-level PDU " PDU_DSS1" to align it with the external functions declaration. If the functions are written in C++, for example, you shall sort the message bodies according to the message type field by a switch/case construct and call the decoding functions for the different message bodies. This is not a problem at messahe decoding either as the place of the message type field is fix (but even if it was not fix, you could find it by decoding the fields before it step-by-step. In other languages it is similar, maybe you have to use a series of if/else -s to sort the bodies based on the message type field. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Monday, September 03, 2007 11:58 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, thanks for your answer. If I change the format of DSS1Message, probably I'll need to change the functions: external function enc_PDU_DSS1(in PDU_DSS1 pdu) return octetstring; external function dec_PDU_DSS1(in octetstring stream) return PDU_DSS1; If so, how can I change that functions? Thanks, Adriana ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: Monday, September 03, 2007 5:30 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Adriana, the only way if you define a "top-level" message like type record DSS1Message { octetstring protDiscriminator length (1), bitstring reserved length (4), bitstring callReference length (12), bitstring reserved1 length (1), bitstring messageType length (7), union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body } In this case the "message types" differ in the value of the messageType field and in their body only. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Saturday, September 01, 2007 5:49 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: any type of message Hi, I have a doubt concerning to access a field in a record of any type of message. For example, I have a union type that can be : Setup, CallProc, etc... All messages have a field called CallReference. And I want to know the CallReference value, it does not matter if it is a setup or callProc message. Is there any other way instead of using "ischosen" for all possible messages? Something like : anytype.CallReference. Thanks, Adriana |
Please Log in to join the conversation. |
any type of message 03 Sep 2007 13:07 #7216
|
Hi,
My proposal was type record PDU_DSS1 { BIT8 escape optional, OCT1 protocolDiscriminator ('08'O), DSS1_CallReference callReference, PDU_DSS1_msgBody messageBody } type union PDU_DSS1_msgBody { PDU_DSS1_Alerting alerting, PDU_DSS1_CallProceeding callProceeding, PDU_DSS1_CongestionControl congestionControl, PDU_DSS1_Connect dss1_connect, PDU_DSS1_ConnectAcknowledge connectAcknowledge, PDU_DSS1_Disconnect dss1_disconnect, PDU_DSS1_Facility facility, PDU_DSS1_Hold hold, PDU_DSS1_HoldAcknowledge holdAcknowledge } There is no union with a single alternative, this makes no sense. You are, of course getting an error message if has not changed your codec to the new TTCN-3 message structure. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Monday, September 03, 2007 2:47 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, I've coded as you said: type union PDU_DSS1 { DSS1_message dss1Message } type record DSS1_message { BIT8 escape optional, OCT1 protocolDiscriminator ('08'O), DSS1_CallReference callReference, PDU_DSS1_msgBody messageBody } type union PDU_DSS1_msgBody { PDU_DSS1_Alerting alerting, PDU_DSS1_CallProceeding callProceeding, PDU_DSS1_CongestionControl congestionControl, PDU_DSS1_Connect dss1_connect, PDU_DSS1_ConnectAcknowledge connectAcknowledge, PDU_DSS1_Disconnect dss1_disconnect, PDU_DSS1_Facility facility, PDU_DSS1_Hold hold, PDU_DSS1_HoldAcknowledge holdAcknowledge, So, PDU_DSS1 is still the hole message, but I had an error while executing: Dynamic test case error: Internal error: While RAW-encoding type '@DSS1_Types.PDU_DSS1': No RAW descriptor available for type '@DSS1_Types.PDU_DSS1'. Thanks, Adriana ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: Monday, September 03, 2007 7:27 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Of corse the space was not meant there, the field name is messageBody. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Claude Desroches Sent: Monday, September 03, 2007 12:25 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, A small comment: You should change 'message' to something else, as 'message' is a TTCN-3 keyword. :-) The example you give will not compile correctly. Cheers, Claude. union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body Blue Cactus Consulting phone: +49 (0)30 9606 7985 Edinburger Str. 39 fax: +49 (0)30 9606 7987 13349 Berlin mobile: +49 (0)174 701 6792 Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it. ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: 03 September 2007 12:18 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi, not the TTCN-3 declaration of the external functions (youn should call your top-level PDU " PDU_DSS1" to align it with the external functions declaration. If the functions are written in C++, for example, you shall sort the message bodies according to the message type field by a switch/case construct and call the decoding functions for the different message bodies. This is not a problem at messahe decoding either as the place of the message type field is fix (but even if it was not fix, you could find it by decoding the fields before it step-by-step. In other languages it is similar, maybe you have to use a series of if/else -s to sort the bodies based on the message type field. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Monday, September 03, 2007 11:58 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Gyorgy, thanks for your answer. If I change the format of DSS1Message, probably I'll need to change the functions: external function enc_PDU_DSS1(in PDU_DSS1 pdu) return octetstring; external function dec_PDU_DSS1(in octetstring stream) return PDU_DSS1; If so, how can I change that functions? Thanks, Adriana ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy (IJ/ETH) Sent: Monday, September 03, 2007 5:30 AM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: any type of message Hi Adriana, the only way if you define a "top-level" message like type record DSS1Message { octetstring protDiscriminator length (1), bitstring reserved length (4), bitstring callReference length (12), bitstring reserved1 length (1), bitstring messageType length (7), union { SetupBody setup, CallProcBody callproc, // ... ReleaseCompleteBody relComp } message Body } In this case the "message types" differ in the value of the messageType field and in their body only. BR, Gyorgy ________________________________ From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Adriana K. Kawai Sent: Saturday, September 01, 2007 5:49 PM To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: any type of message Hi, I have a doubt concerning to access a field in a record of any type of message. For example, I have a union type that can be : Setup, CallProc, etc... All messages have a field called CallReference. And I want to know the CallReference value, it does not matter if it is a setup or callProc message. Is there any other way instead of using "ischosen" for all possible messages? Something like : anytype.CallReference. Thanks, Adriana |
Please Log in to join the conversation. |