rename to tlv8_encode_calculate_len()
This commit is contained in:
1 parent
99e9d2e36b
commit
30316870d3
3 files changed
+4
-4
No files matched your search
@@ -96,7 +96,7 @@ TLV8_t tlv8_decode_next(uint8_t const** pp_data, uint16_t* p_len, void* buf, uin
|
||||
return tlv;
|
||||
}
|
||||
|
||||
uint16_t tlv8_calculate_encode_len(TLV8_t tlv_para[], uint8_t count)
|
||||
uint16_t tlv8_encode_calculate_len(TLV8_t tlv_para[], uint8_t count)
|
||||
{
|
||||
uint16_t total_len = 0;
|
||||
for(uint8_t i=0; i <count ; i++)
|
||||
@@ -147,7 +147,7 @@ uint16_t tlv8_encode_n(uint8_t* buf, uint16_t bufsize, TLV8_t tlv[], uint8_t cou
|
||||
HAPResponse_t* createHapResponse(uint8_t tid, uint8_t status, TLV8_t tlv_para[], uint8_t count)
|
||||
{
|
||||
// Determine body len, does not to include 2 byte length itself
|
||||
uint16_t body_len = tlv8_calculate_encode_len(tlv_para, count);
|
||||
uint16_t body_len = tlv8_encode_calculate_len(tlv_para, count);
|
||||
HAPResponse_t* hap_resp = (HAPResponse_t*) rtos_malloc(sizeof(HAPResponseHeader_t) + 2 + body_len);
|
||||
VERIFY( hap_resp != NULL, NULL );
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ TLV8_t tlv8_decode_next(uint8_t const** pp_data, uint16_t* p_len, void* buf =
|
||||
bool tlv8_encode_next(uint8_t** pp_buf, uint16_t* p_buflen, TLV8_t tlv);
|
||||
|
||||
uint16_t tlv8_encode_n(uint8_t* buf, uint16_t bufsize, TLV8_t tlv[], uint8_t count);
|
||||
uint16_t tlv8_calculate_encode_len(TLV8_t tlv_para[], uint8_t count);
|
||||
uint16_t tlv8_encode_calculate_len(TLV8_t tlv_para[], uint8_t count);
|
||||
|
||||
HAPResponse_t* createHapResponse(uint8_t tid, uint8_t status, TLV8_t tlv_para[] = NULL, uint8_t count = 0);
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ HAPResponse_t* createSrpResponse(uint8_t tid, uint8_t status, TLV8_t ktlv[], uin
|
||||
{
|
||||
HAPResponse_t* hap_resp = NULL;
|
||||
|
||||
uint16_t srplen = tlv8_calculate_encode_len(ktlv, count);
|
||||
uint16_t srplen = tlv8_encode_calculate_len(ktlv, count);
|
||||
uint8_t* srpbuf = (uint8_t*) rtos_malloc(srplen);
|
||||
VERIFY( srpbuf != NULL, NULL );
|
||||
|
||||
|
||||
Reference in new issue
Block a user