Skip to content

lo-han/echo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

echo-lib

Echo request and reply message lib

Infrastructure options

Coming soon (ICMP)

Usage example

    Listener listener = NewMockListener();

    StartListening(listener); // Sync

    DestroyListener(&listener);

Build

Currently echo doesn't implement any communication protocol, and for that reason a mock is being used

mkdir obj
make

Tests

Run unit tests

cd tests
python3 run_tests.py

Run static checks

cd tests
python3 run_static_check.py

Contribute

Any idea or improvement is welcome. Feel free to branch and Pull Request for contributions, just, please, don't commit directly to develop or main histories. You can also get in contact with 'lohan.chuan123@gmail.com' or fork the repository.

Porting

The following must be implemented to add echo a new protocol type

  • New<PROTOCOL>Listener (macro)
  • <PROTOCOL>StartReceiving (function)
  • <PROTOCOL>Flush (function)

Implementation example.

Header:

#define NewMockListener() NewListener(&MockStartReceiving, &MockFlush)

/********************************************************************
 * This function receives a message and forwards to Listener
 *
 * Outputs:
 *  - Message
 ********************************************************************/
Message MockStartReceiving();

/********************************************************************
 * This function flushes a message to an output
 *
 * Inputs:
 *  - Message
 ********************************************************************/
void MockFlush(Message message);