From: Michal Pawluk
Date: Mon, 21 Dec 2015 19:00:59 +0000 (+0100)
Subject: [SAMPLE APP][Bluetooth LE Service] Advertiser creation section updated
X-Git-Tag: tizen_3.0/TD_SYNC/20161201~212^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11b18ba7f56e4a41430b9c37b9b764c2dd9af9e9;p=sdk%2Fonline-doc.git
[SAMPLE APP][Bluetooth LE Service] Advertiser creation section updated
Change-Id: I8a0961961b58f7ce10d09106c27263af69c2f163
Signed-off-by: Michal Pawluk
---
diff --git a/org.tizen.sampledescriptions/html/wearable_n/bluetooth_le_service_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/bluetooth_le_service_sd_wn.htm
index f58401d..7a31a89 100644
--- a/org.tizen.sampledescriptions/html/wearable_n/bluetooth_le_service_sd_wn.htm
+++ b/org.tizen.sampledescriptions/html/wearable_n/bluetooth_le_service_sd_wn.htm
@@ -192,6 +192,82 @@ static bool __create_advertizer(bt_advertiser_h *adv_h, int appearance)
}
+
+Within the __create_advertizer() function:
+
+ - the advertiser's handle is created with bt_common_create_advertizer() function;
+ - the advertiser mode is set to BT_ADAPTER_LE_ADVERTISING_MODE_LOW_LATENCY which sets the lowest possible
+ interval between subsequent packets sending with the cost of higher energy consumption (bt_common_set_advertising_mode());
+ - the advertiser remains connectable by other peers (bt_common_set_connectable());
+ - the advertiser's properties are defined and set:
+
+ - for advertising mode (__set_advertizing_properties());
+ - for scan response mode (__set_scan_response_properties()).
+
+
+
+The advertiser's properties setting determines the amount and the category of information to be broadcasted over the Bluetooth LE adapter. It is assumed that:
+
+ -
+ an advertising packet (BT_ADAPTER_LE_PACKET_ADVERTISING) is a carrier of the following information:
+
+ - device's name (obtained automatically by the internal implementation of the Bluetooth LE Adapter module);
+ - manufacturer's identifier: 0x0075 (complies with the company identifiers
+ assigned by the Bluetooth SIG, Inc.). The assigned value identifies Samsung Electronics Co. Ltd. company.
+
+ The role of this type of packet is to introduce the device (advertise its existence) within the Bluetooth LE network. The one who receives such a packet can send a scan request to query detailed data
+ carried by the device.
+
+ -
+ a scan response packet (BT_ADAPTER_LE_PACKET_SCAN_RESPONSE) is a carrier of the following information:
+
+ - device's name (obtained automatically by the internal implementation of the Bluetooth LE Adapter module);
+ - appearance: 832 (complies with the
+ external device's appearance
+ assigned by the Bluetooth SIG, Inc.). The assigned value identifies the device as a Generic Heart Rate Sensor.
+ - manufacturer's identifier (see the itemization above for details).
+
+ The role of this type of packet is to provide detailed data acquired during the service lifecycle (heart rate measuremet and body sensor location values). This packet is sent in response to a scan request.
+
+
+The __set_advertizing_properties() and the
+__set_scan_response_properties() functions are only convenient wrappers and call the
+__set_properties() function with appropriately adjusted arguments. For reference of properties' setting, see the code listing below.
+
+
+
+static bool __set_properties(bt_advertiser_h adv_h, struct _adv_properties properties)
+{
+ /* Sets whether the device's name is to be included in the packet. */
+ if (!bt_common_set_device_name(adv_h, properties.pkt_type, properties.name))
+ return false;
+
+ /* Sets the device's appearance value if provided. */
+ if (properties.appearance > 0)
+ if (!bt_common_set_appearance(adv_h, properties.pkt_type, properties.appearance))
+ return false;
+
+ /* Sets the device's manufacturer identifier if provided. */
+ if (properties.manufacturer_id > 0)
+ if (!bt_common_set_manufacturer(adv_h,
+ properties.pkt_type,
+ properties.manufacturer_id,
+ (const char *)&properties.manufacturer_data,
+ sizeof(struct _manufacturer_data)))
+ return false;
+
+ /* Sets whether the transmition power level is to be included in the packet. */
+ if (!bt_common_set_tx_power_level(adv_h, properties.pkt_type, properties.tx_power))
+ return false;
+
+ return true;
+}
+
+
+
+See the References section for details of all undescribed functions.
+
+
Data advertising