Ejemplo n.º 1
0
void Header::SetDefaultResponseHeader(const Header &aRequestHeader)
{
    Init(OT_COAP_TYPE_ACKNOWLEDGMENT, OT_COAP_CODE_CHANGED);
    SetMessageId(aRequestHeader.GetMessageId());
    SetToken(aRequestHeader.GetToken(), aRequestHeader.GetTokenLength());
}
Ejemplo n.º 2
0
 /**
  *  This method checks if Tokens in two CoAP headers are equal.
  *
  *  @param[in]  aHeader  A header to compare.
  *
  * @retval TRUE   If two Tokens are equal.
  * @retval FALSE  If Tokens differ in length or value.
  *
  */
 bool IsTokenEqual(const Header &aHeader) const {
     return ((this->GetTokenLength() == aHeader.GetTokenLength()) &&
             (memcmp(this->GetToken(), aHeader.GetToken(), this->GetTokenLength()) == 0));
 }