[RFC 5/6] android: Use hal-log.h for logging in socket HAL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This will allow to log both on Android and Linux (in haltest)
---
 android/hal-sock.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/android/hal-sock.c b/android/hal-sock.c
index 31e6b59..dab3756 100644
--- a/android/hal-sock.c
+++ b/android/hal-sock.c
@@ -20,16 +20,14 @@
 #include <hardware/bluetooth.h>
 #include <hardware/bt_sock.h>
 
-#define LOG_TAG "BlueZ"
-#include <cutils/log.h>
-
+#include "hal-log.h"
 #include "hal.h"
 
 static bt_status_t btsock_listen_rfcomm(const char *service_name,
 					const uint8_t *uuid, int chan,
 					int *sock, int flags)
 {
-	ALOGD(__func__);
+	DBG("");
 
 	return BT_STATUS_UNSUPPORTED;
 }
@@ -39,20 +37,20 @@ static bt_status_t listen(btsock_type_t type, const char *service_name,
 					int *sock, int flags)
 {
 	if ((!uuid && chan <= 0) || !sock) {
-		ALOGE("%s: invalid params: uuid %p, chan %d, sock %p",
+		error("%s: invalid params: uuid %p, chan %d, sock %p",
 						__func__, uuid, chan, sock);
 		return BT_STATUS_PARM_INVALID;
 	}
 
-	ALOGD("%s: uuid %p chan %d sock %p type %d service_name %s",
-			__func__, uuid, chan, sock, type, service_name);
+	DBG("uuid %p chan %d sock %p type %d service_name %s",
+					uuid, chan, sock, type, service_name);
 
 	switch (type) {
 	case BTSOCK_RFCOMM:
 		return btsock_listen_rfcomm(service_name, uuid, chan,
 								sock, flags);
 	default:
-		ALOGE("%s: Socket type %d not supported", __func__, type);
+		error("%s: Socket type %d not supported", __func__, type);
 		break;
 	}
 
@@ -64,13 +62,12 @@ static bt_status_t connect(const bt_bdaddr_t *bdaddr, btsock_type_t type,
 					int *sock, int flags)
 {
 	if ((!uuid && chan <= 0) || !bdaddr || !sock) {
-		ALOGE("invalid params: bd_addr %p, uuid %p, chan %d, sock %p",
+		error("invalid params: bd_addr %p, uuid %p, chan %d, sock %p",
 					bdaddr, uuid, chan, sock);
 		return BT_STATUS_PARM_INVALID;
 	}
 
-	ALOGD("%s: uuid %p chan %d sock %p type %d", __func__, uuid, chan,
-								sock, type);
+	DBG("uuid %p chan %d sock %p type %d", uuid, chan, sock, type);
 
 	return BT_STATUS_UNSUPPORTED;
 }
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux