manual: fixed typos

This commit is contained in:
Milanka Ringwald 2015-04-27 00:02:07 +02:00
parent 262f934d54
commit c26aef2c20
11 changed files with 157 additions and 127 deletions

View File

@ -133,6 +133,12 @@ morekeywords={*, timer_source_t, data_source_t, uint32_t, uint16_t, uint8_t, RUN
\newcommand{\OpenOCD}{\urlfoot{http://openocd.org}{OpenOCD}}
\newcommand{\mplabxc}{\urlfoot{http://www.microchip.com/pagehandler/en\_us/devtools/mplabxc/}{MPLAB XC}}
\newcommand{\PICkit}{\urlfoot{http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=pg164130}{PICkit 3}}
\newcommand{\pkgconfig}{\urlfoot{http://www.freedesktop.org/wiki/Software/pkg-config/}{pkg-config}}
\newcommand{\libusb}{\urlfoot{www.libusb.org}{libusb}}
\newcommand{\Zadig}{\urlfoot{http://zadig.akeo.ie}{Zadig}}
\newcommand{\MSYS}{\urlfoot{www.mingw.org/wiki/msys}{MSYS}}
\newcommand{\MINGW}{\urlfoot{www.mingw.org}{MINGW32}}
%level -1: part, 0: chapter, 1: section, etc.
\setcounter{tocdepth}{3}
@ -145,7 +151,7 @@ morekeywords={*, timer_source_t, data_source_t, uint32_t, uint16_t, uint8_t, RUN
\pagebreak
Thanks for checking out BTstack! In this manual, we first provide a 'quick starter guide' for common platforms before highlighting BTstack's main design choices and go over all implemented protocols and profiles. A series of examples shows how BTstack can be used to implement common
Thanks for checking out BTstack! In this manual, we first provide a 'quick starter guide' for common platforms before highlighting BTstack's main design choices and go over all implemented protocols and profiles. A series of examples show how BTstack can be used to implement common
use cases. Finally, we outline the basic steps when integrating BTstack into existing single-threaded or even multi-threaded environments. The Revision History is shown in the Appendix \ref{appendix:revision_history} on page \pageref{appendix:revision_history}.
\section{Quick Start}
@ -153,7 +159,7 @@ use cases. Finally, we outline the basic steps when integrating BTstack into exi
\subsection{General Tools}
On Unix-based systems, git, make, and Python are usually installed. If not, use the system's packet manager to install them.
On Windows, you need to install and configure, GNU Make, Python, and optionally git manually:
On Windows, you need to manually install and configure GNU Make, Python, and optionally git :
\begin{itemize}
\item \GNUMake{} for Windows: Add its bin folder to the Windows Path in Environment Variables. The bin folder is where make.exe resides, and it's usually located in \path{C:\Program Files\GnuWin32\bin}.
\item \Python{} for Windows: Add Python installation folder to the Windows Path in Environment Variables.

View File

@ -1,12 +1,39 @@
% !TEX root = btstack_gettingstarted.tex
In the following, we provide more information on specific platform setups, toolchains, programmers, and init scripts.
\subsubsection{libusb}
$ $
The quickest way to try BTstack is on a Linux or OS X system with an additional USB Bluetooth module. The Makefile in \path{platforms/libusb} requires \pkgconfig{} and \libusb{}-1.0 or higher to be installed.
On Linux, it's usually necessary to run the examples as root as the kernel needs to detach from the USB module.
On OS X, it's necessary to tell the OS to only use the internal Bluetooth. For this, execute:
\begin{lstlisting}
sudo nvram bluetoothHostControllerSwitchBehavior=never
\end{lstlisting}
It's also possible to run the examples on Win32 systems. For this:
\begin{itemize}
\item Install \MSYS{} and \MINGW{} using the MINGW installer
\item Compile and install libusb-1.0.19 to /usr/local/ in msys command shell
\item Setup a USB Bluetooth dongle for use with libusb-1.0:
\begin{itemize}
\item Start \Zadig{}
\item Select Options $\rightarrow$ "List all devices"
\item Select USB Bluetooth dongle in the big pull down list
\item Select WinUSB (libusb) in the right pull pull down list
\item Select "Replace Driver"
\end{itemize}
\end{itemize}
Now, you can run the examples from the $msys$ shell the same way as on Linux/OS X.
\subsubsection{Texas Instruments MSP430-based boards}
$ $
\emph{Compiler Setup} The MSP430 port of BTstack is developed using the Long Term Support (LTS) version of mspgcc. General information about it and installation instructions are provided on the \MSPGCCWiki{}. On Windows, you need to download and extract \mspgcc{} to \path{C:\mspgcc}. Add \path{C:\mspgcc\bin} folder to the Windows Path in Environment variable as explained in Section \ref{sec:windowsPath}.
\textbf{Compiler Setup.} The MSP430 port of BTstack is developed using the Long Term Support (LTS) version of mspgcc. General information about it and installation instructions are provided on the \MSPGCCWiki{}. On Windows, you need to download and extract \mspgcc{} to \path{C:\mspgcc}. Add \path{C:\mspgcc\bin} folder to the Windows Path in Environment variable as explained in Section \ref{sec:windowsPath}.
\emph{Loading Firmware} To load firmware files onto the MSP430 MCU for the MSP-EXP430F5438 Experimeneter board, you need a programmer like the MSP430 MSP-FET430UIF debugger or something similar. The eZ430-RF2560 and MSP430F5529LP contain a basic debugger. the Now, you can use one of following software tools:
\textbf{Loading Firmware.} To load firmware files onto the MSP430 MCU for the MSP-EXP430F5438 Experimeneter board, you need a programmer like the MSP430 MSP-FET430UIF debugger or something similar. The eZ430-RF2560 and MSP430F5529LP contain a basic debugger. Now, you can use one of following software tools:
\begin{itemize}
\item \MSPFlasher{} (windows-only):
@ -32,7 +59,9 @@ run
\end{lstlisting}
\subsubsection{Texas Instruments CC256x-based chipsets}
\emph{CC256x Init Scripts} In order to use the CC256x chipset on the PAN13xx modules and others, an initialization script must be obtained. Due to licensing restrictions, this initialization script must be obtained separately as follows:
$ $
\textbf{CC256x Init Scripts.} In order to use the CC256x chipset on the PAN13xx modules and others, an initialization script must be obtained. Due to licensing restrictions, this initialization script must be obtained separately as follows:
\begin{itemize}
\item Download the \BTSfile{} for your CC256x-based module.
\item Copy the included .bts file into \path{btstack/chipset-cc256x}
@ -41,45 +70,25 @@ run
The common code for all CC256x chipsets is provided by $bt\_control\_cc256x.c$. During the setup, $bt\_control\_cc256x\_instance$ function is used to get a $bt\_control\_t$ instance and passed to $hci\_init$ function.
Note: Depending on the CC256x-based module you're using, you'll need to update the reference \path{bluetooth_init_cc256...} in the Makefile to match the downloaded file.
\textbf{Note:} Depending on the CC256x-based module you're using, you'll need to update the reference \path{bluetooth_init_cc256...} in the Makefile to match the downloaded file.
Update: For the latest revision of the CC256x chipsets, the CC2560B and CC2564B, TI decided to split the init script into a main part and the BLE part. The conversion script has been updated to detect $blueooth\_init\_cc256x\_1.2.bts$ and adds $BLE\_init\_cc256x\_1.2.bts$ if present and merges them into a single .c file.
\textbf{Update:} For the latest revision of the CC256x chipsets, the CC2560B and CC2564B, TI decided to split the init script into a main part and the BLE part. The conversion script has been updated to detect $bluetooth\_init\_cc256x\_1.2.bts$ and adds $BLE\_init\_cc256x\_1.2.bts$ if present and merges them into a single .c file.
\subsubsection{MSP-EXP430F5438 + CC256x Platform}
\label{platform:msp430}
\emph{Hardware Setup} We assume that a PAN1315, PAN1317, or PAN1323 module is plugged into RF1 and RF2 of the MSP-EXP430F5438 board and the "RF3 Adapter board" is used or at least simulated. See \UserGuide{}.
$ $
\textbf{Hardware Setup.} We assume that a PAN1315, PAN1317, or PAN1323 module is plugged into RF1 and RF2 of the MSP-EXP430F5438 board and the "RF3 Adapter board" is used or at least simulated. See \UserGuide{}.
\subsubsection{STM32F103RB Nucleo + CC256x Platform}
$ $
To try BTstack on this platform, you'll need a simple adaptor board. For details, please read the documentation in \path{platforms/stm32-f103rb-nucleo/README.md}.
\subsubsection{PIC32 Bluetooth Audio Development Kit}
The PIC32 Bluetooth Audio Development Kit comes with the CSR8811-based BTM805 Bluetooth module. In the port, the UART on the DAC daugtherboard was used for the debug output. Please remove the DAC board and connect a 3.3V USB-2-UART converter to GND and TX to get the debug output.
$ $
The PIC32 Bluetooth Audio Development Kit comes with the CSR8811-based BTM805 Bluetooth module. In the port, the UART on the DAC daughter board was used for the debug output. Please remove the DAC board and connect a 3.3V USB-2-UART converter to GND and TX to get the debug output.
In \path{platforms/pic32-harmony}, a project file for the MPLAB X IDE is provided as well as a regular Makefile. Both assume that the MPLAB XC32 compiler is installed. The project is set to use -Os optimization which will cause warnings if you only have the Free version. It will still compile a working example. For this platform, we only provide the SPP and LE Counter example directly. Other examples can be run by replacing the spp\_and\_le\_counter.c file with one of the other example files.
\subsubsection{libusb}
The quickest way to try BTstack is on a Linux or OS X system with an additional USB Bluetooth module. The Makefile in \path{platforms/libusb}
requires pkgconfig and libusb-1.0 or higher to be installed.
On Linux, it's usually necessary to run the examples as root as the kernel needs to detach from the USB module.
On OS X, it's neccessary to tell the OS to only use the internal Bluetooth. For this, execute
\begin{lstlisting}
sudo nvram bluetoothHostControllerSwitchBehavior=never
\end{lstlisting}
It's also possible to run the examples on Win32 systems. For this,
\begin{itemize}
\item Install MSYS and MINGW32 using the MINGW installer
\item Compile and install libusb-1.0.19 to /usr/local/ in msys command shell
\item Setup a USB Bluetooth dongle for use with libusb-1.0:
\begin{itemize}
\item Start Zadig from http://zadig.akeo.ie
\item Select Options $\rightarrow$ List all devices
\item Select USB Bluetooth dongle in the big pull down list
\item Select WinUSB (libusb) in the right pull pull down list
\item Select Replace Driver
\end{itemize}
\end{itemize}
Now, you can run the examples from the msys shell the same way as on Linux/OS X.

View File

@ -236,17 +236,17 @@ static void packet_handler (uint8_t packet_type, uint8_t *packet, uint16_t size)
}
/* @text For more details on discovering remote devices, please see
* Section DiscoverRemoteDevices
* Section DiscoverRemoteDevices.
*/
/* @section Main app setup
/* @section Main Application Setup
*
* @text Listing MainConfiguration shows main application code.
* It registers the HCI packet handler and starts the Bluetoth stack
* It registers the HCI packet handler and starts the Bluetooth stack.
*/
/* LISTING_START(MainConfiguration): Setup heartbeat timer */
/* LISTING_START(MainConfiguration): Setup packet handler for GAP inquiry */
int btstack_main(int argc, const char * argv[]);
int btstack_main(int argc, const char * argv[]) {
hci_register_packet_handler(packet_handler);

View File

@ -178,7 +178,7 @@ static void fill_advertising_report_from_packet(advertising_report_t * report, u
*
* @text The HCI packet handler has to start the scanning,
* to find the first advertising device, to stop scanning, to connect
* to and later to disconnect from it, to start the gatt client upon
* to and later to disconnect from it, to start the GATT client upon
* the connection is completed, and to send the first query - in this
* case the gatt_client_discover_primary_services() is called, see
* Listing GATTBrowserHCIPacketHandler.

View File

@ -72,10 +72,44 @@
#define HEARTBEAT_PERIOD_MS 1000
/* LISTING_START(notificationFlag): Notification Flag */
/* @section Main Application Setup
*
* @text Listing MainConfiguration shows main application code.
* It initializes L2CAP, the Security Manager and configures the ATT Server with the pre-compiled
* ATT Database generated from $le_counter.gatt$. Finally, it configures the heartbeat handler and
* boots the Bluetooth stack.
*/
/* LISTING_START(MainConfiguration): Init L2CAP SM ATT Server and start heartbeat timer */
static int le_notification_enabled;
static timer_source_t heartbeat;
static void packet_handler (void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
static uint16_t att_read_callback(uint16_t con_handle, uint16_t att_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size);
static int att_write_callback(uint16_t con_handle, uint16_t att_handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size);
static void heartbeat_handler(struct timer *ts);
static void le_counter_setup(){
l2cap_init();
l2cap_register_packet_handler(packet_handler);
// setup le device db
le_device_db_init();
// setup SM: Display only
sm_init();
// setup ATT server
att_server_init(profile_data, att_read_callback, att_write_callback);
att_dump_attributes();
// set one-shot timer
heartbeat.process = &heartbeat_handler;
run_loop_set_timer(&heartbeat, HEARTBEAT_PERIOD_MS);
run_loop_add_timer(&heartbeat);
}
/* LISTING_END */
/*
* @section Managing LE Advertisements
*
@ -142,10 +176,10 @@ static void gap_run(){
/*
* @section Packet Handler
*
* @text The packet handler is only used to trigger advertisements after BTstack is ready and after disconnects.
* See Listing packetHandler.
* Advertisements are not automatically re-enabled after a connection was closed even though they have been active before.
*
* @text The packet handler is only used to trigger advertisements
* after BTstack is ready and after disconnects, see Listing packetHandler.
* Advertisements are not automatically re-enabled after a connection
* was closed, even though they have been active before.
*/
/* LISTING_START(packetHandler): Packet Handler */
@ -155,7 +189,7 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
switch (packet[0]) {
case BTSTACK_EVENT_STATE:
// bt stack activated, get started - set local name
// BTstack activated, get started
if (packet[2] == HCI_STATE_WORKING) {
todos = SET_ADVERTISEMENT_PARAMS | SET_ADVERTISEMENT_DATA | ENABLE_ADVERTISEMENTS;
gap_run();
@ -181,14 +215,13 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
/* LISTING_END */
/*
* @section Hearbeat Handler
* @section Heartbeat Handler
*
* @text The hearbeat handler updates the value of the single Characteristic provided in this example
* and sends a notification for this characteristic if enabled. See Listing heartbeat.
* @text The heartbeat handler updates the value of the single Characteristic provided in this example,
* and sends a notification for this characteristic if enabled, see Listing heartbeat.
*/
/* LISTING_START(heartbeat): Hearbeat Handler */
static timer_source_t heartbeat;
static int counter = 0;
static char counter_string[30];
static int counter_string_len;
@ -212,7 +245,7 @@ static void heartbeat_handler(struct timer *ts){
*
* @text The ATT Server handles all reads to constant data. For dynamic data like the custom characteristic, the registered
* att_read_callback is called. To handle long characteristics and long reads, the att_read_callback is first called
* with buffer == NULL, to request the total value lenght. Then it will be called again requesting a chunk of the value.
* with buffer == NULL, to request the total value length. Then it will be called again requesting a chunk of the value.
* See Listing attRead.
*/
@ -239,7 +272,7 @@ static uint16_t att_read_callback(uint16_t con_handle, uint16_t att_handle, uint
*
* @text The only valid ATT write in this example is to the Client Characteristic Configuration, which configures notification
* and indication. If the ATT handle matches the client configuration handle, the new configuration value is stored and used
* in the hearbeat handler to decide if a new value should be sent. See Listing attWrite
* in the heartbeat handler to decide if a new value should be sent. See Listing attWrite.
*/
/* LISTING_START(attWrite): ATT Write */
@ -250,40 +283,14 @@ static int att_write_callback(uint16_t con_handle, uint16_t att_handle, uint16_t
}
/* LISTING_END */
/* @section Main app setup
*
* @text Listing MainConfiguration shows main application code.
* It initializes L2CAP, the Security Manager and configures the ATT Server with the pre-compiled
* ATT Database generated from $le_counter.gatt$. Finally, it configures the heartbeat handler and
* boots the Bluetooth stack.
*/
/* LISTING_START(MainConfiguration): Init L2CAP SM ATT Server and start heartbeat timer */
int btstack_main(void);
int btstack_main(void)
{
l2cap_init();
l2cap_register_packet_handler(packet_handler);
// setup le device db
le_device_db_init();
// setup SM: Display only
sm_init();
// setup ATT server
att_server_init(profile_data, att_read_callback, att_write_callback);
att_dump_attributes();
// set one-shot timer
heartbeat.process = &heartbeat_handler;
run_loop_set_timer(&heartbeat, HEARTBEAT_PERIOD_MS);
run_loop_add_timer(&heartbeat);
le_counter_setup();
// turn on!
hci_power_control(HCI_POWER_ON);
return 0;
}
/* LISTING_END */
/* EXAMPLE_END */

View File

@ -80,7 +80,7 @@ static void heartbeat_handler(timer_source_t *ts){
}
/* LISTING_END */
/* @section Main app setup
/* @section Main Application Setup
*
* @text Listing MainConfiguration shows main application code.
* It configures the heartbeat tier and adds it to the run loop.

View File

@ -126,13 +126,40 @@ static char tap_dev_name[16] = "bnep%d";
static data_source_t tap_dev_ds;
/* @section Main application configuration
*
* @text In the application configuration, L2CAP and BNEP are initialized and a BNEP service, for server mode,
* is registered, before the Bluetooth stack gets started, as shown in Listing PanuSetup.
*/
/* LISTING_START(PanuSetup): Panu setup */
static void packet_handler (void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
static void handle_sdp_client_query_result(sdp_query_event_t *event);
static void panu_setup(){
// Initialize L2CAP
l2cap_init();
l2cap_register_packet_handler(packet_handler);
// Initialise BNEP
bnep_init();
bnep_register_packet_handler(packet_handler);
// Minimum L2CAP MTU for bnep is 1691 bytes
bnep_register_service(NULL, SDP_PANU, 1691);
// Initialise SDP
sdp_parser_init();
sdp_parser_register_callback(handle_sdp_client_query_result);
}
/* LISTING_END */
/* @section TUN / TAP interface routines
*
* @text This example requires a TUN/TAP interface to connect the Bluetooth network interface
* with the native system. It has been tested on Linux and OS X, but should work on any
* system that provides TUN/TAP with minor modifications.
*
* On Linux, TUN/TAP is availabe by default. On OS X, tuntaposx from
* On Linux, TUN/TAP is available by default. On OS X, tuntaposx from
* http://tuntaposx.sourceforge.net needs to be installed.
*
* \emph{tap_alloc} sets up a virtual network interface with the given Bluetooth Address.
@ -230,7 +257,7 @@ int tap_alloc(char *dev, bd_addr_t bd_addr)
}
/*
* @text Listig processTapData shows how a packet is received from the TAP network interface
* @text Listing processTapData shows how a packet is received from the TAP network interface
* and forwarded over the BNEP connection.
*
* After successfully reading a network packet, the call to
@ -443,11 +470,11 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
/* LISTING_RESUME */
/* @text In server mode, BNEP_EVENT_INCOMING_CONNECTION is received after a client has connected.
* and the TAP network interface is then configured. A data source is set up and registered with the
* The TAP network interface is then configured. A data source is set up and registered with the
* run loop to receive Ethernet packets from the TAP interface.
*
* The event contains both the source and destination UUIDs, as well as the MTU for this connection and
* the BNEP Channel ID, that is used for sending Ethernet packets over BNEP.
* the BNEP Channel ID, which is used for sending Ethernet packets over BNEP.
*/
case BNEP_EVENT_INCOMING_CONNECTION:
// data: event(8), len(8), bnep source uuid (16), bnep destination uuid (16), remote_address (48)
@ -474,7 +501,7 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
/* LISTING_PAUSE */
/* @text In client mode, BNEP_EVENT_OPEN_CHANNEL_COMPLETE is received after a client has connected
* or when the connection fails. The status field returs the error code. It is otherwise identical to
* or when the connection fails. The status field returns the error code. It is otherwise identical to
* BNEP_EVENT_INCOMING_CONNECTION before.
*/
case BNEP_EVENT_OPEN_CHANNEL_COMPLETE:
@ -506,13 +533,13 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
/* LISTING_RESUME */
/* @text If there is a timeout during the connection setup, BNEP_EVENT_CHANNEL_TIMEOUT will be received
* and the BNEP connection closed
* and the BNEP connection will be closed
*/
case BNEP_EVENT_CHANNEL_TIMEOUT:
printf("BNEP channel timeout! Channel will be closed\n");
break;
/* @text BNEP_EVENT_CHANNEL_CLOSED is received when the connection gets closed
/* @text BNEP_EVENT_CHANNEL_CLOSED is received when the connection gets closed.
*/
case BNEP_EVENT_CHANNEL_CLOSED:
printf("BNEP channel closed\n");
@ -564,33 +591,15 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
}
/* LISTING_END */
/* @section Main configuration
*
* @text In the app configuration, L2CAP and BNEP are initialized and a BNEP service, for server mode,
* is registered, before the Bluetooth stack gets started
*/
int btstack_main(int argc, const char * argv[]);
int btstack_main(int argc, const char * argv[]){
printf("Client HCI init done\n");
// Initialize L2CAP
l2cap_init();
l2cap_register_packet_handler(packet_handler);
// Initialise BNEP
bnep_init();
bnep_register_packet_handler(packet_handler);
// Minimum L2CAP MTU for bnep is 1691 bytes
bnep_register_service(NULL, SDP_PANU, 1691);
panu_setup();
// Turn on the device
hci_power_control(HCI_POWER_ON);
// Initialise SDP
sdp_parser_init();
sdp_parser_register_callback(handle_sdp_client_query_result);
return 0;
}

View File

@ -105,22 +105,21 @@ static void sdp_client_init(){
/* @section SDP Client Query
*
To trigger an SDP query to get the a list of service records on a remote device,
* To trigger an SDP query to get the a list of service records on a remote device,
* you need to call sdp_general_query_for_uuid() with the remote address and the
* BNEP protocol UUID, as shown in Listing SDPQueryUUID.
* In this example we again used fixed address of the remote device. Please update
* for your environment.
*/
/* LISTING_START(SDPQueryUUID): Quering the a list of service records on a remote device. */
/* LISTING_START(SDPQueryUUID): Querying the a list of service records on a remote device. */
static void packet_handler (void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
if (packet_type != HCI_EVENT_PACKET) return;
uint8_t event = packet[0];
switch (event) {
case BTSTACK_EVENT_STATE:
// bt stack activated, get started
// BTstack activated, get started
if (packet[2] == HCI_STATE_WORKING){
printf("Start SDP BNEP query.\n");
sdp_general_query_for_uuid(remote, SDP_BNEPProtocol);
@ -162,7 +161,7 @@ char * get_string_from_data_element(uint8_t * element){
* the BNEP Protocol UUID and L2CAP PSM respectively.
*/
/* LISTING_START(HandleSDPQUeryResult): Extracting BNEP Prototocol UUID and L2CAP PSM */
/* LISTING_START(HandleSDPQUeryResult): Extracting BNEP Protcol UUID and L2CAP PSM */
static void handle_sdp_client_query_result(sdp_query_event_t * event){
/* LISTING_PAUSE */
sdp_query_attribute_value_event_t * ve;
@ -223,7 +222,7 @@ static void handle_sdp_client_query_result(sdp_query_event_t * event){
/* LISTING_RESUME */
/* @text The Protocol Descriptor List is DES
* which contains one DES for each protocol. For PAN serivces, it contains
* a DES with the L2CAP Protocol UUID and a PSM,
* a DES with the L2CAP Protocol UUID and a PSM, Listing A_B_C, Section D_E_F
* and another DES with the BNEP UUID and the the BNEP version.
*/
case SDP_ProtocolDescriptorList:{

View File

@ -99,14 +99,14 @@ static void sdp_client_init(){
* UUID of the public browse group, as shown in Listing SDPQueryUUID.
* In this example we used fixed address of the remote device shown in Listing Remote.
* Please update it with the address of a device in your vicinity, e.g., one reported
* by the GAP Inuiry example in the previous section.
* by the GAP Inquiry example in the previous section.
*/
/* LISTING_START(Remote): Address of remote device in big-endian order */
static bd_addr_t remote = {0x04,0x0C,0xCE,0xE4,0x85,0xD3};
/* LISTING_END */
/* LISTING_START(SDPQueryUUID): Quering a list of service records on a remote device. */
/* LISTING_START(SDPQueryUUID): Querying a list of service records on a remote device. */
static void packet_handler (void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
// printf("packet_handler type %u, packet[0] %x\n", packet_type, packet[0]);

View File

@ -90,12 +90,12 @@ static int counter_string_len;
/*
* @section Advertisements
*
* @text The Flags attribute in the Advertisement Data indicates if a device is dual-mode or not.
* 0x02 encoded LE General Discoverable, Dual-Mode device. See Listing advertisements.
* @text The Flags attribute in the Advertisement Data indicates if a device is in dual-mode or not.
* Flag 0x02 indicates LE General Discoverable, Dual-Mode device. See Listing advertisements.
*/
/* LISTING_START(advertisements): Advertisement data: Flag 0x02 indicates a dual mode device */
const uint8_t adv_data[] = {
// Flags general discoverable
// Flags: General Discoverable
0x02, 0x01, 0x02,
// Name
0x0b, 0x09, 'L', 'E', ' ', 'C', 'o', 'u', 'n', 't', 'e', 'r',
@ -143,7 +143,7 @@ static void gap_run(){
/*
* @section Packet Handler
*
* @text The packet handler of the combined example is just the combination of the individual packet handlers
* @text The packet handler of the combined example is just the combination of the individual packet handlers.
*/
static void packet_handler (void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
@ -157,7 +157,7 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
switch (packet[0]) {
case BTSTACK_EVENT_STATE:
// bt stack activated, get started - set local name
// BTstack activated, get started
if (packet[2] == HCI_STATE_WORKING) {
todos = SET_ADVERTISEMENT_PARAMS | SET_ADVERTISEMENT_DATA | ENABLE_ADVERTISEMENTS;
gap_run();
@ -253,9 +253,9 @@ static int att_write_callback(uint16_t con_handle, uint16_t att_handle, uint16_t
/*
* @section Heartbeat Handler
*
* @text Similar to the packet handler,the hearbeat handler is the combinatino of the individual ones.
* After updating the counter, it sends an RFCOMM packet is an RFCOMM connection is active and an LE notification if
* the remote side has requested notifications.
* @text Similar to the packet handler, the heartbeat handler is the combination of the individual ones.
* After updating the counter, it sends an RFCOMM packet if an RFCOMM connection is active,
* and an LE notification if the remote side has requested notifications.
*/
/* LISTING_START(heartbeat): Combined Heartbeat handler */
@ -283,9 +283,9 @@ static void heartbeat_handler(struct timer *ts){
/* LISTING_END */
/*
* @section Main app setup
* @section Main Application Setup
*
* @text As with the packet and the heartbeat handlers, the combined app setup contains the code from the indifivaul example setups.
* @text As with the packet and the heartbeat handlers, the combined app setup contains the code from the individual example setups.
*/
/* LISTING_START(MainConfiguration): Init L2CAP RFCOMM SDO SM ATT Server and start heartbeat timer */

View File

@ -85,7 +85,7 @@ static uint8_t spp_service_buffer[150];
* RFCOMM channel ID and service name. For more details, please have a look at it
* in \path{src/sdp_util.c}.
* The SDP record is created on the fly in RAM and is deterministic.
* To preserve valuable RAM, the result cuold be stored as constant data inside the ROM.
* To preserve valuable RAM, the result could be stored as constant data inside the ROM.
*/
/* LISTING_START(SPPSetup): SPP service setup */
@ -181,7 +181,7 @@ static void one_shot_timer_setup(){
* If RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE event returns status greater then 0,
* then the channel establishment has failed (rare case, e.g., client crashes).
* On successful connection, the RFCOMM channel ID and MTU for this
* channel are made available to the heartbeat counter. After openning the RFCOMM channel,
* channel are made available to the heartbeat counter. After opening the RFCOMM channel,
* the communication between client and the application
* takes place. In this example, the timer handler increases the real counter every
* second.