__bt_free_le_adv_slot();
}
+int _bt_le_set_max_packet_len(void)
+{
+ int result = BLUETOOTH_ERROR_NONE;
+ int tx_octets, tx_time;
+ bluetooth_le_read_maximum_data_length_t max_len = {0};
+
+ if (BLUETOOTH_ERROR_NONE != _bt_le_read_maximum_data_length(&max_len))
+ return BLUETOOTH_ERROR_INTERNAL;
+
+ if (max_len.max_tx_octets > BT_LE_TX_LEN_DEFAULT) {
+ tx_octets = max_len.max_tx_octets > BT_LE_TX_LEN_MAX ?
+ BT_LE_TX_LEN_MAX : max_len.max_tx_octets;
+ tx_time = BT_LE_TX_TIME_MAX;
+
+ result = _bt_le_write_host_suggested_default_data_length(tx_octets, tx_time);
+
+ BT_DBG("Wrote max packet size : result[%d], MAX[%d], set[%d]",
+ result, max_len.max_tx_octets, tx_octets);
+ }
+
+ return result;
+}
+
gboolean _bt_update_le_feature_support(const char *item, const char *value)
{
if (item == NULL || value == NULL)
reply = g_dbus_proxy_call_sync(proxy, "LEReadMaximumDataLength",
NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
- g_object_unref(proxy);
-
if (reply == NULL) {
BT_ERR("LEReadMaximumDataLength dBUS-RPC failed");
if (error != NULL) {
NULL,
&error);
- g_object_unref(proxy);
-
if (reply == NULL) {
BT_ERR("_bt_le_write_host_suggested_default_data_length dBUS-RPC failed");
if (error != NULL) {
#include "bt-service-main.h"
#include "bt-service-avrcp.h"
#include "bt-service-device.h"
+#include "bt-service-adapter-le.h"
+
#ifdef TIZEN_DPM_ENABLE
#include "bt-service-dpm.h"
#endif
/* Update Bluetooth Status to notify other modules */
if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_ON) != 0)
- BT_ERR("Set vconf failed\n");
+ BT_ERR("Set vconf failed");
+
+ /* set packet length to max size to enable packet length extension */
+ if (BLUETOOTH_ERROR_NONE != _bt_le_set_max_packet_len())
+ BT_ERR("Fail to set max packet length");
if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
EVT_VAL_BT_LE_ON) != ES_R_OK)
#define BT_LE_SCAN_WINDOW_MIN 2.5
#define BT_LE_SCAN_WINDOW_MAX 10240
+#define BT_LE_TX_LEN_DEFAULT 0x001b
+#define BT_LE_TX_TIME_DEFAULT 0x0148
+#define BT_LE_TX_LEN_MAX 0x00fb
+#define BT_LE_TX_TIME_MAX 0x0848
+
typedef enum {
BT_LE_AD_TYPE_INCOMP_LIST_16_BIT_SERVICE_CLASS_UUIDS = 0x02,
BT_LE_AD_TYPE_COMP_LIST_16_BIT_SERVICE_CLASS_UUIDS = 0x03,
int _bt_le_set_data_length(bluetooth_device_address_t *device_address, const unsigned int max_tx_Octets, const unsigned int max_tx_Time);
+int _bt_le_set_max_packet_len(void);
+
int _bt_initialize_ipsp(void);
int _bt_deinitialize_ipsp(void);