2a800ccfc6938d49e47413975075e3ec3ff3b4df
[platform/core/connectivity/zigbee-manager.git] / zigbee-daemon / zigbee-lib / include / zblib_request.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Contact: Suresh Kumar N (suresh.n@samsung.com)
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef __ZIGBEE_LIB_REQUEST_H__
20 #define __ZIGBEE_LIB_REQUEST_H__
21
22 /**< ZigBee invalid request ID */
23 #define ZIGBEE_REQUEST_INVALID_REQUEST_ID (-1)
24
25 gint zblib_request_new(ZigBeeServiceInterface *service_interface,
26         guint request_type, gpointer request_data, guint request_data_len);
27 void zblib_request_free(ZigBeeRequest *request);
28
29 ZigBeeRequest *zblib_request_ref(ZigBeeRequest *request);
30 void zblib_request_unref(ZigBeeRequest *request);
31
32 guint zblib_request_ref_request_type(ZigBeeRequest *request);
33 ZigBeeServiceInterface *zblib_request_ref_service_interface(ZigBeeRequest *request);
34 gpointer zblib_request_ref_request_data(ZigBeeRequest *request);
35
36 guint zblib_request_generate_request_type(ZblibDriverType_e driver_type,
37         guint ops_id);
38 gint zblib_request_ref_request_type_by_request_id(ZigBeeService *service,
39         guint request_id);
40
41 ZblibDriverType_e zblib_request_get_driver_type(guint request_type);
42 guint zblib_request_get_ops_id(guint request_type);
43
44 #endif /* __ZIGBEE_LIB_REQUEST_H__ */