VSDC up to CDOL2 calc

This commit is contained in:
merlokk 2019-01-10 18:33:21 +02:00
commit eaedf7f811
3 changed files with 30 additions and 1 deletions

View file

@ -469,7 +469,10 @@ const struct tlv *tlvdb_get_inchild(const struct tlvdb *tlvdb, tlv_tag_t tag, co
}
const struct tlv *tlvdb_get_tlv(const struct tlvdb *tlvdb) {
return &tlvdb->tag;
if (tlvdb)
return &tlvdb->tag;
else
return NULL;
}
unsigned char *tlv_encode(const struct tlv *tlv, size_t *len)
@ -546,6 +549,13 @@ struct tlvdb *tlvdb_elm_get_parent(struct tlvdb *tlvdb)
return tlvdb->parent;
}
bool tlvdb_get_uint8(struct tlvdb *tlvRoot, tlv_tag_t tag, uint8_t *value)
{
const struct tlvdb *tlvdb = tlvdb_get(tlvRoot, tag, NULL);
const struct tlv *tlvelm = tlvdb_get_tlv(tlvdb);
return tlv_get_uint8(tlvelm, value);
}
bool tlv_get_uint8(const struct tlv *etlv, uint8_t *value)
{
*value = 0;