\begin{DoxyDate}{Date}
2012 (created)
\end{DoxyDate}
\hypertarget{evil_main_toc}{}\section{Table of Contents}\label{evil_main_toc}
\begin{DoxyItemize}
\item \mbox{\hyperlink{eldbus_main_eldbus_main_intro}{Introduction}} \item \mbox{\hyperlink{eldbus_main_eldbus_main_compiling}{How to compile}} \item \mbox{\hyperlink{eldbus_main_eldbus_main_next_steps}{Next Steps}} \item \mbox{\hyperlink{eldbus_main_eldbus_main_intro_example}{Introductory Example}}\end{DoxyItemize}
\hypertarget{eldbus_main_eldbus_main_intro}{}\section{Introduction}\label{eldbus_main_eldbus_main_intro}
Eldbus is a wrapper around the \href{http://www.freedesktop.org/wiki/Software/dbus}{\tt dbus} library, which is a message bus system. It also implements a set of specifications using dbus as interprocess communication.\hypertarget{eldbus_main_eldbus_modules_sec}{}\subsection{Modules}\label{eldbus_main_eldbus_modules_sec}

\begin{DoxyItemize}
\item \mbox{\hyperlink{group__Eldbus__Core}{Core}} 
\item \mbox{\hyperlink{group__Eldbus__Conneciton}{Connection}} 
\item \mbox{\hyperlink{group__Eldbus__Object__Mapper}{Object Mapper}} 
\item \mbox{\hyperlink{group__Eldbus__Proxy}{Proxy}} 
\item \mbox{\hyperlink{group__Eldbus__Message}{Message}} 
\begin{DoxyItemize}
\item \mbox{\hyperlink{group__Eldbus__Message__Iter}{Iterator}} 
\item \mbox{\hyperlink{group__Eldbus__Message__Helpers}{Message Helpers}} 
\item \mbox{\hyperlink{group__Eina__Value}{Eina\+\_\+\+Value to/from Message}} 
\end{DoxyItemize}
\item \mbox{\hyperlink{group__Eldbus__Signal__Handler}{Signal Handler}} 
\item \mbox{\hyperlink{group__Eldbus__Pending}{Pending}} 
\item \mbox{\hyperlink{group__Eldbus__Service}{Service}} 
\item \mbox{\hyperlink{group__Eldbus__Basic}{Basic Free\+Desktop.\+Org Methods}} 
\end{DoxyItemize}\hypertarget{eldbus_main_eldbus_main_compiling}{}\section{How to compile}\label{eldbus_main_eldbus_main_compiling}
Eldbus is a library your application links to. The procedure for this is very simple. You simply have to compile your application with the appropriate compiler flags that the {\ttfamily pkg-\/config} script outputs. For example\+:

Compiling C or C++ files into object files\+:

\begin{DoxyVerb}gcc -c -o main.o main.c `pkg-config --cflags eldbus`
\end{DoxyVerb}


Linking object files into a binary executable\+:

\begin{DoxyVerb}gcc -o my_application main.o `pkg-config --libs eldbus`
\end{DoxyVerb}


See \mbox{\hyperlink{pkgconfig}{pkgconfig}}\hypertarget{eldbus_main_eldbus_main_next_steps}{}\section{Next Steps}\label{eldbus_main_eldbus_main_next_steps}
After you understood what Eldbus is and installed it in your system you should proceed understanding the programming interface.

Recommended reading\+: \begin{DoxyItemize}
\item \mbox{\hyperlink{group__Eldbus__Core}{Core}} for library init, shutdown and getting a connection. \item \mbox{\hyperlink{group__Eldbus__Proxy}{Proxy}} to easily bind a client object to an interface. \item \mbox{\hyperlink{group__Eldbus__Object__Mapper}{Object Mapper}} to monitor server objects and properties.\end{DoxyItemize}
\hypertarget{eldbus_main_eldbus_main_intro_example}{}\section{Introductory Example}\label{eldbus_main_eldbus_main_intro_example}

\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{// gcc -o ofono-dial ofono-dial.c `pkg-config --cflags --libs eldbus ecore`}

\textcolor{preprocessor}{#include "Eldbus.h"}
\textcolor{preprocessor}{#include <Ecore.h>}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
on\_dial(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keyword}{const} \mbox{\hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message}} *msg, 
      \mbox{\hyperlink{group__Eldbus__Core_ga7a5d4dc070bd925034de6e52c4260be7}{Eldbus\_Pending}} *pending \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})
\{
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *errname, *errmsg;
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *call\_path;

   \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__Eldbus__Message_ga3aeec7d275bef2bb244ed9a045540921}{eldbus\_message\_error\_get}}(msg, &errname, &errmsg))
     \{
        fprintf(stderr, \textcolor{stringliteral}{"Error: %s %s\(\backslash\)n"}, errname, errmsg);
        \textcolor{keywordflow}{return};
     \}

   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Eldbus__Message_ga7aec6beec8e8a73982c7f43bd1322df8}{eldbus\_message\_arguments\_get}}(msg, \textcolor{stringliteral}{"o"}, &call\_path))
     \{
        fprintf(stderr, \textcolor{stringliteral}{"Error: could not get call path\(\backslash\)n"});
        \textcolor{keywordflow}{return};
     \}

   printf(\textcolor{stringliteral}{"dialed! call path: %s\(\backslash\)n"}, call\_path);
\}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} *argv[])
\{
   \mbox{\hyperlink{group__Eldbus_ga1de8233c3e9240291bb952776810c831}{Eldbus\_Connection}} *conn;
   \mbox{\hyperlink{group__Eldbus_gab374430ed25089e7c5213767cc637191}{Eldbus\_Object}} *obj;
   \mbox{\hyperlink{group__Eldbus_ga82047f6a5efc1980ae445a898c2ed9c0}{Eldbus\_Proxy}} *manager;
   \mbox{\hyperlink{group__Eldbus__Core_ga7a5d4dc070bd925034de6e52c4260be7}{Eldbus\_Pending}} *pending;
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *number, *hide\_callerid;

   \textcolor{keywordflow}{if} (argc < 2)
     \{
        fprintf(stderr, \textcolor{stringliteral}{"Usage:\(\backslash\)n\(\backslash\)t%s <number> [hide\_callerid]\(\backslash\)n"}, argv[0]);
        \textcolor{keywordflow}{return} EXIT\_FAILURE;
     \}

   number = argv[1];
   hide\_callerid = (argc > 2) ? argv[2] : \textcolor{stringliteral}{""};

   \mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\_init}}();
   \mbox{\hyperlink{group__Eldbus__Core_gadd7c8b8a43b5dd590f7fd06166288754}{eldbus\_init}}();

   conn = \mbox{\hyperlink{group__Eldbus__Conneciton_ga203ec794fc0c7e1bddce4eb18b628c04}{eldbus\_connection\_get}}(ELDBUS\_CONNECTION\_TYPE\_SYSTEM);
   \textcolor{keywordflow}{if} (!conn)
     \{
        fprintf(stderr, \textcolor{stringliteral}{"Error: could not get system bus\(\backslash\)n"});
        \textcolor{keywordflow}{return} EXIT\_FAILURE;
     \}

   obj = \mbox{\hyperlink{group__Eldbus__Object__Mapper_ga067d5c8eba2590fb58e7dc39de87d203}{eldbus\_object\_get}}(conn, \textcolor{stringliteral}{"org.ofono"}, \textcolor{stringliteral}{"/"});
   \textcolor{keywordflow}{if} (!obj)
     \{
        fprintf(stderr, \textcolor{stringliteral}{"Error: could not get object\(\backslash\)n"});
        \textcolor{keywordflow}{return} EXIT\_FAILURE;
     \}

   manager = \mbox{\hyperlink{group__Eldbus__Proxy_ga58b8d61188435800e1e866ab3fdc7090}{eldbus\_proxy\_get}}(obj, \textcolor{stringliteral}{"org.ofono.Manager"});
   \textcolor{keywordflow}{if} (!manager)
     \{
        fprintf(stderr, \textcolor{stringliteral}{"Error: could not get proxy\(\backslash\)n"});
        \textcolor{keywordflow}{return} EXIT\_FAILURE;
     \}

   pending = \mbox{\hyperlink{group__Eldbus__Proxy_ga0eaac8e928bd7605855bf61d97eea37c}{eldbus\_proxy\_call}}(manager, \textcolor{stringliteral}{"Dial"}, on\_dial, NULL,
                              -1, \textcolor{stringliteral}{"ss"}, number, hide\_callerid);
   \textcolor{keywordflow}{if} (!pending)
     \{
        fprintf(stderr, \textcolor{stringliteral}{"Error: could not call\(\backslash\)n"});
        \textcolor{keywordflow}{return} EXIT\_FAILURE;
     \}

   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();

   \mbox{\hyperlink{group__Eldbus__Proxy_gab8b43f9e377544b987d2e0151c660aa7}{eldbus\_proxy\_unref}}(manager);
   \mbox{\hyperlink{group__Eldbus__Object__Mapper_gabf9de9a1f28df4a8b0b3b2cd416d647e}{eldbus\_object\_unref}}(obj);
   \mbox{\hyperlink{group__Eldbus__Conneciton_ga1c035aac8b601b416bba11d0d68f80ae}{eldbus\_connection\_unref}}(conn);

   \mbox{\hyperlink{group__Eldbus__Core_ga255ee3e090da6704d009ee74ba9d8a79}{eldbus\_shutdown}}();
   \mbox{\hyperlink{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}{ecore\_shutdown}}();
   \textcolor{keywordflow}{return} 0;
\}

\end{DoxyCodeInclude}


More examples can be found at \mbox{\hyperlink{eldbus_examples}{Eldbus Examples}}. 