Hi Johan,
On 11/08/2013 01:05 PM, Johan Hedberg wrote:
Hi Ravi,
On Fri, Nov 08, 2013, Ravi kumar Veeramally wrote:
Report data coming to HAL is in ascii format, HAL sends
data in hex to daemon, so convert to binary.
---
android/hidhost.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/android/hidhost.c b/android/hidhost.c
index c7b4114..9b4bb15 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
@@ -98,6 +98,14 @@ struct hid_device {
uint8_t last_hid_msg;
};
+static void hex2bin(const uint8_t *ascii, int ascii_len, uint8_t *hex)
+{
+ int i;
+
+ for (i = 0; i < ascii_len / 2; i++)
+ sscanf((char *) &ascii[i * 2], "%hhx", &hex[i]);
+}
You're still calling the input parameter ascii and the output parameter
hex. Also, I'm still fine if you just drop this function altogether and
do the conversion inline in the two places that you need it.
Ok.
if (write(fd, req, req_size) < 0) {
- error("error while querying device protocol");
+ error("error while sending report");
If you're fixing this error, how about fixing it to properly print the
exact error in the same go, i.e. using strerror?
Ok, I will send this in another patch, have to fix other debugs also.
Thanks,
Ravi.
--
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