High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
services/UARTService.cpp@714:a6130aaa0fd9, 2015-07-02 (annotated)
- Committer:
- rgrover1
- Date:
- Thu Jul 02 09:06:11 2015 +0100
- Revision:
- 714:a6130aaa0fd9
Synchronized with git rev 7e8977d8
Author: Rohit Grover
Release 0.3.8
=============
This is a minor set of enhancements before we yotta-ize BLE_API.
Enhancements
~~~~~~~~~~~~
* Minor rework for class UUID; added a default and copy constructor; and a != operator.
* Added copy constructor and accessors for GapAdvertisingParams.
* GapScanningParams:: remove unnecessary checks for SCAN_TIMEOUT_MAX.
* Add a comment header block to explain why BLEDevice::init() may not be safe
to call from global static context.
* Introduce GattAttribute::INVALID_HANDLE.
* Replace some deprecated uses of Gap::address_t with Gap::Address_t.
Bugfixes
~~~~~~~~
* None.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rgrover1 | 714:a6130aaa0fd9 | 1 | /* mbed Microcontroller Library |
rgrover1 | 714:a6130aaa0fd9 | 2 | * Copyright (c) 2006-2013 ARM Limited |
rgrover1 | 714:a6130aaa0fd9 | 3 | * |
rgrover1 | 714:a6130aaa0fd9 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
rgrover1 | 714:a6130aaa0fd9 | 5 | * you may not use this file except in compliance with the License. |
rgrover1 | 714:a6130aaa0fd9 | 6 | * You may obtain a copy of the License at |
rgrover1 | 714:a6130aaa0fd9 | 7 | * |
rgrover1 | 714:a6130aaa0fd9 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
rgrover1 | 714:a6130aaa0fd9 | 9 | * |
rgrover1 | 714:a6130aaa0fd9 | 10 | * Unless required by applicable law or agreed to in writing, software |
rgrover1 | 714:a6130aaa0fd9 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
rgrover1 | 714:a6130aaa0fd9 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
rgrover1 | 714:a6130aaa0fd9 | 13 | * See the License for the specific language governing permissions and |
rgrover1 | 714:a6130aaa0fd9 | 14 | * limitations under the License. |
rgrover1 | 714:a6130aaa0fd9 | 15 | */ |
rgrover1 | 714:a6130aaa0fd9 | 16 | |
rgrover1 | 714:a6130aaa0fd9 | 17 | #include "UARTService.h" |
rgrover1 | 714:a6130aaa0fd9 | 18 | |
rgrover1 | 714:a6130aaa0fd9 | 19 | const uint8_t UARTServiceBaseUUID[UUID::LENGTH_OF_LONG_UUID] = { |
rgrover1 | 714:a6130aaa0fd9 | 20 | 0x6E, 0x40, 0x00, 0x00, 0xB5, 0xA3, 0xF3, 0x93, |
rgrover1 | 714:a6130aaa0fd9 | 21 | 0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E, |
rgrover1 | 714:a6130aaa0fd9 | 22 | }; |
rgrover1 | 714:a6130aaa0fd9 | 23 | const uint16_t UARTServiceShortUUID = 0x0001; |
rgrover1 | 714:a6130aaa0fd9 | 24 | const uint16_t UARTServiceTXCharacteristicShortUUID = 0x0002; |
rgrover1 | 714:a6130aaa0fd9 | 25 | const uint16_t UARTServiceRXCharacteristicShortUUID = 0x0003; |
rgrover1 | 714:a6130aaa0fd9 | 26 | const uint8_t UARTServiceUUID[UUID::LENGTH_OF_LONG_UUID] = { |
rgrover1 | 714:a6130aaa0fd9 | 27 | 0x6E, 0x40, (uint8_t)(UARTServiceShortUUID >> 8), (uint8_t)(UARTServiceShortUUID & 0xFF), 0xB5, 0xA3, 0xF3, 0x93, |
rgrover1 | 714:a6130aaa0fd9 | 28 | 0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E, |
rgrover1 | 714:a6130aaa0fd9 | 29 | }; |
rgrover1 | 714:a6130aaa0fd9 | 30 | const uint8_t UARTServiceUUID_reversed[UUID::LENGTH_OF_LONG_UUID] = { |
rgrover1 | 714:a6130aaa0fd9 | 31 | 0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, |
rgrover1 | 714:a6130aaa0fd9 | 32 | 0x93, 0xF3, 0xA3, 0xB5, (uint8_t)(UARTServiceShortUUID & 0xFF), (uint8_t)(UARTServiceShortUUID >> 8), 0x40, 0x6E |
rgrover1 | 714:a6130aaa0fd9 | 33 | }; |
rgrover1 | 714:a6130aaa0fd9 | 34 | const uint8_t UARTServiceTXCharacteristicUUID[UUID::LENGTH_OF_LONG_UUID] = { |
rgrover1 | 714:a6130aaa0fd9 | 35 | 0x6E, 0x40, (uint8_t)(UARTServiceTXCharacteristicShortUUID >> 8), (uint8_t)(UARTServiceTXCharacteristicShortUUID & 0xFF), 0xB5, 0xA3, 0xF3, 0x93, |
rgrover1 | 714:a6130aaa0fd9 | 36 | 0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E, |
rgrover1 | 714:a6130aaa0fd9 | 37 | }; |
rgrover1 | 714:a6130aaa0fd9 | 38 | const uint8_t UARTServiceRXCharacteristicUUID[UUID::LENGTH_OF_LONG_UUID] = { |
rgrover1 | 714:a6130aaa0fd9 | 39 | 0x6E, 0x40, (uint8_t)(UARTServiceRXCharacteristicShortUUID >> 8), (uint8_t)(UARTServiceRXCharacteristicShortUUID & 0xFF), 0xB5, 0xA3, 0xF3, 0x93, |
rgrover1 | 714:a6130aaa0fd9 | 40 | 0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E, |
rgrover1 | 714:a6130aaa0fd9 | 41 | }; |