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 ******************************************************************/
21 #include "cableserver.h"
26 #include <RBL_nRF8001.h>
30 #include "oic_malloc.h"
31 #include "caadapterutils.h"
35 CAResult_t CAInitializeBle()
37 OIC_LOG(DEBUG, TAG, "IN");
39 // Set your BLE Shield name here, max. length 10
40 ble_set_name("SAMSUNG");
42 OIC_LOG(DEBUG, TAG, "LEName Set");
46 OIC_LOG(DEBUG, TAG, "OUT");
51 CAResult_t CAAddNewBleServiceInGattServer(const char *service_uuid)
53 // Not Supported - Done at compile time
57 CAResult_t CARemoveBleServiceFromGattServer(const char *svc_path)
59 // Not Supported - Done at compile time
63 CAResult_t CARemoveAllBleServicesFromGattServer()
69 CAResult_t CARegisterBleServicewithGattServer(const char *svc_path)
71 // Not Supported - Done at compile time
75 CAResult_t CAAddNewCharacteristicsToGattServer(const char *svc_path,
76 const char *char_uuid,
77 const char *char_value,
81 // Not Supported - Done at compile time
85 CAResult_t CARemoveCharacteristicsFromGattServer(const char *char_path)
91 unsigned char CAIsBleDataAvailable()
93 return ble_available();
96 unsigned char CAIsBleConnected()
98 return ble_connected();
102 return (char)ble_read();
105 CAResult_t CABleDoEvents()
111 CAResult_t CAWriteBleData(unsigned char *data, uint8_t len)
113 // Currently ble_write_bytes api returns void.
114 ble_write_bytes(data, len);