SNMP 2.0.0
Loading...
Searching...
No Matches
SNMP::Base Class Reference

Base class for BER, Length and Type. More...

#include <src/BER.h>

Inheritance diagram for SNMP::Base:
[legend]

Public Member Functions

void encode7bits (uint32_t value, uint8_t *buffer, const uint8_t size)
 Encodes integer value to memory buffer.
 

Static Public Member Functions

static void encode7bits (uint32_t value, Stream &stream, const uint8_t size)
 Encodes integer value to stream.
 

Protected Attributes

unsigned int _size = 0
 

Friends

class BER
 

Detailed Description

Base class for BER, Length and Type.

This abstract class is the base class for all BER objects.

Definition at line 219 of file BER.h.

Member Function Documentation

◆ encode7bits() [1/2]

static void SNMP::Base::encode7bits ( uint32_t value,
Stream & stream,
const uint8_t size )
inlinestatic

Encodes integer value to stream.

If the integer is greater than 127 (0x7F in hexadecimal) it is multibyte encoded with the following rules.

  • The integer bytes are encoded from MSB to LSB into bits 6 to 0 of each encoded bytes.
  • Bit 7 of each encoded bytes is set to 1, except for the last one where it is set to 0.
Parameters
valueInteger value to encode.
streamStream to write to.
sizeNumber of encoded bytes.

Definition at line 235 of file BER.h.

Referenced by SNMP::ObjectIdentifierBER::encode(), SNMP::ObjectIdentifierBER::encode(), SNMP::Type::encode(), and SNMP::Type::encode().

◆ encode7bits() [2/2]

void SNMP::Base::encode7bits ( uint32_t value,
uint8_t * buffer,
const uint8_t size )
inline

Encodes integer value to memory buffer.

If the integer is greater than 127 (0x7F in hexadecimal) it is multibyte encoded with the following rules.

  • The integer bytes are encoded from MSB to LSB into bits 6 to 0 of each encoded bytes.
  • Bit 7 of each encoded bytes is set to 1, except for the last one where it is set to 0.
Parameters
valueInteger value to encode.
bufferPointer to the buffer.
sizeNumber of encoded bytes.

Definition at line 254 of file BER.h.

Friends And Related Symbol Documentation

◆ BER

friend class BER
friend

Definition at line 267 of file BER.h.

Member Data Documentation

◆ _size


The documentation for this class was generated from the following file: