Changeset 059490c2 in mainline for uspace/lib/hound/src/protocol.c


Ignore:
Timestamp:
2013-03-17T13:57:57Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
504f1ea3
Parents:
fe0b448
Message:

libhound: Add protocol header

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/hound/src/protocol.c

    rfe0b448 r059490c2  
    4242#include <libarch/types.h>
    4343
     44#include "protocol.h"
    4445#include "client.h"
    4546#include "server.h"
    4647
    47 static const char *HOUND_SERVICE = "audio/hound";
     48const char *HOUND_SERVICE = "audio/hound";
     49
     50hound_sess_t *hound_service_connect(const char *service)
     51{
     52        service_id_t id = 0;
     53        const int ret =
     54            loc_service_get_id(service, &id, IPC_FLAG_BLOCKING);
     55        if (ret != EOK)
     56                return NULL;
     57        return loc_service_connect(EXCHANGE_PARALLEL, id, IPC_FLAG_BLOCKING);
     58}
     59
     60void hound_service_disconnect(hound_sess_t *sess)
     61{
     62        if (sess)
     63                async_hangup(sess);
     64}
    4865
    4966/***
     
    5572        void *arg;
    5673} callback_t;
     74
     75hound_sess_t *hound_get_session(void)
     76{
     77        return hound_service_connect(HOUND_SERVICE);
     78}
     79
     80void hound_release_session(hound_sess_t *sess)
     81{
     82        hound_service_disconnect(sess);
     83}
    5784
    5885
Note: See TracChangeset for help on using the changeset viewer.