diff options
author | Pekka Pessi <Pekka.Pessi@nokia.com> | 2011-01-03 22:00:33 +0200 |
---|---|---|
committer | Aki Niemi <aki.niemi@nokia.com> | 2011-01-07 13:38:55 +0200 |
commit | 593e74f7930221a41dcc901c0ebcc41651cb28d5 (patch) | |
tree | 366bf8feb38d402812382e97c6f143fdbcd40b3a /gisi/pipe.c | |
parent | 340a6d87252b3259d8ece98211bdc5da5b7a714e (diff) | |
download | ofono-593e74f7930221a41dcc901c0ebcc41651cb28d5.tar.bz2 |
gisi: Simplify client interface.
Use send functions without explicit timeout. Return booleans instead
of pointers - nobody really used GIsiPending but relied on client
doing the cleanup.
Add g_isi_client_set_timeout(), g_isi_client_(v)send_with_timeout().
Diffstat (limited to 'gisi/pipe.c')
-rw-r--r-- | gisi/pipe.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gisi/pipe.c b/gisi/pipe.c index 6070776d..1bd51400 100644 --- a/gisi/pipe.c +++ b/gisi/pipe.c @@ -224,6 +224,7 @@ GIsiPipe *g_isi_pipe_create(GIsiModem *modem, GIsiPipeHandler cb, uint16_t obj1, .type2 = type2, .n_sb = 0, }; + size_t len = sizeof(msg); GIsiPipe *pipe; pipe = g_try_new0(GIsiPipe, 1); @@ -246,8 +247,8 @@ GIsiPipe *g_isi_pipe_create(GIsiModem *modem, GIsiPipeHandler cb, uint16_t obj1, pipe->enabled = FALSE; pipe->handle = PN_PIPE_INVALID_HANDLE; - if (g_isi_client_send(pipe->client, &msg, sizeof(msg), 3, - g_isi_pipe_created, pipe, NULL)) + if (g_isi_client_send(pipe->client, &msg, len, + g_isi_pipe_created, pipe, NULL)) return pipe; g_isi_client_destroy(pipe->client); @@ -284,16 +285,16 @@ static void g_isi_pipe_enabled(const GIsiMessage *msg, void *data) pipe->enabled = TRUE; } -static GIsiPending *g_isi_pipe_enable(GIsiPipe *pipe) +static void g_isi_pipe_enable(GIsiPipe *pipe) { struct isi_pipe_enable_req msg = { .cmd = PNS_PIPE_ENABLE_REQ, .pipe_handle = pipe->handle, }; - size_t len = sizeof(struct isi_pipe_enable_req); + size_t len = sizeof(msg); - return g_isi_client_send(pipe->client, &msg, len, 5, g_isi_pipe_enabled, - pipe, NULL); + g_isi_client_send(pipe->client, &msg, len, + g_isi_pipe_enabled, pipe, NULL); } /** @@ -343,16 +344,16 @@ static void g_isi_pipe_removed(const GIsiMessage *msg, void *data) } -static GIsiPending *g_isi_pipe_remove(GIsiPipe *pipe) +static void g_isi_pipe_remove(GIsiPipe *pipe) { struct isi_pipe_remove_req msg = { .cmd = PNS_PIPE_REMOVE_REQ, .pipe_handle = pipe->handle, }; - size_t len = sizeof(struct isi_pipe_remove_req); + size_t len = sizeof(msg); - return g_isi_client_send(pipe->client, &msg, len, 5, g_isi_pipe_removed, - pipe, NULL); + g_isi_client_send(pipe->client, &msg, len, + g_isi_pipe_removed, pipe, NULL); } /** |