Implement interface to set advertise Tx power level 78/211078/1 accepted/tizen/unified/20190801.025409 submit/tizen/20190730.223540
authorinjun.yang <injun.yang@samsung.com>
Tue, 23 Oct 2018 00:51:21 +0000 (09:51 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 30 Jul 2019 00:13:48 +0000 (09:13 +0900)
[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] Internal
[Occurrence Version] N/A

[Problem] n/a
[Cause & Measure] Application will set advertise Tx power level
[Checking Method] n/a

[Team] Basic Connection
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change

Change-Id: I8dfa4b9aa94a9f0a3e7bc71a3cf2afa48cf77095
Signed-off-by: injun.yang <injun.yang@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
doc/adapter-api.txt
src/adapter.c
src/adapter_le_vsc_features.h

index 4cc47b2..70b5dee 100755 (executable)
@@ -239,7 +239,7 @@ Methods             void StartDiscovery()
 
                void SetAdvertisingParameters(uint32 interval_min,
                                                uint32 interval_max, uint32 filter_policy,
-                                               uint32 type)
+                                               uint32 type, int32 tx_power_level, int32 slot_id)
 
                        This method allows for setting the Low Energy
                        advertising interval and advertising filter policy.
index 3319e1a..dcb67fc 100644 (file)
@@ -4372,6 +4372,7 @@ static DBusMessage *adapter_set_advertising_params(DBusConnection *conn,
        dbus_uint32_t interval_max;
        dbus_uint32_t filter_policy;
        dbus_uint32_t type;
+       dbus_int32_t tx_power_level;
        dbus_int32_t slot_id;
        gboolean ret;
 
@@ -4385,14 +4386,15 @@ static DBusMessage *adapter_set_advertising_params(DBusConnection *conn,
                                DBUS_TYPE_UINT32, &interval_max,
                                DBUS_TYPE_UINT32, &filter_policy,
                                DBUS_TYPE_UINT32, &type,
+                               DBUS_TYPE_INT32, &tx_power_level,
                                DBUS_TYPE_INT32, &slot_id,
                                DBUS_TYPE_INVALID))
                return btd_error_invalid_args(msg);
 
        memset(&cp, 0, sizeof(cp));
 
-       DBG("advertising interval min %x, max %x, filter %x type %x",
-                               interval_min, interval_max, filter_policy, type);
+       DBG("advertising interval min %x, max %x, filter %x type %x, tx power %d",
+                               interval_min, interval_max, filter_policy, type, tx_power_level);
 
        if (filter_policy > 0x03)
                return btd_error_invalid_args(msg);
@@ -4412,7 +4414,7 @@ static DBusMessage *adapter_set_advertising_params(DBusConnection *conn,
                p_params->adv_type = type;
                p_params->channel_map = 0x07;   /* fixed channel :: will be used all */
                p_params->adv_filter_policy = filter_policy;
-               p_params->tx_power = BLE_ADV_TX_POWER_MID;      /* TODO:need to optimize */
+               p_params->tx_power = tx_power_level;
 
                if (adapter->current_settings & MGMT_SETTING_PRIVACY) {
                        p_inst->bdaddr_type = 0x01;
@@ -7393,6 +7395,7 @@ static const GDBusMethodTable adapter_methods[] = {
                                { "interval_max", "u" },
                                { "filter_policy", "u" },
                                { "type", "u" },
+                               { "tx_power_level", "i" },
                                { "slot_id", "i" }), NULL,
                        adapter_set_advertising_params) },
        { GDBUS_METHOD("SetAdvertisingData",
index ea4d91d..1a74f02 100755 (executable)
@@ -247,7 +247,7 @@ typedef struct {
        uint8_t channel_map;
        uint8_t adv_filter_policy;
        uint8_t inst_id;
-       uint8_t tx_power;
+       int8_t tx_power;
 } __attribute__ ((packed)) adapter_le_vsc_cp_set_multi_adv_params;
 
 /**