test

Fork of nRF51822 by Nordic Semiconductor

Committer:
GlimwormBeacons
Date:
Sat Oct 10 09:19:50 2015 +0000
Revision:
448:b71e96a821de
Parent:
388:db85a09c27ef
test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 388:db85a09c27ef 1 /* mbed Microcontroller Library
rgrover1 388:db85a09c27ef 2 * Copyright (c) 2006-2013 ARM Limited
rgrover1 388:db85a09c27ef 3 *
rgrover1 388:db85a09c27ef 4 * Licensed under the Apache License, Version 2.0 (the "License");
rgrover1 388:db85a09c27ef 5 * you may not use this file except in compliance with the License.
rgrover1 388:db85a09c27ef 6 * You may obtain a copy of the License at
rgrover1 388:db85a09c27ef 7 *
rgrover1 388:db85a09c27ef 8 * http://www.apache.org/licenses/LICENSE-2.0
rgrover1 388:db85a09c27ef 9 *
rgrover1 388:db85a09c27ef 10 * Unless required by applicable law or agreed to in writing, software
rgrover1 388:db85a09c27ef 11 * distributed under the License is distributed on an "AS IS" BASIS,
rgrover1 388:db85a09c27ef 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rgrover1 388:db85a09c27ef 13 * See the License for the specific language governing permissions and
rgrover1 388:db85a09c27ef 14 * limitations under the License.
rgrover1 388:db85a09c27ef 15 */
rgrover1 388:db85a09c27ef 16
rgrover1 388:db85a09c27ef 17 #ifndef __NRF51822_SECURITY_MANAGER_H__
rgrover1 388:db85a09c27ef 18 #define __NRF51822_SECURITY_MANAGER_H__
rgrover1 388:db85a09c27ef 19
rgrover1 388:db85a09c27ef 20 #include <stddef.h>
rgrover1 388:db85a09c27ef 21
rgrover1 388:db85a09c27ef 22 #include "ble/SecurityManager.h"
rgrover1 388:db85a09c27ef 23 #include "btle_security.h"
rgrover1 388:db85a09c27ef 24
rgrover1 388:db85a09c27ef 25 class nRF5xSecurityManager : public SecurityManager
rgrover1 388:db85a09c27ef 26 {
rgrover1 388:db85a09c27ef 27 public:
rgrover1 388:db85a09c27ef 28 static nRF5xSecurityManager &getInstance();
rgrover1 388:db85a09c27ef 29
rgrover1 388:db85a09c27ef 30 /* Functions that must be implemented from SecurityManager */
rgrover1 388:db85a09c27ef 31 virtual ble_error_t init(bool enableBonding,
rgrover1 388:db85a09c27ef 32 bool requireMITM,
rgrover1 388:db85a09c27ef 33 SecurityIOCapabilities_t iocaps,
rgrover1 388:db85a09c27ef 34 const Passkey_t passkey) {
rgrover1 388:db85a09c27ef 35 return btle_initializeSecurity(enableBonding, requireMITM, iocaps, passkey);
rgrover1 388:db85a09c27ef 36 }
rgrover1 388:db85a09c27ef 37
rgrover1 388:db85a09c27ef 38 virtual ble_error_t getLinkSecurity(Gap::Handle_t connectionHandle, LinkSecurityStatus_t *securityStatusP) {
rgrover1 388:db85a09c27ef 39 return btle_getLinkSecurity(connectionHandle, securityStatusP);
rgrover1 388:db85a09c27ef 40 }
rgrover1 388:db85a09c27ef 41
rgrover1 388:db85a09c27ef 42 virtual ble_error_t purgeAllBondingState(void) {
rgrover1 388:db85a09c27ef 43 return btle_purgeAllBondingState();
rgrover1 388:db85a09c27ef 44 }
rgrover1 388:db85a09c27ef 45
rgrover1 388:db85a09c27ef 46 public:
rgrover1 388:db85a09c27ef 47 nRF5xSecurityManager() {
rgrover1 388:db85a09c27ef 48 /* empty */
rgrover1 388:db85a09c27ef 49 }
rgrover1 388:db85a09c27ef 50
rgrover1 388:db85a09c27ef 51 private:
rgrover1 388:db85a09c27ef 52 nRF5xSecurityManager(const nRF5xSecurityManager &);
rgrover1 388:db85a09c27ef 53 const nRF5xSecurityManager& operator=(const nRF5xSecurityManager &);
rgrover1 388:db85a09c27ef 54 };
rgrover1 388:db85a09c27ef 55
rgrover1 388:db85a09c27ef 56 #endif // ifndef __NRF51822_SECURITY_MANAGER_H__