source: azure_iot_hub_f767zi/trunk/asp_baseplatform/gdic/ble_shield2.1/BLEAttribute.h@ 457

Last change on this file since 457 was 457, checked in by coas-nagasima, 4 years ago

ファイルを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 4.6 KB
Line 
1/*
2 * TOPPERS BASE PLATFORM MIDDLEWARE
3 *
4 * Copyright (C) 2017-2018 by TOPPERS PROJECT
5 * Educational Working Group.
6 *
7 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
8 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
9 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
10 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
11 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
12 * スコード中に含まれていること.
13 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
14 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
15 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
16 * の無保証規定を掲載すること.
17 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
18 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
19 * と.
20 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
21 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
22 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
23 * 報告すること.
24 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
25 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
26 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
27 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
28 * 免責すること.
29 *
30 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
31 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
32 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
33 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
34 * の責任を負わない.
35 *
36 * @(#) $Id$
37 */
38
39/*
40The MIT License (MIT)
41
42Copyright (c) 2014 Sandeep Mistry
43
44Permission is hereby granted, free of charge, to any person obtaining a copy
45of this software and associated documentation files (the "Software"), to deal
46in the Software without restriction, including without limitation the rights
47to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48copies of the Software, and to permit persons to whom the Software is
49furnished to do so, subject to the following conditions:
50
51The above copyright notice and this permission notice shall be included in all
52copies or substantial portions of the Software.
53
54THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
60SOFTWARE.
61*/
62
63#ifndef _BLE_ATTRIBUTE_H_
64#define _BLE_ATTRIBUTE_H_
65
66#ifdef __cplusplus
67 extern "C" {
68#endif
69
70enum BLEAttributeType {
71 BLETypeService = 0x2800,
72 BLETypeCharacteristic = 0x2803,
73 BLETypeDescriptor = 0x2900
74};
75
76enum BLEProperty {
77 BLERead = 0x02,
78 BLEWriteWithoutResponse = 0x04,
79 BLEWrite = 0x08,
80 BLENotify = 0x10,
81 BLEIndicate = 0x20
82};
83
84#define MAX_UUID_LENGTH 16
85#define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 19
86
87typedef struct _nRF8001 nRF8001;
88
89typedef struct _BLEUuid {
90 const char * _str;
91 unsigned char _data[MAX_UUID_LENGTH];
92 unsigned char _length;
93} BLEUuid;
94
95
96typedef struct _BLEAttribute {
97 BLEUuid _uuid;
98 enum BLEAttributeType _type;
99} BLEAttribute;
100
101#define BLEService BLEAttribute
102
103typedef struct _BLEDescriptor {
104 BLEAttribute _attr;
105 unsigned char _valueSize;
106 unsigned char* _value;
107 unsigned char _valueLength;
108} BLEDescriptor;
109
110#ifdef __cplusplus
111}
112#endif
113
114#endif /* _BLE_ATTRIBUTE_H_ */
Note: See TracBrowser for help on using the repository browser.