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

Re-implement EnumMember::hasValue() #159

Merged

Conversation

dpfrey
Copy link
Contributor

@dpfrey dpfrey commented Jan 22, 2021

Issue #41 describes a problem where an enum value of -1 causes a failure
of an assertion in erpcgen. The new version of hasValue uses a bool
member variable to track when the value is set rather than using a
sentinel value of -1.

Issue EmbeddedRPC#41 describes a problem where an enum value of -1 causes a failure
of an assertion in erpcgen. The new version of hasValue uses a bool
member variable to track when the value is set rather than using a
sentinel value of -1.
@dpfrey dpfrey mentioned this pull request Jan 22, 2021
@MichalPrincNXP
Copy link
Member

Hello @dpfrey , I am sorry for late response, please give me some time for the review, I would like to have a look at it next week.

@MichalPrincNXP
Copy link
Member

Thank you, @dpfrey , your changes seem to be reasonable. @Hadatko , do you support this PR integration?

@Hadatko
Copy link
Member

Hadatko commented Feb 10, 2021

I never saw negative numbers in enums before, that was why it was solved that way. But now i know that it wasn't best solution. So thank you for this PR. Looks correct.

@MichalPrincNXP
Copy link
Member

Thank you @dpfrey for this bugfix and @Hadatko for the review. I will merge this PR and in addition I will add some new test case to cover this use case.

@MichalPrincNXP MichalPrincNXP merged commit f8110fb into EmbeddedRPC:develop Feb 11, 2021
MichalPrincNXP added a commit that referenced this pull request May 7, 2021
-- Update erpcgen and unit tests to cover the case when enum member value is negative (Github #159 PR / #41 issue solving).
-- Update (D)SPI transport layers to avoid busy loops in rtos environments, introduce semaphores.
-- Introduced new transports: i2c_slave_transport (C/C++), LIBUSBSIOSPITransport (Python), LIBUSBSIOI2CTransport (Python).
-- Remove const qualifier from InterThreadBufferTransport::send method parameter to align with parent Transport class (GitHub issue #172).
-- Allow conditional compilation of message_loggers and pre_post_action to help to reduce the code size when compiler does not correctly strip unused code.
-- Minor documentation updates.
-- Version changed to 1.8.1.
@dpfrey dpfrey deleted the pr_EnumMember_hasValue branch May 13, 2021 21:17
danderson-presonus pushed a commit to PreSonusAudioElectronics/erpc that referenced this pull request Jul 9, 2021
* transport arbitrator: override Transport::hasMessage

Override the default implementation of hasMessage from Transport with a
version that calls through to the hasMessage of the shared transport
that the transport arbitrator is using.

* Fixed doxygen comments.

* Replace deprecating error verbose declaration

* Use token keywords instead of values.

* Add option to put void in function declaration (no paramaters case).

* Fixing several misra issues in shim code.

* First minor changes

* Infra folder did more misra complaint.

* Port folder did more misra complaint.

* Transport folder did more misra complaint.

* Setup folder did more misra complaint.

* Fix  ERPC_THREADS_IS(ERPC_THREADS_NONE) macro to ERPC_THREADS_IS(NONE)

* Fix tcp transport.

* Fixed pytest issues related to latest changes.

* Fix build issue.

* Update (C)

* Re-implement EnumMember::hasValue()

Issue EmbeddedRPC#41 describes a problem where an enum value of -1 causes a failure
of an assertion in erpcgen. The new version of hasValue uses a bool
member variable to track when the value is set rather than using a
sentinel value of -1.

* Fixes based on PR review

* Fixes based on PR review

* fix hidding unused wariables

* Align dspi code with spi

* Fix Typ in comment

* Fully automate dev setup with Gitpod

This commit implements a fully-automated development setup using Gitpod.io, an
online IDE for GitLab, GitHub, and Bitbucket that enables Dev-Environments-As-Code.
This makes it easy for anyone to get a ready-to-code workspace for any branch,
issue or pull request almost instantly with a single click.

* Initial support for Threading/ThreadX and building with CMake

* Added auto-config supoort for Threading/ThreadX

* eRPC updates 05/2021

-- Update erpcgen and unit tests to cover the case when enum member value is negative (Github EmbeddedRPC#159 PR / EmbeddedRPC#41 issue solving).
-- Update (D)SPI transport layers to avoid busy loops in rtos environments, introduce semaphores.
-- Introduced new transports: i2c_slave_transport (C/C++), LIBUSBSIOSPITransport (Python), LIBUSBSIOI2CTransport (Python).
-- Remove const qualifier from InterThreadBufferTransport::send method parameter to align with parent Transport class (GitHub issue EmbeddedRPC#172).
-- Allow conditional compilation of message_loggers and pre_post_action to help to reduce the code size when compiler does not correctly strip unused code.
-- Minor documentation updates.
-- Version changed to 1.8.1.

* * Added separate erpc_port_threadx.cpp for ThreadX support
* Removed CMakeLists.txt

* Assert that m_sharedTransport is set before use

* Copyright year update

* Fixing Travis build fails

* - fix compiler warnings and use extended files in the build

* Linux -> RTOS working, but RTOS -> Linux not

* Fix the eRPC TTY RTOS transport so that it correctly handles sending the return values of service functions back to the caller

* adding extended files to build

* handle linux tty driver initial "hello world!" message slightly more gracefully

* Created an #ifdef'd alternate version of base class RPMsgBaseTransport who's member variables are not static.
This enables clean creation of multiple transport instances to support multiple endpoints on the same system.

The original base class used static member variables and a templated instantiation system to make make static allocation
"appear" like dynamic allocation at the user interface.  The problem is it in effect acted like an unprotected singleton,
so you could instantiate multiple instances, but the member data would get overwritten since it was static.

This paves the way for "full duplex" function calls utilizing two separate endpoints.

* Make serial transport non-blocking to faciliate multi threading

* - yield to sleep for lower cpu usage

* adding comments

* revert thread sleep modification to erpc_serial_transport.cpp, change private variables in class SerialTransport from protected to private to allow extension

* bring in name changes

* Update CMakeLists.txt

Co-authored-by: David Frey <dfrey@sierrawireless.com>
Co-authored-by: Dusan Cervenka <Cervenka.dusan@gmail.com>
Co-authored-by: Cervenka Dusan <cervenka@acrios.com>
Co-authored-by: Michal Princ <michal.princ@nxp.com>
Co-authored-by: aelray <aelray@gmail.com>
Co-authored-by: werner-dk <werner.hirtsiefer@dormakaba.com>
Co-authored-by: Ibrahim ERTURK <ierturk@ieee.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants