1 /* ****************************************************************
3 * Copyright 2014 Samsung Electronics All Rights Reserved.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 ******************************************************************/
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 characteristcs for the request will be done here.
30 #ifndef BLE_ADAPTER_ARDUINO_H_
31 #define BLE_ADAPTER_ARDUINO_H_
34 #include "caadapterinterface.h"
42 * @brief API to initialize Arduino BLE module and advertise the service
43 * @return #CA_STATUS_OK or Appropriate error code
45 CAResult_t CAInitializeBle();
48 * @brief API to Terminate Arduino BLE module and advertise the service
49 * @return #CA_STATUS_OK or Appropriate error code
51 CAResult_t CATerminateBle();
54 * @brief Send the received data to Connectivity Abstraction layer.
55 * @param data [IN] Data received from BLE characteristics
56 * @param dataLen [IN] Received data Length
57 * @param senderAdrs [IN] Sender Address.
58 * @param senderPort [IN] Sender port
59 * @return #CA_STATUS_OK or Appropriate error code
61 void CANotifyCallback(const void *data, int32_t dataLen, const char *senderAdrs,
65 * @brief API to check whether data is available in BLE shield
66 * @return - Received buffer length
68 unsigned char CAIsBleDataAvailable();
71 * @brief API to check whether client is connected with BLE Shield
72 * @return - Connection state
74 unsigned char CAIsBleConnected();
77 * @brief API to read data from BLE shield
83 * @brief API to perform BLE events
84 * @return #CA_STATUS_OK or Appropriate error code
86 CAResult_t CABleDoEvents();
92 #endif /* BLE_ADAPTER_ARDUINO_H_ */