Coder Social home page Coder Social logo

peterdeherdt / rbus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lgirdk/rbus

0.0 1.0 0.0 1.26 MB

mirror of https://code.rdkcentral.com/r/#/admin/projects/components/opensource/rbus

License: Apache License 2.0

CMake 4.05% C 87.87% Shell 0.65% C++ 7.44%

rbus's Introduction

Rbus

RDK Bus (RBus) is a lightweight, fast and efficient bus messaging system. It allows interprocess communication (IPC) and remote procedure call (RPC) between multiple process running on a hardware device. It supports the creation and use of a data model, which is a hierarchical tree of named objects with properties, events, and methods.

Desktop Build (Linux)

export RBUS_ROOT=${HOME}/rbus
export RBUS_INSTALL_DIR=${RBUS_ROOT}/install
export RBUS_BRANCH=2105_sprint
mkdir -p $RBUS_INSTALL_DIR
cd $RBUS_ROOT

Build rtmessage

git clone ssh://gerrit.teamccp.com:29418/rdk/components/opensource/rtmessage -b $RBUS_BRANCH rtmessage
cmake -Hrtmessage -Bbuild/rtmessage -DCMAKE_INSTALL_PREFIX=${RBUS_INSTALL_DIR}/usr -DBUILD_FOR_DESKTOP=ON -DCMAKE_BUILD_TYPE=Debug
make -C build/rtmessage && make -C build/rtmessage install

Build rbuscore

git clone ssh://gerrit.teamccp.com:29418/rdk/components/generic/rbuscore/generic -b $RBUS_BRANCH rbuscore
cmake -Hrbuscore -Bbuild/rbuscore -DCMAKE_INSTALL_PREFIX=${RBUS_INSTALL_DIR}/usr -DBUILD_FOR_DESKTOP=ON -DBUILD_RBUS_UNIT_TEST=OFF -DCMAKE_BUILD_TYPE=Debug
make -C build/rbuscore && make -C build/rbuscore install

Build rbus

git clone ssh://gerrit.teamccp.com:29418/rdk/components/generic/rbus/generic -b $RBUS_BRANCH rbus
cmake -Hrbus -Bbuild/rbus -DCMAKE_INSTALL_PREFIX=${RBUS_INSTALL_DIR}/usr -DBUILD_FOR_DESKTOP=ON -DCMAKE_BUILD_TYPE=Debug
make -C build/rbus && make -C build/rbus install

Run Rbus Apps

Setup 3 terminals:

export RBUS_ROOT=${HOME}/rbus && \
export RBUS_INSTALL_DIR=${RBUS_ROOT}/install && \
export PATH=${RBUS_INSTALL_DIR}/usr/bin:${PATH} && \
export LD_LIBRARY_PATH=${RBUS_INSTALL_DIR}/usr/lib:${LD_LIBRARY_PATH}

Start rtrouted

In terminal 1, run rtrouted. This deamon must be running for rbus apps to communicate.

rtrouted -f -l DEBUG

Note that if at any point in the future you want to restart rtrouted you can run this.

killall -9 rtrouted; rm -fr /tmp/rtroute*; rtrouted -f -l DEBUG

Run a sample app

Note that all sample apps come with both a provider and a consumer app. The provider must be started first and then quickly, before the provider times out, the consumer should be started.

In terminal 2, run the sample provider.

rbusSampleProvider

In terminal 3, run the sample consumer.

rbusSampleConsumer

Here is the list of all samples:

  1. rbusSampleProvider / rbusSampleConsumer
  2. rbusEventProvider / rbusEventConsumer
  3. rbusEventProvider / rbusEventConsumer
  4. rbusGeneralEventProvider / rbusGeneralEventConsumer
  5. rbusValueChangeProvider / rbusValueChangeConsumer
  6. rbusMethodProvider / rbusMethodConsumer
  7. rbusTableProvider / rbusTableConsumer

Playing with rbuscli

The rbuscli utility app allows the user to register a data model and interact with it, exercising the rbus api both from a provider and consumer perspective.

In terminal 2, run rbuscli

rbuscli -i

Register a property as a provider would

    > reg prop A.B

In terminal 3, run rbuscli and set/get the property, registered by the first rbuscli, as a consumer would.

rbuscli -i
    > set A.B string "hello"
    > get A.B

In terminal 3, enable event logging and subscribe to a value-change event.

    > log events
    > sub A.B

In terminal 2, change the value so that a value-change event is generated.

    > set A.B string "hello again"

In terminal 3, logs should appear showing a value change event was received.

There's a lot more you can do with rbuscli. Enter help to get a full list of commands. When your done, enter quit to exit rbuscli.

Run the test harness

In terminal 2, run the test provider

rbusTestProvider

In terminal 3, run the test consumer

rbusTestConsumer -a

The test takes about 5-10 minutes. Check for errors in the summary table at the end. To get more details for any error, rerun the test passing -l debug to both the provider and consumer.

Run with valgrind

Valgrind is an important tool to help find both memory leaks and memory related bugs.

In terminal 2, run a sample provider using valgrind.

valgrind --leak-check=full --show-leak-kinds=all rbusSampleProvider

In terminal 3, run a sample consumer using valgrind.

valgrind --leak-check=full --show-leak-kinds=all rbusSampleConsumer

rbus's People

Contributors

mrcomcast123 avatar gururaajar avatar peterdeherdt avatar karuna2git avatar balanaveenanivetha avatar pradeeptakdas avatar mmasin811 avatar gladish avatar

Watchers

James Cloos avatar

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.