erpc icon indicating copy to clipboard operation
erpc copied to clipboard

Md5 methodId instead of unsigned int counter

Open kikass13 opened this issue 4 years ago • 1 comments

related issue

  • https://github.com/EmbeddedRPC/erpc/issues/201

General

I hacked together a simple solution (and cleaned up the underlying frame generation a little) for utilizing md5 generated hashes for message Ids, which allows to assign/distribute different messages across multiple endpoints inside 1:n (or n:n) topologic network.

it is more costly (traffic and computational), but allows a more flexible approach for different types of underlying transport networks. The current erpc implementation cannot safely distribute messages across different endpoints.

This is a proof of concept and should contain all the necessary changes (it's actually not that much) and the "important" is actually contained inside the erpcgen tool (which is basically a sandbox for 'somewhat questionable' code practices anyways, as far as I can tell) :)

Stuff that should not be here

There are also some changes in here which are not part of the overall solution to the problem, but are there because the develop branch seems to have some "not building on my system" problems, mainly:

  • Makefile
  • erpc_c/port/erpc_threading_pthreads.cpp

These can be cherry picked if necessary (or fixed in the actual develop branch)

TLDR

  • slight cleanup of erpc frame header generation
  • md5 hash containing function prototype <T foo(T, T...)> in erpcgen
  • md5 hash as methodId client code adaptation
  • md5 hash as methodId server code adaptation
  • it uses constepxr if because enums are pretty much useless here
    • so there have to be some changes when only looking at older C (++) stuff

kikass13 avatar Oct 07 '21 09:10 kikass13

Again, thank you @kikass13 for your effort. Let us try and evaluate.

MichalPrincNXP avatar Oct 15 '21 09:10 MichalPrincNXP