docu: add example tags, fix table for pdf

This commit is contained in:
Milanka Ringwald 2017-11-01 10:41:16 +01:00
parent 1e9de6b0ec
commit 15de820685
8 changed files with 56 additions and 23 deletions

View File

@ -37,7 +37,7 @@ The file *btstack_config.h* contains three parts:
### HAVE_* directives {#sec:haveDirectives}
System properties:
#define | Description
\#define | Description
-----------------------------------|-------------------------------------
HAVE_MALLOC | Use dynamic memory
HAVE_AES128 | Use platform AES128 engine - not needed usually
@ -46,14 +46,14 @@ HAVE_MBEDTLS_ECC_P256 | mbedTLS provides NIST P-256 operations e.g.
Embedded platform properties:
#define | Description
\#define | Description
-----------------------------------|------------------------------------
HAVE_EMBEDDED_TIME_MS | System provides time in milliseconds
HAVE_EMBEDDED_TICK | System provides tick interrupt
POSIX platform properties:
#define | Description
\#define | Description
-----------------------------------|------------------------------------
HAVE_POSIX_B300_MAPPED_TO_2000000 | Workaround to use serial port with 2 mbps
HAVE_POSIX_B600_MAPPED_TO_3000000 | Workaround to use serial port with 3 mpbs
@ -67,7 +67,7 @@ LE_DEVICE_DB_PATH | Path to stored LE device information
### ENABLE_* directives {#sec:enableDirectives}
BTstack properties:
#define | Description
\#define | Description
--------------------------------|---------------------------------------------
ENABLE_CLASSIC | Enable Classic related code in HCI and L2CAP
ENABLE_BLE | Enable BLE related code in HCI and L2CAP
@ -96,7 +96,7 @@ In general, BTstack relies on flow control of the HCI transport, either via Hard
Host buffer configuration for HCI Controller to Host Flow Control:
#define | Description
\#define | Description
------------------|------------
HCI_HOST_ACL_PACKET_NUM | Max number of ACL packets
HCI_HOST_ACL_PACKET_LEN | Max size of HCI Host ACL packets
@ -123,7 +123,7 @@ For each HCI connection, a buffer of size HCI_ACL_PAYLOAD_SIZE is reserved. For
<!-- a name "lst:memoryConfiguration"></a-->
<!-- -->
#define | Description
\#define | Description
--------|------------
HCI_ACL_PAYLOAD_SIZE | Max size of HCI ACL payloads
MAX_NR_BNEP_CHANNELS | Max number of BNEP channels
@ -174,7 +174,7 @@ If implemented, bonding information is stored in Non-volatile memory. For Classi
<!-- a name "lst:nvmDefines"></a-->
<!-- -->
#define | Description
\#define | Description
--------------------------|------------
NVM_NUM_LINK_KEYS | Max number of Classic Link Keys that can be stored
NVM_NUM_DEVICE_DB_ENTRIES | Max number of LE Device DB entries that can be stored
@ -482,7 +482,7 @@ services for the HID Control and HID Interrupt PSMs using
*l2cap_register_service*. In this call, youll also specify
a packet handler to accept and receive keyboard data.
All events names have the form MODULE_EVENT_NAME now, e.g., *gap_event_advertising_report*.
All events names have the form MODULE_EVENT_NAME now, e.g., *gap_event_-advertising_report*.
To facilitate working with
events and get rid of manually calculating offsets into packets, BTstack provides
auto-generated getters for all fields of all events in *src/hci_event.h*. All

View File

@ -35,16 +35,16 @@
*
*/
#define __BTSTACK_FILE__ "hid_device_demo.c"
#define __BTSTACK_FILE__ "hid_keyboard_demo.c"
// *****************************************************************************
/* EXAMPLE_START(hid_device_demo): HID Device (Server) Demo
*
* Status: Basic implementation. HID Request from Host are not answered yet. Works with iOS.
/* EXAMPLE_START(hid_keyboard_demo): HID Keyboard (Server) Demo
*
* @text This HID Device example demonstrates how to implement
* an HID keyboard. Without a HAVE_BTSTACK_STDIN, a fixed demo text is sent
* If HAVE_BTSTACK_STDIN is defined, you can type from the terminal
*
* @text Status: Basic implementation. HID Request from Host are not answered yet. Works with iOS.
*/
// *****************************************************************************

View File

@ -38,13 +38,13 @@
#define __BTSTACK_FILE__ "hid_mouse_demo.c"
// *****************************************************************************
/* EXAMPLE_START(hid_device_demo): HID Device (Server) Demo
*
* Status: Basic implementation. HID Request from Host are not answered yet. Works with iOS.
/* EXAMPLE_START(hid_mouse_demo): HID Mouse (Server) Demo
*
* @text This HID Device example demonstrates how to implement
* an HID keyboard. Without a HAVE_BTSTACK_STDIN, a fixed demo text is sent
* If HAVE_BTSTACK_STDIN is defined, you can type from the terminal
*
* @text Status: Basic implementation. HID Request from Host are not answered yet. Works with iOS.
*/
// *****************************************************************************

View File

@ -42,12 +42,15 @@
*
* @text All newer operating systems provide GATT Client functionality.
* This example shows how to get a maximal throughput via BLE:
* - send whenever possible
* - use the max ATT MTU
* - send whenever possible,
* - use the max ATT MTU.
*
* In theory, we should also update the connection parameters, but we already get
* @text In theory, we should also update the connection parameters, but we already get
* a connection interval of 30 ms and there's no public way to use a shorter
* interval with iOS (if we're not implementing an HID device)
* interval with iOS (if we're not implementing an HID device).
*
* @text Note: To start the streaming, please run the le_streamer_client example
* on other device, or use some GATT Explorer, e.g. LightBlue, BLExplr.
*/
// *****************************************************************************
@ -208,6 +211,12 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
switch (packet_type) {
case HCI_EVENT_PACKET:
switch (hci_event_packet_get_type(packet)) {
case BTSTACK_EVENT_STATE:
// BTstack activated, get started
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING) {
printf("To start the streaming, please run the le_streamer_client example on other device, or use some GATT Explorer, e.g. LightBlue, BLExplr.\n");
}
break;
case HCI_EVENT_DISCONNECTION_COMPLETE:
context = connection_for_conn_handle(hci_event_disconnection_complete_get_connection_handle(packet));
if (!context) break;

View File

@ -37,10 +37,13 @@
#define __BTSTACK_FILE__ "le_streamer_client.c"
/*
* le_streamer_client.c
*/
// *****************************************************************************
//
// LE Streamer Client - connects to 'LE Streamer' and subscribes to test characteristic
//
/* EXAMPLE_START(le_streamer_client): Connects to 'LE Streamer' and subscribes to test characteristic
*/
// *****************************************************************************
#include <stdint.h>
@ -364,3 +367,4 @@ int btstack_main(int argc, const char * argv[]){
return 0;
}
/* EXAMPLE_END */

View File

@ -36,7 +36,13 @@
*/
#define __BTSTACK_FILE__ "pbap_client_demo.c"
// *****************************************************************************
/* EXAMPLE_START(pbap_client_demo): Connect to Phonebook Server and get contacts.
*/
// *****************************************************************************
#include "btstack_config.h"
#include <stdint.h>
@ -234,3 +240,4 @@ int btstack_main(int argc, const char * argv[]){
return 0;
}
/* EXAMPLE_END */

View File

@ -35,8 +35,15 @@
*
*/
#define __BTSTACK_FILE__ "spp_streamer.c"
/*
* spp_streamer.c
*/
// *****************************************************************************
/* EXAMPLE_START(spp_streamer): Send test data via SPP as fast as possible
*
* @text After RFCOMM connections gets open, request a
* RFCOMM_EVENT_CAN_SEND_NOW via rfcomm_request_can_send_now_event().
* When we get the RFCOMM_EVENT_CAN_SEND_NOW, send data and request another one.

View File

@ -35,6 +35,12 @@
*
*/
#define __BTSTACK_FILE__ "spp_streamer_client.c"
/*
* spp_streamer_client.c
*/
// *****************************************************************************
/* EXAMPLE_START(spp_streamer_client): Client for SPP Streamer
*