Results 1 to 6 of 6

Thread: how to communicate between C and Qt application using D-Bus

  1. #1
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    86
    Thanks
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default how to communicate between C and Qt application using D-Bus

    Hi Everybody,

    In my project there are two separate applications(two different exe), one application is in C while other is in Qt.
    I have to communicate between these two separate applications through D-Bus, mean i have to send and receive some
    data between these two applications via D-Bus.

    I am new to D-Bus. I am able to communicate between two Qt-applications, but i don't know how to
    communicate these two applications( one is written in C and other is in Qt).

    Can you guide me how to do it ?????

    Thanks in advance .....!
    sanjeet

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to communicate between C and Qt application using D-Bus

    Exactly the same way. Use Qt D-bus API in Qt and C D-bus API in C.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    sanjeet (20th February 2012)

  4. #3
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    86
    Thanks
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to communicate between C and Qt application using D-Bus

    Dear wysota,
    Thank for guiding me........ i am doing in same way, as you have said.
    but it's not happening......... i think i am doing some mistake...?
    can you provide me some link or example ?

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how to communicate between C and Qt application using D-Bus

    Thank for guiding me........ i am doing in same way, as you have said.
    but it's not happening......... i think i am doing some mistake...?
    I think you are doing some mistake also.

    According to your first post, Qt <-> Qt is no problem. Your attempt to replace one end with a C program is failing. Since this program is nothing to do with Qt you would be will served by looking at the documentation for DBus and the C language bindings you are using.

    can you provide me some link or example ?
    http://dbus.freedesktop.org/doc/dbus-tutorial.html

  6. #5
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    86
    Thanks
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to communicate between C and Qt application using D-Bus

    i have tried a lot........ but i am not able to do it.
    can you provide me some demo code(or link of that code)......

  7. #6
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    86
    Thanks
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to communicate between C and Qt application using D-Bus

    Hi Everybody,
    I am able to communicate between two qt-application via D-Bus.
    For this i am using "qdbusxml2cpp" and generating adaptor and interface, and using one's interface into other.

    Even i am able to communicate between two C-application via C-API for Dbus.

    But i have to communicate between one c-application and qt-application, i am not able to do it.
    I have to send some string from c-application and that i have to display (on Label in my dialog) in qt-application.

    when i am watching through "dbus-monitor" it's giving one error :

    "No such method 'displayMsg' in interface 'com.myOrg.myInterface"

    I am posting my code, Can you let me know/advice me what's wrong i am doing ?

    Whatever i have observed, i am not able to "exposes a method call and waits for it to be called" in my qt side application how to reply to c-application.
    It's because, when both applications are in qt, i can easily use one's interface object in to another and call it, but here one application is C.

    Can you look my code and find my mistake or guide me how to do it. It's my first time i am using D-Bus in any project.

    Thanks in advance !
    Attached Files Attached Files

Similar Threads

  1. Replies: 3
    Last Post: 20th September 2011, 20:13
  2. How widges communicate between projects?
    By yxtx1984 in forum Newbie
    Replies: 1
    Last Post: 12th January 2010, 14:22
  3. How to communicate between two forms
    By iamjayanth in forum Qt Programming
    Replies: 2
    Last Post: 7th April 2009, 08:17
  4. How to communicate with external programs?
    By deekayt in forum Qt Programming
    Replies: 7
    Last Post: 27th October 2006, 23:01
  5. How to communicate between two different exe
    By Lele in forum Qt Programming
    Replies: 4
    Last Post: 9th July 2006, 13:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.