A server application for 5G-ERA Network Applications. Contains the basic implementation of the server (server.py).
- era-5g-client - client classes for 5G-ERA Network Applications with various transport options.
- era-5g-interface - python interface (support classes) for Network Applications.
- Reference-NetApp - reference 5G-ERA Network Application implementation with MMCV detector.
The package could be installed via pip:
pip install era_5g_server
NetworkApplicationServer (server.py)
Basic implementation of the 5G-ERA Network Application server. It creates websocket server (socketio.Server, socketio.WSGIApp) and bind callbacks from the 5G-ERA Network Application.
How to send data? E.g.:
client.send_image(frame, "image", ChannelType.H264, timestamp, encoding_options=h264_options, sid=sid)
client.send_image(frame, "image", ChannelType.JPEG, timestamp, metadata, sid)
client.send_data({"message": "message text"}, "event_name", sid=sid)
client.send_data({"message": "message text"}, "event_name", ChannelType.JSON_LZ4, sid=sid)
How to create callbacks_info
? E.g.:
{
"results": CallbackInfoServer(ChannelType.JSON, results_callback),
"image": CallbackInfoServer(ChannelType.H264, image_callback, error_callback)
}
Callbacks have sid and data parameter: e.g. def image_callback(sid: str, data: Dict[str, Any]):
.
Image data dict including decoded frame (data["frame"]
) and send timestamp (data["timestamp"]
).
Methods command_callback
and disconnect_callback
can can be defined (redefined) within and inherited class or can
be set by parameters in NetworkApplicationServer class.
- The package is developed and tested with Python 3.8.
- Any contribution should go through a pull request from your fork.
- We use Pants to manage the code (how to install it).
- Before committing, please run locally:
pants fmt ::
- format all code according to our standard.pants lint ::
- checks formatting and few more things.pants check ::
- runs type checking (mypy).pants test ::
- runs Pytest tests.
- The same checks will be run within CI.
- A virtual environment with all necessary dependencies can be generated using
pants export ::
. You may then activate the environment and addera_5g_server
to yourPYTHONPATH
, which is equivalent to installing a package usingpip install -e
. - To generate distribution packages (
tar.gz
andwhl
), you may runpants package ::
. - For commit messages, please stick to https://www.conventionalcommits.org/en/v1.0.0/.