Changeset 504f1ea3 in mainline


Ignore:
Timestamp:
2013-03-17T16:23:08Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9e1800c
Parents:
059490c2
Message:

libhound: Add client side protocol skeleton

Location:
uspace/lib/hound/src
Files:
2 edited

Legend:

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

    r059490c2 r504f1ea3  
    4646#include "server.h"
    4747
     48enum ipc_methods {
     49        IPC_M_HOUND_CONTEXT_REGISTER = IPC_FIRST_USER_METHOD,
     50        IPC_M_HOUND_CONTEXT_UNREGISTER,
     51        IPC_M_HOUND_STREAM_START,
     52        IPC_M_HOUND_STREAM_STOP,
     53        IPC_M_HOUND_STREAM_DRAIN,
     54        IPC_M_HOUND_STREAM_WRITE,
     55        IPC_M_HOUND_STREAM_READ,
     56};
     57
    4858const char *HOUND_SERVICE = "audio/hound";
    4959
     
    6373                async_hangup(sess);
    6474}
     75
     76hound_context_id_t hound_service_register_context(hound_sess_t *sess,
     77    const char *name)
     78{
     79        assert(sess);
     80        assert(name);
     81        async_exch_t *exch = async_exchange_begin(sess);
     82        const int ret =
     83            async_req_1_0(exch, IPC_M_HOUND_CONTEXT_REGISTER, str_size(name));
     84        //TODO send the string
     85        async_exchange_end(exch);
     86        return ret;
     87}
     88
     89int hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id)
     90{
     91        assert(sess);
     92        async_exch_t *exch = async_exchange_begin(sess);
     93        const int ret =
     94            async_req_1_0(exch, IPC_M_HOUND_CONTEXT_UNREGISTER, id);
     95        async_exchange_end(exch);
     96        return ret;
     97}
     98
     99int hound_service_stream_enter(async_exch_t *exch, hound_context_id_t id,
     100    int flags, pcm_format_t format, size_t bsize)
     101{
     102        return ENOTSUP;
     103}
     104
     105int hound_service_stream_exit(async_exch_t *exch)
     106{
     107        return ENOTSUP;
     108}
     109
     110int hound_service_stream_drain(async_exch_t *exch)
     111{
     112        return ENOTSUP;
     113}
     114
     115int hound_service_stream_write(async_exch_t *exch, const void *data, size_t size)
     116{
     117        return ENOTSUP;
     118}
     119
     120int hound_service_stream_read(async_exch_t *exch, void *data, size_t size)
     121{
     122        return ENOTSUP;
     123}
     124
    65125
    66126/***
  • uspace/lib/hound/src/protocol.h

    r059490c2 r504f1ea3  
    4444typedef async_sess_t hound_sess_t;
    4545typedef int hound_context_id_t;
    46 typedef int hound_stream_id_t;
    4746
    4847hound_sess_t *hound_service_connect(const char *service);
     
    5150hound_context_id_t hound_service_register_context(hound_sess_t *sess,
    5251    const char *name);
    53 int hound_service_unregister_context(hound_sess_t *sess);
     52int hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id);
    5453
    55 hound_stream_id_t hound_service_stream_add(hound_sess_t *sess, int flags,
    56     pcm_format_t format, size_t bsize);
    57 int hound_service_stream_remove(hound_sess_t *sess, hound_stream_id_t);
    58 int hound_service_stream_drain(hound_sess_t *sess, hound_stream_id_t);
     54int hound_service_stream_enter(async_exch_t *exch, hound_context_id_t id,
     55    int flags, pcm_format_t format, size_t bsize);
     56int hound_service_stream_drain(async_exch_t *exch);
     57int hound_service_stream_exit(async_exch_t *exch);
    5958
    60 int hound_service_stream_write(async_exch_t *exch, hound_stream_id_t,
    61     const void *data, size_t size);
    62 int hound_service_stream_read(async_exch_t *exch, hound_stream_id_t,
    63     void *data, size_t size);
     59int hound_service_stream_write(async_exch_t *exch, const void *data, size_t size);
     60int hound_service_stream_read(async_exch_t *exch, void *data, size_t size);
    6461
    6562
Note: See TracChangeset for help on using the changeset viewer.