Skip to content
Snippets Groups Projects
Commit f439c66a authored by Kristof Szabados's avatar Kristof Szabados
Browse files

updated descriptor locations.


Signed-off-by: default avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent ffe8f7d3
No related branches found
No related tags found
No related merge requests found
......@@ -166,6 +166,11 @@ public void decode(final TTCN_Typedescriptor p_td,
----
Parameter `p_td` is a special type descriptor. Each type has its own descriptor, which contains the name of the type, and a lot of information used by the different encoding mechanisms. The names of the descriptors come from the name of the types: the appropriate type descriptor for type `XXX is XXX_descr_`.
This descriptor can be found in the generated code:
* complex types (record, set, record of, set of, arrays, etc..): generated into the body of the class representing the type.
* types for which no code is generated (for example record of integer): generated into the body of the class representing the module of the type.
* built in types (for example integer): in the body of the classes representing the type (for example TitanInteger in the runtime).
Parameter `p_buf` contains the encoded value. For details about using it, please consult the previous subsection.
......@@ -277,7 +282,7 @@ Then we can complete the port skeleton generated by the compiler as follows:
----
protected void outgoing_send(final ProtocolPdu send_par) {
final TTCN_Buffer buffer = new TTCN_Buffer();
send_par.encode(Bug.ProtocolPdu_descr_, buffer, TTCN_EncDec.coding_type.CT_RAW, 0);
send_par.encode(MyModule.ProtocolPdu.ProtocolPdu_descr_, buffer, TTCN_EncDec.coding_type.CT_RAW, 0);
final TitanOctetString encodedData = new TitanOctetString();
buffer.get_string(encodedData);
incoming_message(encodedData);
......@@ -288,7 +293,7 @@ protected void outgoing_send(final TitanOctetString send_par) {
final TTCN_Buffer buffer = new TTCN_Buffer();
buffer.put_os(send_par);
final ProtocolPdu pdu = new ProtocolPdu();
pdu.decode(Bug.ProtocolPdu_descr_, buffer, TTCN_EncDec.coding_type.CT_RAW, 0);
pdu.decode(MyModule.ProtocolPdu.ProtocolPdu_descr_, buffer, TTCN_EncDec.coding_type.CT_RAW, 0);
incoming_message(pdu);
}
----
......@@ -447,7 +452,7 @@ Then we can complete the port skeleton generated by the compiler:
void MyPort1.outgoing_send(final ProtocolPdu send_par)
{
final TTCN_Buffer buffer = new TTCN_Buffer();
send_par.encode(ProtocolPdu.ProtocolPdu_descr_, buffer, TTCN_EncDec.coding_type.CT_JSON, 0);
send_par.encode(MyModule.ProtocolPdu.ProtocolPdu_descr_, buffer, TTCN_EncDec.coding_type.CT_JSON, 0);
final TitanOctetString encodedData = new TitanOctetString();
buffer.get_string(encodedData);
incoming_message(encodedData);
......@@ -459,7 +464,7 @@ void MyPort2.outgoing_send(final TitanOctetString send_par)
final TTCN_Buffer buffer = new TTCN_Buffer();
buffer.put_os(send_par);
final ProtocolPdu pdu = new ProtocolPdu();
pdu.decode(Bug.ProtocolPdu_descr_, buffer, TTCN_EncDec.coding_type.CT_JSON, 0);
pdu.decode(MyModule.ProtocolPdu.ProtocolPdu_descr_, buffer, TTCN_EncDec.coding_type.CT_JSON, 0);
incoming_message(pdu);
}
----
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment