nl::Weave::Profiles::ReferencedTLVData

#include <src/lib/profiles/common/WeaveMessage.h>

마찬가지로 TLV 데이터의 오래된 blob을 나타낼 수 있어야 합니다.

요약

상속

상속 대상: nl::Weave::Profiles::RetainedPacketBuffer

생성자 및 소멸자

ReferencedTLVData(void)
-------------- TLV 데이터에 대한 정의 --------------

공개 유형

TLVWriteCallback)(TLV::TLVWriter &aWriter, void *aAppState) typedef
void(*

공개 속성

theData
uint8_t *
theLength
uint16_t
theMaxLength
uint16_t

공개 함수

free(void)
void
ReferencedTLVData 객체를 해제합니다. 즉, 객체를 정의 해제합니다.
init(System::PacketBuffer *aBuffer)
PacketBuffer가 지정된 ReferencedTLVData 객체를 초기화합니다.
init(MessageIterator & i)
MessageIterator가 지정된 ReferencedTLVData 객체를 초기화합니다.
init(uint16_t aLength, uint16_t aMaxLength, uint8_t *aByteString)
바이트 문자열을 고려하여 ReferencedTLVObject를 초기화합니다.
init(TLVWriteCallback aWriteCallback, void *anAppState)
콜백 함수가 지정된 RefererencedTLVData 객체를 초기화합니다.
isEmpty(void)
bool
ReferencedTLVData 객체에 항목이 있는지 확인합니다.
isFree(void)
bool
ReferencedTLVData 객체가 'free'(무료)인지 확인합니다.
operator==(const ReferencedTLVData &) const
bool
ReferencedTLVData 객체를 서로 비교하여 동일한지 확인합니다.
pack(System::PacketBuffer *buff)
ReferencedTLVData 객체를 PacketBuffer에 직접 패키징합니다.
pack(MessageIterator & i, uint32_t maxLen)
packedLength(void)
uint16_t
객체가 버퍼에 패킹되었다고 가정하고 데이터 길이를 반환합니다.

공개 정적 함수

parse(System::PacketBuffer *buff, ReferencedTLVData & aTarget)
제공된 PacketBuffer에서 ReferencedTLVData 객체를 파싱합니다.
parse(MessageIterator & i, ReferencedTLVData & aTarget)
제공된 MessageIterator에서 ReferencedTLVData 객체를 파싱합니다.

공개 유형

TLVWriteCallback

void(* TLVWriteCallback)(TLV::TLVWriter &aWriter, void *aAppState)

공개 속성

theData

uint8_t * theData

theLength

uint16_t theLength

theMaxLength

uint16_t theMaxLength

공개 함수

ReferencedTLVData

 ReferencedTLVData(
  void
)

-------------- TLV 데이터에 대한 정의 --------------

TLV 데이터의 인수가 없는 생성자입니다. 유용하려면 여기에 정의된 init() 메서드 중 하나를 따라야 하는 무료/초기화되지 않은 객체를 전달합니다.

무료

void free(
  void
)

ReferencedTLVData 객체를 해제합니다. 즉, 객체를 정의 해제합니다.

init

WEAVE_ERROR init(
  System::PacketBuffer *aBuffer
)

PacketBuffer가 지정된 ReferencedTLVData 객체를 초기화합니다.

TLV로 가득 찬 버퍼가 제공되는 경우 ReferencedTLVData 객체를 초기화합니다. 이때 버퍼에 TLV만 포함되어 있다고 가정합니다.

세부정보
매개변수
[in] aBuffer
TLV가 상주하는 메시지 버퍼입니다.
반환 값
WEAVE_NO_ERROR
무조건

init

WEAVE_ERROR init(
  MessageIterator & i
)

MessageIterator가 지정된 ReferencedTLVData 객체를 초기화합니다.

MessageIterator가 지정된 ReferencedTLVData 객체를 초기화합니다. 이 경우 TLV는 버퍼의 마지막 부분이며 이를 가리키는 메시지 반복자를 전달합니다.

세부정보
매개변수
[in] i
추출할 TLV를 가리키는 메시지 반복기입니다.
반환 값
WEAVE_NO_ERROR
무조건

init

WEAVE_ERROR init(
  uint16_t aLength,
  uint16_t aMaxLength,
  uint8_t *aByteString
)

바이트 문자열을 고려하여 ReferencedTLVObject를 초기화합니다.

TLV가 포함된 바이트 문자열로 ReferencedTLVData 객체를 초기화합니다. 이 이니셜라이저는 PacketrBuffer가 없을 때 사용하는 초기화 메서드입니다. PacketrBuffer가 없을 경우 이 이니셜라이저를 만들어 패키징하고 전송하기 때문입니다.

세부정보
매개변수
[in] aLength
TLV 데이터의 길이
[in] aMaxLength
버퍼의 총 길이
[in] aByteString
문자열 데이터에 대한 포인터
반환 값
WEAVE_NO_ERROR
무조건

init

WEAVE_ERROR init(
  TLVWriteCallback aWriteCallback,
  void *anAppState
)

콜백 함수가 지정된 RefererencedTLVData 객체를 초기화합니다.

ReferencedTLVData 객체를 초기화합니다. 이 버전은 데이터를 명시적으로 제공하는 대신 함수, 쓰기 콜백, 참조 객체를 제공합니다. 이 객체는 참조된 데이터를 압축하고 전송해야 할 때 TLVWriter 객체와 함께 전달됩니다. 이 콜백의 서명은 다음과 같습니다.

typedef void (*TLVWriteCallback)(TLV::TLVWriter &aWriter, void *aAppState);

세부정보
매개변수
[in] aWriteCallback
TLV를 작성할 때 호출할 함수입니다.
[in] anAppState
작성기와 함께 콜백에 전달할 애플리케이션 상태 객체.
반환 값
WEAVE_NO_ERROR
성공 시
WEAVE_ERROR_INVALID_ARGUMENT
쓰기 콜백이 제공되지 않은 경우

isEmpty

bool isEmpty(
  void
)

ReferencedTLVData 객체에 항목이 있는지 확인합니다.

이러한 객체가 무언가를 '갖고' 있을 수 있는 두 가지 방법이 있습니다. 길이가 0이거나 쓰기 콜백이 없을 수 있습니다.

세부정보
반환
데이터 세트의 길이가 0이거나 사용 중인 쓰기 콜백이 없으면 true, 그렇지 않은 경우 false입니다.

isFree

bool isFree(
  void
)

ReferencedTLVData 객체가 'free'(무료)인지 확인합니다.

정의되지 않았습니다.

세부정보
반환
객체가 정의되지 않은 경우 true, 그렇지 않은 경우 false입니다.

연산자==

bool operator==(
  const ReferencedTLVData &
) const 

ReferencedTLVData 객체를 서로 비교하여 동일한지 확인합니다.

이는 버퍼나 문자열로 뒷받침되는 실제 데이터가 있는 두 객체에만 의미가 있습니다.

세부정보
매개변수
[in] Another
확인할 객체
반환 값
true
객체가 동일합니다.
false
객체 문자열이 같지 않습니다.

WEAVE_ERROR pack(
  System::PacketBuffer *buff
)

ReferencedTLVData 객체를 PacketBuffer에 직접 패키징합니다.

세부정보
매개변수
[in] buff
채워야 합니다.
반환
기본 팩 호출의 성공을 반영하는 WEAVE_ERROR

WEAVE_ERROR pack(
  MessageIterator & i,
  uint32_t maxLen
)

packedLength

uint16_t packedLength(
  void
)

객체가 버퍼에 패킹되었다고 가정하고 데이터 길이를 반환합니다.

세부정보
반환
패킹된 데이터의 정수 길이.

공개 정적 함수

parse

WEAVE_ERROR parse(
  System::PacketBuffer *buff,
  ReferencedTLVData & aTarget
)

제공된 PacketBuffer에서 ReferencedTLVData 객체를 파싱합니다.

inet 버퍼에서 ReferencedTLVData 객체를 파싱합니다 (TLV만 포함되어 있다고 가정).

세부정보
매개변수
[in] buff
읽도록 할 버퍼입니다.
[out] aTarget
결과를 '채울' ReferencedTLVData 객체를 전달합니다.
반환
기본 파싱 호출의 성공을 반영하는 WEAVE_ERROR

parse

WEAVE_ERROR parse(
  MessageIterator & i,
  ReferencedTLVData & aTarget
)

제공된 MessageIterator에서 ReferencedTLVData 객체를 파싱합니다.

메시지의 TLV 부분을 가리키는 것으로 가정되는 MessageIterator 객체에서 ReferenceTLVData 객체를 파싱합니다.

TLV가 버퍼에 남아 있고 전혀 조작되지 않으므로 여기서는 실제 '파싱'이 실행되지 않습니다. 이 메서드는 주로 나중에 사용할 수 있도록 ReferencedTLVData 구조를 설정합니다.

세부정보
매개변수
[in] i
파싱되는 메시지의 이터레이터입니다.
[out] aTarget
파싱 결과를 저장할 위치입니다.
반환 값
WEAVE_NO_ERROR
무조건