intel / intel/tinycbor

Feature: parser function for string access by pointer

Open
#125 14 comments 2 reactions 1 assignee Claimed by @thiagomacieira View on GitHub
Dominant language
C
Stars
630
Forks
222
Avg merge
1d 3h
Merged PRs (30d)
1

Description

I have a few use cases where I have a CBOR stream with a rather large byte strings. Having a function to get a pointer and length to these byte string would help saving some memory as a buffer to temporarily copy the data to is not required. Something like
```
CborError cbor_value_get_byte_string(CborValue *value, uint8_t **result, size_t *len);
```
would be perfect. This could return an `CborErrorUnknownLength` when a chunked string is passed.

My main use case is a COSE library where I want to retrieve the payload without having to copy the to another buffer. Simply accessing it with a pointer is preferred to save memory on a constraint device.

I'm willing to contribute the code myself, but I need a few pointers on how to get the pointer to the actual data.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.