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

IrDecoder::decode(char *buffer, std::uint64_t length) ignores function parameters. #643

Closed
jsarbakatmarketfactorydotcom opened this issue Feb 6, 2019 · 1 comment

Comments

@jsarbakatmarketfactorydotcom

I would like to use this decode method (listed below), however it ignores the provided buffer. The subsequent call to decodeIr() munges an m_buffer pointing to null memory.

I don't want to have to call the file-based decode method.

It's an operational hassle to have to reference an sbeir file everytime a tool needs it. It would be much simpler if (c++ based) tools could simply reference the sbeir file contents that is embedded in the program. But to do this, one must be able to pass an sbeir bytearray into a decode method that doesn't ignore it.

Would you please provide a way to pass in the buffer and length to the decode method? Perhaps an overloaded version of decode will do.

Thank you.
Joe

int decode(char *buffer, std::uint64_t length)
{
m_length = length;
return decodeIr();
}

tmontgomery added a commit that referenced this issue Feb 6, 2019
@tmontgomery
Copy link
Contributor

tmontgomery commented Feb 6, 2019

The method should now be usable.

However, you do realize that:

  1. The SBEIR file must be generated for use by C++ anyway (as opposed to Java, which could get away without using a file and instead use the schema directly), and
  2. That the IrDecoder object is meant to be reused between messages, etc. and should only need to be decoded once

@mjpt777 mjpt777 closed this as completed Jun 25, 2019
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

3 participants