?? readme.txt
字號:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
/**
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
Abstract:
SDP Search and Record generator
**/
SDP Search and Record generator
OVERVIEW:
Recognizing the difficulty in creating an SDP service description and search
from scratch, Microsoft is providing a sample utility in bthnscreate.cxx to
automatically create a service or record. This utility can be run to create
an SDP record or to setup an SDP Service, Attribute, or ServiceAttribute
search based on information stored in a human readable file.
If run in verbose mode, the creator will generate the C code to either create
the record or perform the search, as appropriate.
Generating C code can be useful if you know most of
the parameters needed for a particular service beforehand, but must determine
others at runtime.
To add a comment to a file, put a semicolon as the first character on a line.
If running in verbose mode, any text after the semicolon will be added into
the generated C code as a comment.
Note that the generated C code always outputs functions in their BthNs form, for
instance BthNsSetService. If you have winsock2 on your device, you may change
this to WSASetService, which takes the same arguments and data structures.
Note: All numeric values in files should be represented in hex format.
RECORD CREATION:
usage:
bthnscreate [-verbose] -record fileName
If the -verbose flag is set, C code to create the record will be generated.
This code will create the appropriate COM objects to parse a record, write
the record into a binary stream, and then call BthNsSetService with the
appropriate parameters. Note that BthNsSetService behaves identically to
WSASetService, and unlike WSASetService does not require winsock2 on the
device.
The filename consists of SDP record elements. Each element has the following
format:
[attribute id] [type] [value]
Attribute id is the Attribute ID for the SDP record, value is the data itself,
and type is the representation of this value. Data sequences and alternatives
are represented as a series of [type] [value] pairs terminated by the "END"
string.
Example record file format:
; Simple data file
1 SEQUENCE
; Sequences contain one or more elements.
UUID16 FFF
UUID32 4000000
UUID128 12345678-ABCD-AF12-8800-12345678EF12
END
119 UINT16 19
More examples are in this directory and end in the .rec extension.
SEARCHING:
In all 3 search cases, when C code is generated it is left to the application
o determine what the bluetooth address should be, and also how to parse the
response that the server returns.
SERVICE SEARCH CREATION:
Usage:
bthnscreate [-verbose] -service fileName
If the -verbose flag is set, C code is generated to setup the UUIDs and
call the SDP lookup functions.
File format consists entirely of UUIDs. Each element has the following format:
[type] [value]
type must be either UUID32, UUID16, or UUID128.
Example search file format (searches for 3 UUIDs below):
UUID128 12345678-ABCD-AF12-8800-12345678EF12
UUID16 FFF
UUID32 4000000
ATTRIBUTE SEARCH CREATION
Usage:
bthnscreate [-verbose] -attribute fileName
If the -verbose flag is set, C code is generated to setup the attribute ID
structure and call the SDP lookup functions.
It is the applications responsibility to pass in a search handle
to the SDP lookup. This search handle is determined by the results of
SDP service search.
File format contais pairs of attribute IDs that specify the attribute range
to retrieve information for. The first number is the low attribute value
and the high value is the high attribute value (to query just one attribute,
set low and high to the same value).
Example attribute file format (finds all attributes for a service between 1-100
and also the attribute 119):
1 100
119 FFFF
SERVICE ATTRIBUTE SEARCH CREATION:
Usage:
bthnscreate [-verbose] -service_attribute fileName
If the -verboes flag is set, C code is generated to create the UUIDs,
attribute list, and call the SDP lookup functions.
The first part of the file contains the format of the UUIDs. The UUID list
is terminated by an "END" string. The attribute list follows the "END" string.
Example file format:
UUID128 12345678-ABCD-AF12-8800-12345678EF12
UUID16 fff
UUID32 4000000
END
1 100
119 FFFF
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -