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

NasCodec can

More...

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

Public Member Functions

 NasCodec ()
 Initializes a new instance of NasCodec. More...
 
NASMessage Decode (byte[] message)
 Decodes a NAS message from a buffer. More...
 
NASMessage Decode (byte[] message, int offset, int length)
 Decodes a NAS 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. More...
 
bool HasDiagnostics [get]
 Indicates whether the most recent invocation of the NasCodec API revealed defects in the NAS message. More...
 
Diagnostics Diagnostics [get]
 Returns a diagnostic report created by the most recent invocation of the NasCodec 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. More...
 
JSONOptions JSONOptions [get]
 Specifies formatting options that are used when a NAS message is converted to JSON format. More...
 
XMLOptions XMLOptions [get]
 Specifies formatting options that are used when a NAS message is converted to an XML document. More...
 
TextOptions TextOptions [get]
 Specifies formatting options that are used when a NAS message is converted to ASN.1 value notation format. More...
 

Detailed Description

NasCodec can

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

Constructor & Destructor Documentation

◆ NasCodec()

Oss.Nas1660.NasCodec.NasCodec ( )
inline

Initializes a new instance of NasCodec.

Member Function Documentation

◆ Decode() [1/2]

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

Decodes a NAS message from a buffer.

Parameters
messageThe input buffer containing the encoded NAS message.
Returns
A C# object representing the decoded NAS 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.Nas1660.NasCodec.Decode ( byte[]  message,
int  offset,
int  length 
)
inline

Decodes a NAS message from a buffer.

Parameters
messageThe input buffer containing the encoded NAS 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 NAS message.
Exceptions
T:Oss.Nas.NASDecodeFailedExceptionWhen decoding fails because the binary message is syntactically invalid and cannot be decoded.