Upgrade bluez5_37 :Merge the code from private
[platform/upstream/bluez.git] / android / hal-ipc.h
1 /*
2  * Copyright (C) 2013 Intel Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 struct hal_ipc_handler {
19         void (*handler) (void *buf, uint16_t len, int fd);
20         bool var_len;
21         size_t data_len;
22 };
23
24 bool hal_ipc_init(const char *path, size_t size);
25 bool hal_ipc_accept(void);
26 void hal_ipc_cleanup(void);
27
28 int hal_ipc_cmd(uint8_t service_id, uint8_t opcode, uint16_t len, void *param,
29                                         size_t *rsp_len, void *rsp, int *fd);
30
31 void hal_ipc_register(uint8_t service, const struct hal_ipc_handler *handlers,
32                                                                 uint8_t size);
33 void hal_ipc_unregister(uint8_t service);