Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QCBOREncode_Init buffer #62

Closed
janemba opened this issue Nov 25, 2020 · 1 comment
Closed

QCBOREncode_Init buffer #62

janemba opened this issue Nov 25, 2020 · 1 comment

Comments

@janemba
Copy link

janemba commented Nov 25, 2020

Hi,

This is not an issue but I don't know where I can ask question about the API.

So I am trying to use qcbor using a simple structure but it's difficult to understand how the API works just by reading the source. I'm stuck in the beginning with the second parameter of QCBOREncode_Init function.

This parameter is supposed to be the buffer after encoding. Looking at example.c and test/qcbor_encode_tests.c the size of the buffer doesn't seem to be calculated. For one case, the declaration is static uint8_t spBigBuf[2200] and for the other case MakeUsefulBufOnStack( EngineBuffer, 300).

Is there a way to give the real size for the buffer ?

I have another question. In which case should I use MakeUsefulBufOnStack or UsefulBuf_FROM_BYTE_ARRAY ?

laurencelundblade added a commit that referenced this issue Dec 1, 2020
Improve the documentation for QCBOREncode_Init() and QCBOREncode_Finish().

replace all use of the deprecated macro MakeUsefulBufOnStack().

Address #62 

Co-authored-by: Laurence Lundblade <lgl@securitytheory.com>
@laurencelundblade
Copy link
Owner

See if the improved documentation and sample code from #65 helps this for you.

Appreciate the comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants