BLE temperature profile using digital DS1820 or analog LM35 sensors

Dependencies:   DS1820

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers nRF51822n.cpp Source File

nRF51822n.cpp

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2006-2013 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016   
00017 #include "mbed.h"
00018 #include "nRF51822n.h"
00019 
00020 #include "btle/btle.h"
00021 
00022 /**************************************************************************/
00023 /*!
00024     @brief  Constructor
00025 */
00026 /**************************************************************************/
00027 nRF51822n::nRF51822n(void)
00028 {
00029 }
00030 
00031 /**************************************************************************/
00032 /*!
00033     @brief  Destructor
00034 */
00035 /**************************************************************************/
00036 nRF51822n::~nRF51822n(void)
00037 {
00038 }
00039 
00040 /**************************************************************************/
00041 /*!
00042     @brief  Initialises anything required to start using BLE
00043             
00044     @returns    ble_error_t
00045     
00046     @retval     BLE_ERROR_NONE
00047                 Everything executed properly
00048                 
00049     @section EXAMPLE
00050 
00051     @code
00052 
00053     @endcode
00054 */
00055 /**************************************************************************/
00056 ble_error_t nRF51822n::init(void)
00057 {
00058   /* ToDo: Clear memory contents, reset the SD, etc. */
00059   btle_init();
00060 
00061   return BLE_ERROR_NONE;
00062 }
00063 
00064 /**************************************************************************/
00065 /*!
00066     @brief  Resets the BLE HW, removing any existing services and
00067             characteristics
00068             
00069     @returns    ble_error_t
00070     
00071     @retval     BLE_ERROR_NONE
00072                 Everything executed properly
00073                 
00074     @section EXAMPLE
00075 
00076     @code
00077 
00078     @endcode
00079 */
00080 /**************************************************************************/
00081 ble_error_t nRF51822n::reset(void)
00082 {
00083     wait(0.5);
00084     
00085     /* Wait for the radio to come back up */
00086     wait(1);
00087     
00088     return BLE_ERROR_NONE;
00089 }