Lines Matching refs:rec

1596 			 struct dirlisting_record_t *rec)  in decode_record()  argument
1600 rec->len = net_buf_simple_pull_le16(buf); in decode_record()
1602 if (rec->len > buf->len) { in decode_record()
1605 rec->len, buf->len); in decode_record()
1609 if ((start_len - buf->len) + BT_OTS_OBJ_ID_SIZE > rec->len) { in decode_record()
1612 rec->len); in decode_record()
1616 rec->metadata.id = net_buf_simple_pull_le48(buf); in decode_record()
1621 (void)bt_ots_obj_id_to_str(rec->metadata.id, t, sizeof(t)); in decode_record()
1625 if ((start_len - buf->len) + sizeof(uint8_t) > rec->len) { in decode_record()
1628 rec->len); in decode_record()
1632 rec->name_len = net_buf_simple_pull_u8(buf); in decode_record()
1634 if (rec->name_len > 0) { in decode_record()
1637 if ((start_len - buf->len) + rec->name_len > rec->len) { in decode_record()
1640 rec->len - (start_len - buf->len), in decode_record()
1641 rec->name_len); in decode_record()
1645 if (rec->name_len >= sizeof(rec->metadata.name_c)) { in decode_record()
1646 LOG_WRN("Name length %u too long, invalid record", rec->name_len); in decode_record()
1650 name = net_buf_simple_pull_mem(buf, rec->name_len); in decode_record()
1651 memcpy(rec->metadata.name_c, name, rec->name_len); in decode_record()
1654 rec->metadata.name_c[rec->name_len] = '\0'; in decode_record()
1655 rec->flags = 0; in decode_record()
1657 if ((start_len - buf->len) + sizeof(uint8_t) > rec->len) { in decode_record()
1659 "does not include flags", rec->len); in decode_record()
1663 rec->flags = net_buf_simple_pull_u8(buf); in decode_record()
1664 LOG_DBG("flags 0x%x", rec->flags); in decode_record()
1666 if (BT_OTS_DIR_LIST_GET_FLAG_TYPE_128(rec->flags)) { in decode_record()
1669 if ((start_len - buf->len) + BT_UUID_SIZE_128 > rec->len) { in decode_record()
1672 rec->len); in decode_record()
1673 LOG_INF("flags 0x%x", rec->flags); in decode_record()
1678 if (!bt_uuid_create(&rec->metadata.type.uuid, uuid, BT_UUID_SIZE_128)) { in decode_record()
1683 if ((start_len - buf->len) + BT_UUID_SIZE_16 > rec->len) { in decode_record()
1686 rec->len); in decode_record()
1687 LOG_INF("flags 0x%x", rec->flags); in decode_record()
1691 rec->metadata.type.uuid_16.val = in decode_record()
1695 if (BT_OTS_DIR_LIST_GET_FLAG_CUR_SIZE(rec->flags)) { in decode_record()
1696 if ((start_len - buf->len) + sizeof(uint32_t) > rec->len) { in decode_record()
1699 rec->len); in decode_record()
1700 LOG_INF("flags 0x%x", rec->flags); in decode_record()
1704 rec->metadata.size.cur = net_buf_simple_pull_le32(buf); in decode_record()
1707 if (BT_OTS_DIR_LIST_GET_FLAG_ALLOC_SIZE(rec->flags)) { in decode_record()
1708 if ((start_len - buf->len) + sizeof(uint32_t) > rec->len) { in decode_record()
1711 rec->len); in decode_record()
1712 LOG_INF("flags 0x%x", rec->flags); in decode_record()
1716 rec->metadata.size.alloc = net_buf_simple_pull_le32(buf); in decode_record()
1719 if (BT_OTS_DIR_LIST_GET_FLAG_FIRST_CREATED(rec->flags)) { in decode_record()
1720 if ((start_len - buf->len) + BT_OTS_DATE_TIME_FIELD_SIZE > rec->len) { in decode_record()
1723 rec->len); in decode_record()
1724 LOG_INF("flags 0x%x", rec->flags); in decode_record()
1728 date_time_decode(buf, &rec->metadata.first_created); in decode_record()
1731 if (BT_OTS_DIR_LIST_GET_FLAG_LAST_MODIFIED(rec->flags)) { in decode_record()
1732 if ((start_len - buf->len) + BT_OTS_DATE_TIME_FIELD_SIZE > rec->len) { in decode_record()
1735 rec->len); in decode_record()
1736 LOG_INF("flags 0x%x", rec->flags); in decode_record()
1740 date_time_decode(buf, &rec->metadata.modified); in decode_record()
1743 if (BT_OTS_DIR_LIST_GET_FLAG_PROPERTIES(rec->flags)) { in decode_record()
1744 if ((start_len - buf->len) + sizeof(uint32_t) > rec->len) { in decode_record()
1747 rec->len); in decode_record()
1748 LOG_INF("flags 0x%x", rec->flags); in decode_record()
1752 rec->metadata.props = net_buf_simple_pull_le32(buf); in decode_record()
1755 return rec->len; in decode_record()