Nordic stack and drivers for the mbed BLE API

Fork of nRF51822 by Nordic Semiconductor

Committer:
Vincent Coubard
Date:
Wed Sep 14 14:39:43 2016 +0100
Revision:
638:c90ae1400bf2
Sync with bdab10dc0f90748b6989c8b577771bb403ca6bd8 from ARMmbed/mbed-os.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Vincent Coubard 638:c90ae1400bf2 1 /* mbed Microcontroller Library
Vincent Coubard 638:c90ae1400bf2 2 * Copyright (c) 2006-2013 ARM Limited
Vincent Coubard 638:c90ae1400bf2 3 *
Vincent Coubard 638:c90ae1400bf2 4 * Licensed under the Apache License, Version 2.0 (the "License");
Vincent Coubard 638:c90ae1400bf2 5 * you may not use this file except in compliance with the License.
Vincent Coubard 638:c90ae1400bf2 6 * You may obtain a copy of the License at
Vincent Coubard 638:c90ae1400bf2 7 *
Vincent Coubard 638:c90ae1400bf2 8 * http://www.apache.org/licenses/LICENSE-2.0
Vincent Coubard 638:c90ae1400bf2 9 *
Vincent Coubard 638:c90ae1400bf2 10 * Unless required by applicable law or agreed to in writing, software
Vincent Coubard 638:c90ae1400bf2 11 * distributed under the License is distributed on an "AS IS" BASIS,
Vincent Coubard 638:c90ae1400bf2 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Vincent Coubard 638:c90ae1400bf2 13 * See the License for the specific language governing permissions and
Vincent Coubard 638:c90ae1400bf2 14 * limitations under the License.
Vincent Coubard 638:c90ae1400bf2 15 */
Vincent Coubard 638:c90ae1400bf2 16
Vincent Coubard 638:c90ae1400bf2 17 #include "nRF5xDiscoveredCharacteristic.h"
Vincent Coubard 638:c90ae1400bf2 18 #include "nRF5xGattClient.h"
Vincent Coubard 638:c90ae1400bf2 19 #include "nrf_ble_gatt.h"
Vincent Coubard 638:c90ae1400bf2 20
Vincent Coubard 638:c90ae1400bf2 21 void
Vincent Coubard 638:c90ae1400bf2 22 nRF5xDiscoveredCharacteristic::setup(nRF5xGattClient *gattcIn,
Vincent Coubard 638:c90ae1400bf2 23 Gap::Handle_t connectionHandleIn,
Vincent Coubard 638:c90ae1400bf2 24 ble_gatt_char_props_t propsIn,
Vincent Coubard 638:c90ae1400bf2 25 GattAttribute::Handle_t declHandleIn,
Vincent Coubard 638:c90ae1400bf2 26 GattAttribute::Handle_t valueHandleIn)
Vincent Coubard 638:c90ae1400bf2 27 {
Vincent Coubard 638:c90ae1400bf2 28 gattc = gattcIn;
Vincent Coubard 638:c90ae1400bf2 29 connHandle = connectionHandleIn;
Vincent Coubard 638:c90ae1400bf2 30 declHandle = declHandleIn;
Vincent Coubard 638:c90ae1400bf2 31 valueHandle = valueHandleIn;
Vincent Coubard 638:c90ae1400bf2 32
Vincent Coubard 638:c90ae1400bf2 33 props._broadcast = propsIn.broadcast;
Vincent Coubard 638:c90ae1400bf2 34 props._read = propsIn.read;
Vincent Coubard 638:c90ae1400bf2 35 props._writeWoResp = propsIn.write_wo_resp;
Vincent Coubard 638:c90ae1400bf2 36 props._write = propsIn.write;
Vincent Coubard 638:c90ae1400bf2 37 props._notify = propsIn.notify;
Vincent Coubard 638:c90ae1400bf2 38 props._indicate = propsIn.indicate;
Vincent Coubard 638:c90ae1400bf2 39 props._authSignedWrite = propsIn.auth_signed_wr;
Vincent Coubard 638:c90ae1400bf2 40 }
Vincent Coubard 638:c90ae1400bf2 41
Vincent Coubard 638:c90ae1400bf2 42 void
Vincent Coubard 638:c90ae1400bf2 43 nRF5xDiscoveredCharacteristic::setup(nRF5xGattClient *gattcIn,
Vincent Coubard 638:c90ae1400bf2 44 Gap::Handle_t connectionHandleIn,
Vincent Coubard 638:c90ae1400bf2 45 UUID::ShortUUIDBytes_t uuidIn,
Vincent Coubard 638:c90ae1400bf2 46 ble_gatt_char_props_t propsIn,
Vincent Coubard 638:c90ae1400bf2 47 GattAttribute::Handle_t declHandleIn,
Vincent Coubard 638:c90ae1400bf2 48 GattAttribute::Handle_t valueHandleIn)
Vincent Coubard 638:c90ae1400bf2 49 {
Vincent Coubard 638:c90ae1400bf2 50 gattc = gattcIn;
Vincent Coubard 638:c90ae1400bf2 51 connHandle = connectionHandleIn;
Vincent Coubard 638:c90ae1400bf2 52 uuid = uuidIn;
Vincent Coubard 638:c90ae1400bf2 53 declHandle = declHandleIn;
Vincent Coubard 638:c90ae1400bf2 54 valueHandle = valueHandleIn;
Vincent Coubard 638:c90ae1400bf2 55
Vincent Coubard 638:c90ae1400bf2 56 props._broadcast = propsIn.broadcast;
Vincent Coubard 638:c90ae1400bf2 57 props._read = propsIn.read;
Vincent Coubard 638:c90ae1400bf2 58 props._writeWoResp = propsIn.write_wo_resp;
Vincent Coubard 638:c90ae1400bf2 59 props._write = propsIn.write;
Vincent Coubard 638:c90ae1400bf2 60 props._notify = propsIn.notify;
Vincent Coubard 638:c90ae1400bf2 61 props._indicate = propsIn.indicate;
Vincent Coubard 638:c90ae1400bf2 62 props._authSignedWrite = propsIn.auth_signed_wr;
Vincent Coubard 638:c90ae1400bf2 63 }