Minor fixes
Fork of BLE_API by
Embed:
(wiki syntax)
Show/hide line numbers
DiscoveredService.h
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 #ifndef __DISCOVERED_SERVICE_H__ 00018 #define __DISCOVERED_SERVICE_H__ 00019 00020 #include "UUID.h" 00021 #include "GattAttribute.h" 00022 00023 /**@brief Type for holding information about the service and the characteristics found during 00024 * the discovery process. 00025 */ 00026 class DiscoveredService { 00027 public: 00028 void setup(UUID uuidIn, GattAttribute::Handle_t startHandleIn, GattAttribute::Handle_t endHandleIn) { 00029 uuid = uuidIn; 00030 startHandle = startHandleIn; 00031 endHandle = endHandleIn; 00032 } 00033 00034 void setup(GattAttribute::Handle_t startHandleIn, GattAttribute::Handle_t endHandleIn) { 00035 startHandle = startHandleIn; 00036 endHandle = endHandleIn; 00037 } 00038 00039 void setupLongUUID(UUID::LongUUIDBytes_t longUUID) { 00040 uuid.setupLong(longUUID); 00041 } 00042 00043 public: 00044 const UUID &getUUID(void) const { 00045 return uuid; 00046 } 00047 00048 const GattAttribute::Handle_t& getStartHandle(void) const { 00049 return startHandle; 00050 } 00051 const GattAttribute::Handle_t& getEndHandle(void) const { 00052 return endHandle; 00053 } 00054 00055 public: 00056 DiscoveredService() : uuid(UUID::ShortUUIDBytes_t(0)), 00057 startHandle(GattAttribute::INVALID_HANDLE), 00058 endHandle(GattAttribute::INVALID_HANDLE) { 00059 /* empty */ 00060 } 00061 00062 private: 00063 DiscoveredService(const DiscoveredService &); 00064 00065 private: 00066 UUID uuid; /**< UUID of the service. */ 00067 GattAttribute::Handle_t startHandle; /**< Service Handle Range. */ 00068 GattAttribute::Handle_t endHandle; /**< Service Handle Range. */ 00069 }; 00070 00071 #endif /*__DISCOVERED_SERVICE_H__*/
Generated on Wed Jul 13 2022 00:39:21 by 1.7.2