Giter VIP home page Giter VIP logo

isotp-c's Issues

Arbitration for transmit messages.

I do not see where transmits are able to clear the transmit status.
It appears there may need to be a receive loop that processes the arbitration messages from the receiver during a transmit sequence. Transmit works with a small frame (7 bytes or less) that requires no arbitration.

In addition, I do not see where the uint32_t receive_arbitration_id is ever used.

Documentation bug; timeout in millis instead of microseconds

Reported by Mark,

There is a bug in the documentation concerning the timer values.

I am confused as to whether the return should be in milliseconds or microseconds as both units are referred to in the documentation.

In the code:

        link->send_timer_st = isotp_user_get_us();

In the documentation:

/* required, return system tick, unit is millisecond */
uint32_t isotp_user_get_ms(void) {
    // ...
}

Never executed else if branch in time calculation

The if condition here

if (us <= 127000) {
will always be true before the else if branch
} else if (us >= 100 && us <= 900) {
could ever become true.

I propose:

/* st_min to microsecond */
static uint8_t isotp_us_to_st_min(uint32_t us) {
    if (us <= 127000) {
        if (us >= 100 && us <= 900) 
        {
            return 0xF0 + (us / 100);
        } 
        else 
        {
            return us / 1000;
        }
    }
    return 0;
}

[Edit:] Same here:

isotp-c/isotp.c

Lines 21 to 25 in 5ddce32

if (st_min <= 0x7F) {
return st_min * 1000;
} else if (st_min >= 0xF1 && st_min <= 0xF9) {
return (st_min - 0xF0) * 100;
}

Building a static library unnecessarily forces adoption of PIC (position independent code)

Hi,

I'm in the process of integrating isotp-c into a microcontroller project.

We're using CMake so have included the project as a subdirectory setting the isotpc_STATIC_LIBRARY configuration option.

As noted in the project README, position independent code (PIC) is always forced on:

-fPIC

I was hoping to understand the rationale behind this, as it's typically only required for dynamic libraries.

Additionally flagging the target_compile_options as public means they're propagated to dependencies. Causing build options to sort of "leak" out of the library into the modules which link to it.

isotp PUBLIC

In our case our startup code doesn't include any support for PIC, as everything is statically linked. I was surprised to find the system crashing at startup, having linked in isotp-c. Seems its compile definitions had spread and attempted to enable PIC on the module which links to the library causing the system to crash as PIC wasn't properly setup.

For the moment I've just commented out the PIC option but was hoping to submit a PR. Either to make it configurable via cmake, or to only include it when requesting a shared library be built.

I'd propose to make the other compile options private, such that they're only applied to the isotp-c library itself. They're not bad in terms of what they're looking to do. We've got everything but -Wno-unknown-pragmas turned on ourselves already, so aside from PIC didn't really notice them. They probably shouldn't be forced upon the wider project as a whole though.

Would appreciate your thoughts.

Great work on continuing the development of the library btw!

Thanks,

Phil

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.