Android does handover over SNEP and recent changes broke the offset used
to check the handover frame validity.
#define SNEP_REQ_PUT_HEADER_LENGTH 6
#define SNEP_REQ_GET_HEADER_LENGTH 10
+
/* Default SNEP Resp message header length: Version + code + len */
#define SNEP_RESP_HEADER_LENGTH (1 + 1 + 4)
+/* Offset of 'H' in Android frame: 3 is the offset in NDEF */
+#define SNEP_REQ_ANDROID (SNEP_ACC_LENGTH_SIZE + 3)
+
/* TODO: Right now it is dummy, need to get correct value
* from lower layers */
DBG("");
- /* Check if this is a handover request or not ... */
- if (*(snep_data->nfc_data + 4 + 9) != 'H') {
+ /*
+ * Check if this is a handover request or not ...
+ * snep_data->nfc_data points to the acceptable length field (4 bytes)
+ * and we check the 3 byte in the NDEF message
+ * */
+
+ if (*(snep_data->nfc_data + SNEP_REQ_ANDROID) != 'H') {
snep_core_response_noinfo(client_fd, SNEP_RESP_NOT_IMPL);
} else {
snep_core_parse_handover_record(client_fd, snep_data->nfc_data +