Return-Path: MIME-Version: 1.0 In-Reply-To: <1797034.Wjt854TcTE@athlon> References: <1412858714-2845-1-git-send-email-grzegorz.kolodziejczyk@tieto.com> <1412858714-2845-3-git-send-email-grzegorz.kolodziejczyk@tieto.com> <1797034.Wjt854TcTE@athlon> Date: Tue, 14 Oct 2014 10:58:55 +0200 Message-ID: Subject: Re: [PATCH 02/10] android/map-client: Add stubs for MAP client commands handlers From: Grzegorz Kolodziejczyk To: Szymon Janc Cc: linux-bluetooth Content-Type: text/plain; charset=UTF-8 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Szymon, On 13 October 2014 21:58, Szymon Janc wrote: > Hi Grzegorz, > > On Thursday 09 October 2014 14:45:06 Grzegorz Kolodziejczyk wrote: >> Add empty handlers for MAP client IPC commands. >> --- >> android/map-client.c | 33 ++++++++++++++++++++++++++++++++- >> 1 file changed, 32 insertions(+), 1 deletion(-) >> >> diff --git a/android/map-client.c b/android/map-client.c >> index 4556461..1001b36 100644 >> --- a/android/map-client.c >> +++ b/android/map-client.c >> @@ -28,17 +28,48 @@ >> #include >> #include >> #include >> +#include >> >> #include "ipc.h" >> #include "lib/bluetooth.h" >> #include "map-client.h" >> +#include "src/log.h" >> +#include "hal-msg.h" >> + >> +static struct ipc *hal_ipc = NULL; >> +static bdaddr_t adapter_addr; >> + >> +static void handle_get_instances(const void *buf, uint16_t len) >> +{ >> + DBG(""); >> + >> + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_MAP_CLIENT, >> + HAL_OP_MAP_CLIENT_GET_INSTANCES, HAL_STATUS_FAILED); >> +} >> + >> +static const struct ipc_handler cmd_handlers[] = { >> + {handle_get_instances, false, >> + sizeof(struct hal_cmd_map_client_get_instances)}, > > Style issue: there should be spaces after { and before }. > Also please add comment about define type just like in other handlers (I'm > aware that there is just 1 handler here but lets be consistent). > Ok, I'll fix it. >> +}; >> >> bool bt_map_client_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t >> mode) { >> - return false; >> + DBG(""); >> + >> + bacpy(&adapter_addr, addr); >> + >> + hal_ipc = ipc; >> + >> + ipc_register(hal_ipc, HAL_SERVICE_ID_MAP_CLIENT, cmd_handlers, >> + G_N_ELEMENTS(cmd_handlers)); >> + >> + return true; >> } >> >> void bt_map_client_unregister(void) >> { >> + DBG(""); >> >> + ipc_unregister(hal_ipc, HAL_SERVICE_ID_MAP_CLIENT); >> + hal_ipc = NULL; >> } > > -- > Szymon K. Janc > szymon.janc@gmail.com Best regards, Grzegorz