Thank you for your reply!
I made a mistake on a model.
I used model 3b, not a model 3b+.
So I edited posts above.
I'm sorry!
[Bluetooth adapter states] seem to be right.
I/BluetoothAdapterState: Bluetooth adapter state changed: 10-> 14 STATE_OFF -> STATE_BLE_TURNING_ON
I/BluetoothAdapterState: Bluetooth adapter state changed: 14-> 15 STATE_BLE_TURNING_ON -> STATE_BLE_ON
I/BluetoothAdapterState: Bluetooth adapter state changed: 15-> 11 STATE_BLE_ON -> STATE_TURNING_ON
I/BluetoothAdapterState: Bluetooth adapter state changed: 11-> 12 STATE_TURNING_ON -> STATE_ON
As you know Android Things have some problems related to the Power Management.
So I've explored the result of the logcat.
There seemed to be the log outputs related to the Power Management regardless of using the Monitor with
Code: Select all
<uses-permission android:name="android.permission.WAKE_LOCK" />
.
2020-02-28 00:05:07.104 5973-6024/com.android.bluetooth I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2020-02-28 00:05:07.104 5973-6024/com.android.bluetooth I/bt_stack: [INFO:gatt_api.cc(1027)] allocated gatt_if=5
2020-02-28 00:05:26.834 470-470/? E/wpa_supplicant: wpa_driver_nl80211_driver_cmd: failed to issue private command: BTCOEXMODE 1
2020-02-28 00:05:26.837 470-470/? E/wpa_supplicant: wpa_driver_nl80211_driver_cmd: failed to issue private command: SETSUSPENDMODE 0
2020-02-28 00:05:26.837 470-470/? I/wpa_supplicant: wlan0: CTRL-EVENT-DRIVER-STATE HANGED
2020-02-28 00:05:26.838 296-374/system_process E/SupplicantStaIfaceHal: ISupplicantStaIface.setSuspendModeEnabled failed: FAILURE_UNKNOWN,
2020-02-28 00:05:26.971 470-470/? E/wpa_supplicant: wpa_driver_nl80211_driver_cmd: failed to issue private command: BTCOEXMODE 2
2020-02-28 00:05:26.971 296-374/system_process E/SupplicantStaIfaceHal: ISupplicantStaIface.setBtCoexistenceMode failed: FAILURE_UNKNOWN,
https://android.googlesource.com/platfo ... _nl80211.c
Code: Select all
int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf,
size_t buf_len )
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
struct ifreq ifr;
android_wifi_priv_cmd priv_cmd;
int ret = 0;
if (bss->ifindex <= 0 && bss->wdev_id > 0) {
/* DRIVER CMD received on the DEDICATED P2P Interface which doesn't
* have an NETDEVICE associated with it. So we have to re-route the
* command to the parent NETDEVICE
*/
struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)(drv->ctx);
wpa_printf(MSG_DEBUG, "Re-routing DRIVER cmd to parent iface");
if (wpa_s && wpa_s->parent) {
/* Update the nl80211 pointers corresponding to parent iface */
bss = wpa_s->parent->drv_priv;
drv = bss->drv;
wpa_printf(MSG_DEBUG, "Re-routing command to iface: %s"
" cmd (%s)", bss->ifname, cmd);
}
}
if (os_strcasecmp(cmd, "STOP") == 0) {
linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 0);
wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STOPPED");
} else if (os_strcasecmp(cmd, "START") == 0) {
linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1);
wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STARTED");
} else if (os_strcasecmp(cmd, "MACADDR") == 0) {
u8 macaddr[ETH_ALEN] = {};
ret = linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname, macaddr);
if (!ret)
ret = os_snprintf(buf, buf_len,
"Macaddr = " MACSTR "\n", MAC2STR(macaddr));
} else { /* Use private command */
os_memcpy(buf, cmd, strlen(cmd) + 1);
memset(&ifr, 0, sizeof(ifr));
memset(&priv_cmd, 0, sizeof(priv_cmd));
os_strlcpy(ifr.ifr_name, bss->ifname, IFNAMSIZ);
#ifdef BCMDHD_64_BIT_IPC
priv_cmd.bufaddr = (u64)(uintptr_t)buf;
#else
priv_cmd.bufaddr = buf;
#endif
priv_cmd.used_len = buf_len;
priv_cmd.total_len = buf_len;
ifr.ifr_data = &priv_cmd;
if ((ret = ioctl(drv->global->ioctl_sock, SIOCDEVPRIVATE + 1, &ifr)) < 0) {
wpa_printf(MSG_ERROR, "%s: failed to issue private command: %s", __func__, cmd);
wpa_driver_send_hang_msg(drv);
} else {
drv_errors = 0;
ret = 0;
if ((os_strcasecmp(cmd, "LINKSPEED") == 0) ||
(os_strcasecmp(cmd, "RSSI") == 0) ||
(os_strcasecmp(cmd, "GETBAND") == 0) ||
(os_strncasecmp(cmd, "WLS_BATCHING", 12) == 0))
ret = strlen(buf);
wpa_driver_notify_country_change(drv->ctx, cmd);
wpa_printf(MSG_DEBUG, "%s %s len = %d, %zu", __func__, buf, ret, strlen(buf));
}
}
return ret;
}
https://android.googlesource.com/platfo ... ative.java
Code: Select all
/**
* Sets the bluetooth coexistence mode.
*
* @param mode One of {@link #BLUETOOTH_COEXISTENCE_MODE_DISABLED},
* {@link #BLUETOOTH_COEXISTENCE_MODE_ENABLED}, or
* {@link #BLUETOOTH_COEXISTENCE_MODE_SENSE}.
* @return Whether the mode was successfully set.
*/
public boolean setBluetoothCoexistenceMode(int mode) {
return doBooleanCommand("DRIVER BTCOEXMODE " + mode);
}
/**
* Enable or disable Bluetooth coexistence scan mode. When this mode is on,
* some of the low-level scan parameters used by the driver are changed to
* reduce interference with A2DP streaming.
*
* @param isSet whether to enable or disable this mode
* @return {@code true} if the command succeeded, {@code false} otherwise.
*/
public boolean setBluetoothCoexistenceScanMode(boolean setCoexScanMode) {
if (setCoexScanMode) {
return doBooleanCommand("DRIVER BTCOEXSCAN-START");
} else {
return doBooleanCommand("DRIVER BTCOEXSCAN-STOP");
}
}