From 5baa341d76df5f56fa0b759a54455bacdd714670 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 31 Oct 2012 12:22:23 +0100 Subject: [PATCH] ndef: Workaround buggy Nokia BH-505 handover implementation According to BT Core Specification 4.0 length field in OOB EIR contains the length of the entire OOB data block including the length field itself. Some Nokia BH-505 devices reports OOB EIR length without length field size. Correct size before sending EIR to agent. --- src/ndef.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ndef.c b/src/ndef.c index e9da81e..31677fc 100644 --- a/src/ndef.c +++ b/src/ndef.c @@ -1369,6 +1369,15 @@ static void correct_eir_len(struct bt_data *data) data->data[0] = data->data[1]; data->data[1] = 0; } + + /* + * Some Nokia BH-505 report total OOB block length without length field + * size. + */ + if (data->data[0] == data->size - 2) { + DBG("EIR length without length field size"); + data->data[0] += 2; + } } static struct near_ndef_mime_payload * -- 2.7.4