BT_DEVICE_DISCONNECT_REASON_TIMEOUT, /**< Disconnected by timeout */
BT_DEVICE_DISCONNECT_REASON_LOCAL_HOST, /**< Disconnected by local host */
BT_DEVICE_DISCONNECT_REASON_REMOTE, /**< Disconnected by remote */
+/* After ACR for BT_DEVICE_DISCONNECT_REASON_AUTH_FAILED, will enable this code */
+#if 0
+ BT_DEVICE_DISCONNECT_REASON_AUTH_FAILED, /**< Disconnected by remote during pairing */
+#endif
} bt_device_disconnect_reason_e;
/**
BT_DEVICE_DISCONNECT_REASON_TIMEOUT, /**< Disconnected by timeout */
BT_DEVICE_DISCONNECT_REASON_LOCAL_HOST, /**< Disconnected by local host */
BT_DEVICE_DISCONNECT_REASON_REMOTE, /**< Disconnected by remote */
+/* After ACR for BT_DEVICE_DISCONNECT_REASON_AUTH_FAILED, will enable this code */
+#if 0
+ BT_DEVICE_DISCONNECT_REASON_AUTH_FAILED, /**< Disconnected by remote during pairing */
+#endif
} bt_device_disconnect_reason_e;
/**
break;
}
- (*dest)->disconn_reason = source->disc_reason;
+ switch (source->disc_reason) {
+/* After ACR for BT_DEVICE_DISCONNECT_REASON_AUTH_FAILED, will enable this code */
+#if 0
+ case (int)BLUETOOTH_ERROR_AUTH_FAILURE:
+ (*dest)->disconn_reason = BT_DEVICE_DISCONNECT_REASON_AUTH_FAILED;
+ break;
+#endif
+ case (int)BLUETOOTH_ERROR_CONNECTION_TIMEOUT:
+ (*dest)->disconn_reason = BT_DEVICE_DISCONNECT_REASON_TIMEOUT;
+ break;
+ case (int)BLUETOOTH_ERROR_REMOTE_USER_TERM:
+ case (int)BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES:
+ case (int)BLUETOOTH_ERROR_REMOTE_POWER_OFF:
+ (*dest)->disconn_reason = BT_DEVICE_DISCONNECT_REASON_REMOTE;
+ break;
+ case (int)BLUETOOTH_ERROR_LOCAL_HOST_TERM:
+ (*dest)->disconn_reason = BT_DEVICE_DISCONNECT_REASON_LOCAL_HOST;
+ break;
+ default:
+ (*dest)->disconn_reason = BT_DEVICE_DISCONNECT_REASON_UNKNOWN;
+ break;
+ }
return BT_ERROR_NONE;
}