うおーるぼっとをWiiリモコンでコントロールする新しいプログラムです。 以前のものより、Wiiリモコンが早く繋がる様になりました。 It is a program which controls A with the Wii remote. ※ A Bluetooth dongle and a Wii remote control are needed.
Dependencies: USBHost mbed FATFileSystem mbed-rtos
btstack/sdp_util.h@0:fccb789424fc, 2013-06-10 (annotated)
- Committer:
- jksoft
- Date:
- Mon Jun 10 16:01:50 2013 +0000
- Revision:
- 0:fccb789424fc
1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:fccb789424fc | 1 | /* |
jksoft | 0:fccb789424fc | 2 | * Copyright (C) 2010 by Matthias Ringwald |
jksoft | 0:fccb789424fc | 3 | * |
jksoft | 0:fccb789424fc | 4 | * Redistribution and use in source and binary forms, with or without |
jksoft | 0:fccb789424fc | 5 | * modification, are permitted provided that the following conditions |
jksoft | 0:fccb789424fc | 6 | * are met: |
jksoft | 0:fccb789424fc | 7 | * |
jksoft | 0:fccb789424fc | 8 | * 1. Redistributions of source code must retain the above copyright |
jksoft | 0:fccb789424fc | 9 | * notice, this list of conditions and the following disclaimer. |
jksoft | 0:fccb789424fc | 10 | * 2. Redistributions in binary form must reproduce the above copyright |
jksoft | 0:fccb789424fc | 11 | * notice, this list of conditions and the following disclaimer in the |
jksoft | 0:fccb789424fc | 12 | * documentation and/or other materials provided with the distribution. |
jksoft | 0:fccb789424fc | 13 | * 3. Neither the name of the copyright holders nor the names of |
jksoft | 0:fccb789424fc | 14 | * contributors may be used to endorse or promote products derived |
jksoft | 0:fccb789424fc | 15 | * from this software without specific prior written permission. |
jksoft | 0:fccb789424fc | 16 | * |
jksoft | 0:fccb789424fc | 17 | * THIS SOFTWARE IS PROVIDED BY MATTHIAS RINGWALD AND CONTRIBUTORS |
jksoft | 0:fccb789424fc | 18 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
jksoft | 0:fccb789424fc | 19 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
jksoft | 0:fccb789424fc | 20 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS |
jksoft | 0:fccb789424fc | 21 | * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
jksoft | 0:fccb789424fc | 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
jksoft | 0:fccb789424fc | 23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
jksoft | 0:fccb789424fc | 24 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
jksoft | 0:fccb789424fc | 25 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
jksoft | 0:fccb789424fc | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
jksoft | 0:fccb789424fc | 27 | * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
jksoft | 0:fccb789424fc | 28 | * SUCH DAMAGE. |
jksoft | 0:fccb789424fc | 29 | * |
jksoft | 0:fccb789424fc | 30 | */ |
jksoft | 0:fccb789424fc | 31 | |
jksoft | 0:fccb789424fc | 32 | /* |
jksoft | 0:fccb789424fc | 33 | * sdp_util.h |
jksoft | 0:fccb789424fc | 34 | */ |
jksoft | 0:fccb789424fc | 35 | |
jksoft | 0:fccb789424fc | 36 | #pragma once |
jksoft | 0:fccb789424fc | 37 | |
jksoft | 0:fccb789424fc | 38 | #include <stdint.h> |
jksoft | 0:fccb789424fc | 39 | |
jksoft | 0:fccb789424fc | 40 | #if defined __cplusplus |
jksoft | 0:fccb789424fc | 41 | extern "C" { |
jksoft | 0:fccb789424fc | 42 | #endif |
jksoft | 0:fccb789424fc | 43 | |
jksoft | 0:fccb789424fc | 44 | typedef enum { |
jksoft | 0:fccb789424fc | 45 | DE_NIL = 0, |
jksoft | 0:fccb789424fc | 46 | DE_UINT, |
jksoft | 0:fccb789424fc | 47 | DE_INT, |
jksoft | 0:fccb789424fc | 48 | DE_UUID, |
jksoft | 0:fccb789424fc | 49 | DE_STRING, |
jksoft | 0:fccb789424fc | 50 | DE_BOOL, |
jksoft | 0:fccb789424fc | 51 | DE_DES, |
jksoft | 0:fccb789424fc | 52 | DE_DEA, |
jksoft | 0:fccb789424fc | 53 | DE_URL |
jksoft | 0:fccb789424fc | 54 | } de_type_t; |
jksoft | 0:fccb789424fc | 55 | |
jksoft | 0:fccb789424fc | 56 | typedef enum { |
jksoft | 0:fccb789424fc | 57 | DE_SIZE_8 = 0, |
jksoft | 0:fccb789424fc | 58 | DE_SIZE_16, |
jksoft | 0:fccb789424fc | 59 | DE_SIZE_32, |
jksoft | 0:fccb789424fc | 60 | DE_SIZE_64, |
jksoft | 0:fccb789424fc | 61 | DE_SIZE_128, |
jksoft | 0:fccb789424fc | 62 | DE_SIZE_VAR_8, |
jksoft | 0:fccb789424fc | 63 | DE_SIZE_VAR_16, |
jksoft | 0:fccb789424fc | 64 | DE_SIZE_VAR_32 |
jksoft | 0:fccb789424fc | 65 | } de_size_t; |
jksoft | 0:fccb789424fc | 66 | |
jksoft | 0:fccb789424fc | 67 | // UNIVERSAL ATTRIBUTE DEFINITIONS |
jksoft | 0:fccb789424fc | 68 | #define SDP_ServiceRecordHandle 0x0000 |
jksoft | 0:fccb789424fc | 69 | #define SDP_ServiceClassIDList 0x0001 |
jksoft | 0:fccb789424fc | 70 | #define SDP_ServiceRecordState 0x0002 |
jksoft | 0:fccb789424fc | 71 | #define SDP_ServiceID 0x0003 |
jksoft | 0:fccb789424fc | 72 | #define SDP_ProtocolDescriptorList 0x0004 |
jksoft | 0:fccb789424fc | 73 | #define SDP_BrowseGroupList 0x0005 |
jksoft | 0:fccb789424fc | 74 | #define SDP_LanguageBaseAttributeIDList 0x0006 |
jksoft | 0:fccb789424fc | 75 | #define SDP_ServiceInfoTimeToLive 0x0007 |
jksoft | 0:fccb789424fc | 76 | #define SDP_ServiceAvailability 0x0008 |
jksoft | 0:fccb789424fc | 77 | #define SDP_BluetoothProfileDescriptorList 0x0009 |
jksoft | 0:fccb789424fc | 78 | #define SDP_DocumentationURL 0x000a |
jksoft | 0:fccb789424fc | 79 | #define SDP_ClientExecutableURL 0x000b |
jksoft | 0:fccb789424fc | 80 | #define SDP_IconURL 0x000c |
jksoft | 0:fccb789424fc | 81 | #define SDP_AdditionalProtocolDescriptorList 0x000d |
jksoft | 0:fccb789424fc | 82 | #define SDP_SupportedFormatsList 0x0303 |
jksoft | 0:fccb789424fc | 83 | |
jksoft | 0:fccb789424fc | 84 | // SERVICE CLASSES |
jksoft | 0:fccb789424fc | 85 | #define SDP_OBEXObjectPush 0x1105 |
jksoft | 0:fccb789424fc | 86 | #define SDP_OBEXFileTransfer 0x1106 |
jksoft | 0:fccb789424fc | 87 | #define SDP_PublicBrowseGroup 0x1002 |
jksoft | 0:fccb789424fc | 88 | |
jksoft | 0:fccb789424fc | 89 | // PROTOCOLS |
jksoft | 0:fccb789424fc | 90 | #define SDP_SDPProtocol 0x0001 |
jksoft | 0:fccb789424fc | 91 | #define SDP_UDPProtocol 0x0002 |
jksoft | 0:fccb789424fc | 92 | #define SDP_RFCOMMProtocol 0x0003 |
jksoft | 0:fccb789424fc | 93 | #define SDP_OBEXProtocol 0x0008 |
jksoft | 0:fccb789424fc | 94 | #define SDP_L2CAPProtocol 0x0100 |
jksoft | 0:fccb789424fc | 95 | |
jksoft | 0:fccb789424fc | 96 | // OFFSETS FOR LOCALIZED ATTRIBUTES - SDP_LanguageBaseAttributeIDList |
jksoft | 0:fccb789424fc | 97 | #define SDP_Offest_ServiceName 0x0000 |
jksoft | 0:fccb789424fc | 98 | #define SDP_Offest_ServiceDescription 0x0001 |
jksoft | 0:fccb789424fc | 99 | #define SDP_Offest_ProviderName 0x0002 |
jksoft | 0:fccb789424fc | 100 | |
jksoft | 0:fccb789424fc | 101 | // OBEX |
jksoft | 0:fccb789424fc | 102 | #define SDP_vCard_2_1 0x01 |
jksoft | 0:fccb789424fc | 103 | #define SDP_vCard_3_0 0x02 |
jksoft | 0:fccb789424fc | 104 | #define SDP_vCal_1_0 0x03 |
jksoft | 0:fccb789424fc | 105 | #define SDP_iCal_2_0 0x04 |
jksoft | 0:fccb789424fc | 106 | #define SDP_vNote 0x05 |
jksoft | 0:fccb789424fc | 107 | #define SDP_vMessage 0x06 |
jksoft | 0:fccb789424fc | 108 | #define SDP_OBEXFileTypeAny 0xFF |
jksoft | 0:fccb789424fc | 109 | |
jksoft | 0:fccb789424fc | 110 | // MARK: DateElement |
jksoft | 0:fccb789424fc | 111 | void de_dump_data_element(uint8_t * record); |
jksoft | 0:fccb789424fc | 112 | int de_get_len(uint8_t *header); |
jksoft | 0:fccb789424fc | 113 | de_size_t de_get_size_type(uint8_t *header); |
jksoft | 0:fccb789424fc | 114 | de_type_t de_get_element_type(uint8_t *header); |
jksoft | 0:fccb789424fc | 115 | int de_get_header_size(uint8_t * header); |
jksoft | 0:fccb789424fc | 116 | void de_create_sequence(uint8_t *header); |
jksoft | 0:fccb789424fc | 117 | void de_store_descriptor_with_len(uint8_t * header, de_type_t type, de_size_t size, uint32_t len); |
jksoft | 0:fccb789424fc | 118 | uint8_t * de_push_sequence(uint8_t *header); |
jksoft | 0:fccb789424fc | 119 | void de_pop_sequence(uint8_t * parent, uint8_t * child); |
jksoft | 0:fccb789424fc | 120 | void de_add_number(uint8_t *seq, de_type_t type, de_size_t size, uint32_t value); |
jksoft | 0:fccb789424fc | 121 | void de_add_data( uint8_t *seq, de_type_t type, uint16_t size, uint8_t *data); |
jksoft | 0:fccb789424fc | 122 | |
jksoft | 0:fccb789424fc | 123 | int de_get_data_size(uint8_t * header); |
jksoft | 0:fccb789424fc | 124 | void de_add_uuid128(uint8_t * seq, uint8_t * uuid); |
jksoft | 0:fccb789424fc | 125 | |
jksoft | 0:fccb789424fc | 126 | // MARK: SDP |
jksoft | 0:fccb789424fc | 127 | uint16_t sdp_append_attributes_in_attributeIDList(uint8_t *record, uint8_t *attributeIDList, uint16_t startOffset, uint16_t maxBytes, uint8_t *buffer); |
jksoft | 0:fccb789424fc | 128 | uint8_t * sdp_get_attribute_value_for_attribute_id(uint8_t * record, uint16_t attributeID); |
jksoft | 0:fccb789424fc | 129 | uint8_t sdp_set_attribute_value_for_attribute_id(uint8_t * record, uint16_t attributeID, uint32_t value); |
jksoft | 0:fccb789424fc | 130 | int sdp_record_matches_service_search_pattern(uint8_t *record, uint8_t *serviceSearchPattern); |
jksoft | 0:fccb789424fc | 131 | int spd_get_filtered_size(uint8_t *record, uint8_t *attributeIDList); |
jksoft | 0:fccb789424fc | 132 | int sdp_filter_attributes_in_attributeIDList(uint8_t *record, uint8_t *attributeIDList, uint16_t startOffset, uint16_t maxBytes, uint16_t *usedBytes, uint8_t *buffer); |
jksoft | 0:fccb789424fc | 133 | |
jksoft | 0:fccb789424fc | 134 | void sdp_create_spp_service(uint8_t *service, int service_id, const char *name); |
jksoft | 0:fccb789424fc | 135 | |
jksoft | 0:fccb789424fc | 136 | #if defined __cplusplus |
jksoft | 0:fccb789424fc | 137 | } |
jksoft | 0:fccb789424fc | 138 | #endif |