OSS NAS Tools for C# for LTE/EPC for 3GPP Release 17.9.0
Oss.Nas1790.NasCodec Class Reference

NasCodec can

More...

Inheritance diagram for Oss.Nas1790.NasCodec:
Oss.Nas.NasCodecBase< NASMessage >

Public Member Functions

 NasCodec ()
 Initializes a new instance of NasCodec.
 
NASMessage Decode (byte[] message)
 Decodes a NASMessage message from a buffer. More...
 
NASMessage Decode (byte[] message, int offset, int length)
 Decodes a NASMessage message from a buffer. More...
 
- Public Member Functions inherited from Oss.Nas.NasCodecBase< NASMessage >
String DecodeToJSON (byte[] nasMessage)
 Converts a binary NAS message to a JSON value. More...
 
String DecodeToJSON (byte[] nasMessage, int offset, int length)
 Converts a binary NAS message to a JSON value. More...
 
String DecodeToXML (byte[] nasMessage)
 Converts a binary NAS message to an XML document. More...
 
String DecodeToXML (byte[] nasMessage, int offset, int length)
 Converts a binary NAS message to an XML document. More...
 
String DecodeToText (byte[] nasMessage)
 Converts a binary NAS message to ASN.1 value notation format. More...
 
String DecodeToText (byte[] nasMessage, int offset, int length)
 Converts a binary NAS message to ASN.1 value notation format. More...
 
byte[] Encode (T nasMessage)
 Encodes a C# object that represents a NAS message into binary bytes. The byte[] that receives the binary bytes is allocated dynamically. More...
 
String PrintJSON (T nasMessage)
 Converts a C# object that represents a NAS message to a JSON value. Unlike the decodeToJSON method, it does not throw an exception when the C# object has semantic errors, but returns a null string. You can use the Diagnostics property to retrieve a diagnostic report in that case. More...
 
String PrintXML (T nasMessage)
 Converts a C# object that represents a NAS message to an XML document. Unlike the decodeToXML method, it does not throw an exception when the C# object has semantic errors, but returns a null string. You can use the Diagnostics property to retrieve a diagnostic report in that case. More...
 
String PrintMessage (T nasMessage)
 Converts a C# object that represents a NAS message into ASN.1 value notation format. Unlike the decodeToText method, it does not throw an exception when the C# object has semantic errors but returns a null string. You can use the Diagnostics property to retrieve a diagnostic report in that case. More...
 

Additional Inherited Members

- Properties inherited from Oss.Nas.NasCodecBase< NASMessage >
Originator Originator [get, set]
 Identifies the originator of a NAS message. Some NAS messages can originate only from the network, while other NAS messages can be sent only by the UE.
 
bool HasDiagnostics [get]
 Indicates whether the most recent invocation of the codec API revealed defects in the NAS message.
 
Diagnostics Diagnostics [get]
 Returns a diagnostic report created by the most recent invocation of the codec API. If the operation aborted due to an exception, the diagnostic report returned is identical to the diagnostics reported by the diagnostics() method of NASException. Even when the exception is not thrown, the operation can return a non-empty report because the encoder or decoder detected non-critical defects that did not cause it to treat a message as invalid.
 
JSONOptions JSONOptions [get]
 Specifies formatting options that are used when a NAS message is converted to JSON format.
 
XMLOptions XMLOptions [get]
 Specifies formatting options that are used when a NAS message is converted to an XML document.
 
TextOptions TextOptions [get]
 Specifies formatting options that are used when a NAS message is converted to ASN.1 value notation format.
 

Detailed Description

NasCodec can

  • Print a binary NASMessage message in JSON, XML, or ASN.1 value notation format.
  • Decode a binary NASMessage message into a C# object.
  • Encode a C# object that represents a NASMessage message into binary octets.
  • Print a C# object that represents a NASMessage message in JSON, XML, or ASN.1 value notation format.

Member Function Documentation

◆ Decode() [1/2]

NASMessage Oss.Nas1790.NasCodec.Decode ( byte[]  message)
inline

Decodes a NASMessage message from a buffer.

Parameters
messageThe input buffer containing the encoded NASMessage message.
Returns
A C# object representing the decoded NASMessage message.
Exceptions
T:Oss.Nas.NASDecodeFailedExceptionWhen the decoding fails because the binary message is syntactically invalid and cannot be decoded.

◆ Decode() [2/2]

NASMessage Oss.Nas1790.NasCodec.Decode ( byte[]  message,
int  offset,
int  length 
)
inline

Decodes a NASMessage message from a buffer.

Parameters
messageThe input buffer containing the encoded NASMessage message.
offsetThe offset in the buffer where the message starts.
lengthThe length of the binary message in bytes.
Returns
A C# object representing the decoded NASMessage message.
Exceptions
T:Oss.Nas.NASDecodeFailedExceptionWhen decoding fails because the binary message is syntactically invalid and cannot be decoded.