Junichi Katsu / Mbed 2 deprecated BLEControl

Dependencies:   FatFileSystem TB6612FNG2 mbed

Committer:
mbed_Cookbook_SE
Date:
Mon Nov 30 09:32:15 2015 +0000
Revision:
0:de03cbbcd0ff
??

Who changed what in which revision?

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