f95fcbe85ba89dac13560584a0df51391e70d8cb
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / bt_le_adapter / arduino / cableserver.h
1 /* ****************************************************************
2  *
3  * Copyright 2014 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ******************************************************************/
20
21 /**
22  * @file
23  *
24  * This file contains the APIs related to the GATT Server functionalities.
25  * Creation of the GATT Server with the characteristics. Enabling the
26  * advertisement and updating the characteristics for the response and
27  * notifying the change of characteristics for the request will be done here.
28  */
29
30 #ifndef BLE_ADAPTER_ARDUINO_H_
31 #define BLE_ADAPTER_ARDUINO_H_
32
33 #include "cacommon.h"
34 #include "caadapterinterface.h"
35
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40
41 /**
42  * API to initialize Arduino BLE module and advertise the service.
43  * @return ::CA_STATUS_OK or Appropriate error code.
44  */
45 CAResult_t CALEInitialize();
46
47 /**
48  * API to check whether data is available in BLE shield.
49  * @return - Received buffer length.
50  */
51 unsigned char CAIsLEDataAvailable();
52
53 /**
54  * API to check whether client is connected with BLE Shield.
55  * @return - Connection state.
56  */
57 unsigned char CAIsLEConnected();
58
59 /**
60  * API to read data from BLE shield.
61  * @return - Data read.
62  */
63 uint8_t CALEReadData();
64
65 /**
66  * API to perform BLE events.
67  * @return ::CA_STATUS_OK or Appropriate error code.
68  */
69 CAResult_t CALEDoEvents();
70
71 #ifdef __cplusplus
72 } /* extern "C" */
73 #endif
74
75 #endif /* BLE_ADAPTER_ARDUINO_H_ */
76