From 70fa960771aecee7cc9c07c0786c5b5641e7ae08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 25 Mar 2014 08:44:34 +0100 Subject: Remove all uses of the deprecated asn1{ct,rt}:{en,de}code/2 functions --- lib/asn1/doc/src/asn1_ug.xml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/asn1/doc/src/asn1_ug.xml b/lib/asn1/doc/src/asn1_ug.xml index dfa8db32dd..fb379214fc 100644 --- a/lib/asn1/doc/src/asn1_ug.xml +++ b/lib/asn1/doc/src/asn1_ug.xml @@ -335,10 +335,6 @@ asn1ct:compile("H323-MESSAGES.asn1",[ber]). asn1ct:compile("H323-MESSAGES.asn1",[per]).

The generic encode and decode functions can be invoked like this:

-asn1ct:encode('H323-MESSAGES','SomeChoiceType',{call,"octetstring"}).
-asn1ct:decode('H323-MESSAGES','SomeChoiceType',Bytes).      
-

Or, preferable like:

-
 'H323-MESSAGES':encode('SomeChoiceType',{call,"octetstring"}).
 'H323-MESSAGES':decode('SomeChoiceType',Bytes).      
@@ -466,7 +462,7 @@ Operational ::= BOOLEAN --ASN.1 definition

In Erlang code it may look like:

 Val = true,
-{ok,Bytes}=asn1rt:encode(MyModule,'Operational',Val),    
+{ok,Bytes} = MyModule:encode('Operational', Val),

Below follows a description of how values of each type can be represented in Erlang.

@@ -731,17 +727,17 @@ TextFileVal2 = [88,76,55,44,99,121 .......... a lot of characters here ....] BMP ::= BMPString then using BER encoding (ber option)the input/output format will be:

-1> {ok,Bytes1} = asn1rt:encode('PrimStrings','BMP',[{0,0,53,53},{0,0,45,56}]).
+1> {ok,Bytes1} = 'PrimStrings':encode('BMP', [{0,0,53,53},{0,0,45,56}]).
 {ok,[30,4,"55-8"]}
-2> asn1rt:decode('PrimStrings','BMP',list_to_binary(Bytes1)).
+2> 'PrimStrings':decode('BMP', list_to_binary(Bytes1)).
 {ok,[{0,0,53,53},{0,0,45,56}]}
-3> {ok,Bytes2} = asn1rt:encode('PrimStrings','BMP',[{0,0,53,53},{0,0,0,65}]).
+3> {ok,Bytes2} = 'PrimStrings':encode('BMP', [{0,0,53,53},{0,0,0,65}]).
 {ok,[30,4,[53,53,0,65]]}
-4> asn1rt:decode('PrimStrings','BMP',list_to_binary(Bytes2)).
+4> 'PrimStrings':decode('BMP', list_to_binary(Bytes2)).
 {ok,[{0,0,53,53},65]}
-5> {ok,Bytes3} = asn1rt:encode('PrimStrings','BMP',"BMP string").
+5> {ok,Bytes3} = 'PrimStrings':encode('BMP', "BMP string").
 {ok,[30,20,[0,66,0,77,0,80,0,32,0,115,0,116,0,114,0,105,0,110,0,103]]}
-6> asn1rt:decode('PrimStrings','BMP',list_to_binary(Bytes3)).
+6> 'PrimStrings':decode('BMP', list_to_binary(Bytes3)).
 {ok,"BMP string"}      

The UTF8String is represented in Erlang as a list of integers, where each integer represents the unicode value of one -- cgit v1.2.3