Lines Matching refs:resp
1148 coap_pdu_t *resp; in coap_wellknown_response() local
1158 resp = coap_pdu_init(request->hdr->type == COAP_MESSAGE_CON in coap_wellknown_response()
1163 if (!resp) { in coap_wellknown_response()
1168 if (!coap_add_token(resp, request->hdr->token_length, request->hdr->token)) { in coap_wellknown_response()
1180 resp->hdr->code = COAP_RESPONSE_CODE(400); in coap_wellknown_response()
1181 resp->length = sizeof(coap_hdr_t) + resp->hdr->token_length; in coap_wellknown_response()
1182 return resp; in coap_wellknown_response()
1190 resp->hdr->code = COAP_RESPONSE_CODE(400); in coap_wellknown_response()
1191 return resp; in coap_wellknown_response()
1204 if (resp->max_size <= (size_t)resp->length + 3) { in coap_wellknown_response()
1213 coap_add_option(resp, COAP_OPTION_CONTENT_FORMAT, in coap_wellknown_response()
1218 if (!need_block2 && (resp->max_size - (size_t)resp->length < wkc_len)) { in coap_wellknown_response()
1219 assert(resp->length <= resp->max_size); in coap_wellknown_response()
1220 const size_t payloadlen = resp->max_size - resp->length; in coap_wellknown_response()
1239 if (coap_write_block_opt(&block, COAP_OPTION_BLOCK2, resp, wkc_len) < 0) { in coap_wellknown_response()
1248 resp->data = (unsigned char *)resp->hdr + resp->length; in coap_wellknown_response()
1249 *resp->data = COAP_PAYLOAD_START; in coap_wellknown_response()
1250 resp->data++; in coap_wellknown_response()
1251 resp->length++; in coap_wellknown_response()
1252 len = need_block2 ? SZX_TO_BYTES(block.szx) : resp->max_size - resp->length; in coap_wellknown_response()
1254 result = coap_print_wellknown(context, resp->data, &len, offset, query_filter); in coap_wellknown_response()
1260 resp->length += COAP_PRINT_OUTPUT_LENGTH(result); in coap_wellknown_response()
1261 return resp; in coap_wellknown_response()
1265 resp->hdr->code = COAP_RESPONSE_CODE(503); in coap_wellknown_response()
1266 resp->length = sizeof(coap_hdr_t) + resp->hdr->token_length; in coap_wellknown_response()
1267 return resp; in coap_wellknown_response()