summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Avoid missing NFCIP inbound frame.Sylvain Fonteneau2011-04-141-1/+1
| | | | | | | | | | | | | | | If a NFCIP frame is received (NXP_EVT_NFC_RCV_DATA event) before a call to phHal4Nfc_Receive() function, the frame was lost. This could happen if the local host acts as a Target and the remote peer sends its first frame too fast. The data is actually saved in a temporary buffer but, when the phHal4Nfc_Receive() is eventualy called, it triggers a callback with a status code NFCSTATUS_MORE_INFORMATION, which is handled as an error. This patch fixes this behaviour and makes sure that the correct status code is provided with the frame itself. Change-Id: I5311762ca70c71f98dea0287b0844eb1c8dddb6b
* Ignore unreadable TLVs during LLCP activation and CONNECT/CC.Sylvain Fonteneau2011-04-082-9/+15
| | | | | | | | | | | The LLCP specification defines that if a TLV cannot be interpreted, it shall be ignored rather than generating an error. This patch removed all error reporting on TLV interpretation. The only error that can still happen is length inconsistency in the whole TLV array buffer. Change-Id: Ibf289fceb2283bfddcdc0ddee9e687ece3e90887
* Handle correctly LLCP aggregated frames.Sylvain Fonteneau2011-03-311-5/+8
| | | | | | | | | | | | | | | The parsing algorithm for AGF frames has been fixed. It was previously only working if aggregated frames were 4-bytes long. The current stack only support mandatory de-aggregation. It does not send aggregated frames, so there won't be interop issue with previous versions. This fix prevents reading erroneous de-aggregated frames and rejecting them using FRMR when communicating with an LLCP implementation using aggregation mechanism. Change-Id: Ia5728496a2917b6a57f478cc51dc0aaa0fcc165a
* Disable P2P target 106 passive mode.Nick Pelly2011-03-183-4/+4
| | | | | | | | | | | | | P2P target 106 passive appears as an ISO 14443-3A target to reader/writers in the field. This can confuse some terminals, especially when we also have card emulation turned on, since it looks like we have two -3A targets in the field. P2P target 106 passive is just one of many P2P sub-modes. We do not know of any P2P devices that only initiate using only 106 passive, so this should not present inter-op issues. Change-Id: I1cb84ed791a86a7f225a51806e99bab031dcb6ca
* Minor tweaks.Jeff Hamilton2011-03-122-2/+1
|
* Support formatting / makeReadOnly() of NDEF on ICODE.Martijn Coenen2011-02-259-52/+957
| | | | Change-Id: I2a7a185ead5de8f2b165c81dcc8ab8fb46c1ddc0
* Added support for NDEF on ICODE.Martijn Coenen2011-02-255-8/+2015
| | | | | | This patch allows reading and writing of NDEF messages on ICODE tags. Change-Id: I43b4845c898c2bf268f609a5a81e991460059ff6
* Narrow down NFCSTATUS_TARGET_LOST responses from libNFC.Martijn Coenen2011-02-181-2/+9
| | | | | | | | | | | | | | | | | | | During extensive testing we found that some ISO15693 tags do not react to some commands. However, they do send an error code to the PN544 indicating they do not support the command. The PN544 in turn sends one specific error code over the HCI interface. However, libNFC maps that error code always to NFCSTATUS_TARGET_LOST, which in the end maps to the application API reporting a TargetLostException. This fix maps only the timeout return values from the PN544 to NFCSTATUS_TARGET_LOST; all other values are mapped to NFCSTATUS_FAILED, which in turn maps to an IOException at API level. In effect, a timeout is still not the same as a target lost; libNFC does not do any additional internal presence check to make sure the tag is really gone, although it usually is. I'll submit a separate fix on packages/apps/Nfc to take care of this. Change-Id: If64857658d683aff29134f74b42efd99b695e634
* Disable CardEmulation phase when we try to access the Secure Element in ↵daniel_tomas2011-02-161-0/+1
| | | | | | | | Wired Mode. This fix permit to detect the Secure Element in Wired Mode, even we are in front of a RF Reader Change-Id: I8f87e043ff24724addd179ce025cf3d038a82a5e
* Patch to support set mode during the SE Wired modedaniel_tomas2011-02-161-2/+10
| | | | Change-Id: I57eaa3ccd65b89510e198f7ebf24f7266c4dad2e
* Fixed issue with max size NDEF message on T2TJan2011-01-251-1/+4
| | | | Change-Id: If6b490d906fcc37960a1120e9344470d68c825f6
* Support for using 3-byte length in NDEF TLV on Type 2 Tag.Martijn Coenen2011-01-201-14/+85
| | | | | | | | | | This allows for reading/writing more than 255 bytes of NDEF data on an NFC Forum Type 2 tag. This fix overrides https://partner.source.android.com/g/#change,4907 , since that fix only worked for reading. Change-Id: I7fb2ea1bc04f35ba6e6be56e0c89abab567e3ac7
* Erase callback when function returns immediately.Arnaud Ferir2011-01-181-6/+47
| | | | | | This should avoid calling a irrelevant callback at abort. Change-Id: Ied8d54268613f248fd505d4b25d0ab8a0905a336
* Fixed LLCP send callback triggering.Arnaud Ferir2011-01-182-8/+5
| | | | | | | | | | | | | | | | | | | The phLibNfc_Llcp_Send() function is expected to trigger a callback when the packet is actually sent but, in some situations, the callback was triggered by another frame sending (such as RR or DM frames). This patch fixes the following socket internal flags handling: - pfSocketSend_Cb: set to non-NULL value when a send operation is pending, - bSocketSendPending: set to TRUE if the LLCP link layer is not available for sending and reset to FALSE once the frame is actually forwarded to the LLCP link layer. The send callback triggering has been updated to ensure it is only done for the expected data frame (i.e.: send pending and already forwarded to link layer). Change-Id: Id7410ee4075fbbbc9de382abf54e89a97f6a8b37
* Fixed erroneous LLCP frame on socket closure.Sylvain Fonteneau2011-01-182-13/+11
| | | | | | | | | | | | | | | Moved data allocation from stack memory to heap in order to avoid invalid memory access. Previously, When trying to send a DM (acknowledgment to socket disconnect request), the stack was allocating some frame data on the stack but these data were used after the function returned. Other calls to the same function are already using variables allocated on heap. Change-Id: Id7356a876fdecdd979ed3ddc6dbe100d6e92d43d
* Fixed LLCP receive window checkings.Sylvain Fonteneau2011-01-182-6/+9
| | | | | | | | | | | | Before sending a packet, the LLCP stack have to check if the remote peer is ready to send. To do so, a Receive Window mechanism based on packet numbering and acknowledgment is used. Basically, the sender have to make sure that he must have not sent more than RW-1 unaknowledged frames before sending a new one. This patch is correcting this test which was failing in some situations. Change-Id: I525f6b472a909ce48feb938aa02858b9456edc11
* Removed callback in case of immediate end of operation.Arnaud Ferir2011-01-182-143/+72
| | | | | | | | | | | | The correct behavior of asynchronous functions should be: Immediate operation => function returns with success/error status, callback never invoked Delayed operation => function returns with pending status, callback is invoked at the end of operation Some minor fixes are also included in this commit (code style). Change-Id: Ieb801ab759045c5c5d9fc59b4715f3c142d5b33e
* Do not call LLCP socket listen callback on abort.Arnaud Ferir2011-01-181-6/+2
| | | | | | | | | The listen callback is a notification callback, not an end-of-operation callback so, when the socket is closed, it should not be triggered since there is no connection event. Change-Id: I6e6994f6bcb09f9fadda04800d22528d76aff121
* Fixed NULL pointer error when trying to send LLCP REJECT frame.Arnaud Ferir2011-01-181-2/+5
| | | | | | | The sequence value may not be provided in some situations, when rejecting a connection oriented frame. Change-Id: I116179191f9a23072442cf9da7a4c4207128bd32
* Fixed parameters checking in LLCP.Arnaud Ferir2011-01-182-2/+11
| | | | | | Avoid NULL pointer dereferencing in some situations. Change-Id: I020f0a5342acdc49f7f3804e9341ed0fc0f307ee
* Fixed some build warnings.Arnaud Ferir2011-01-181-2/+1
| | | | Change-Id: I08e8dda5ae23ec251a5b53f71b0e87fb3ba7d02c
* Fixed memory handling in LLCP link layer.Arnaud Ferir2011-01-181-1/+9
| | | | | | | Check that internal allocated buffer is not NULL before deallocating it and make sure the pointer is resetted to NULL. Change-Id: I4212489c8661c7a8dff8ef352029100ec5ab157e
* Allow LLCP socket creation before link establishment.Arnaud Ferir2011-01-184-80/+201
| | | | | | | | | | | | | | | | | This enables to register a server socket prior to LLCP link establishement and avoid any race condition between the local server and the remote client. The modification implies a LLCP socket API change (added the device handle parameter in all LLCP API that can lead to active data exchange). The LLCP socket internal structures are now initialized during LLCP link parameter configuration step instead of LLCP compliancy check to save socket state independently from peer detection. Also removed unused socket states and added some traces. Change-Id: I961c48af4ca9ace68d41b9569dc1038bb2bbdc71
* Call the LLCP send callback in error cases.Arnaud Ferir2011-01-182-0/+26
| | | | | | | This avoids an application to be stuck in a send request while the LLCP link has been lost (i.e. remote peer lost). Change-Id: I74982d497c410ae4bdb466afac013efc9eb17b03
* Fixed wrong byte order in 3-byte L-format in NDEF TLV on T2TJan Brands2011-01-181-4/+4
| | | | Change-Id: I1bd1da26d0c27297e9db8dd41cb6c2f4b2ec806e
* Implement makeReadOnly() for dynamic T1T/T2T.Martijn Coenen2011-01-189-46/+1516
| | | | | | | | The NFC Forum Type 1 Tag and Type 2 Tag specification allows for tags with a dynamic memory layout. Support for making tags with the dynamic layout readonly has been added in this patch. Change-Id: I5bc8912d80f448fdea95e1ee21631c0f186ad79a
* Implement IsoDep timeout handling (libNFC).Martijn Coenen2011-01-184-2/+29
| | | | | | | | | | | Made the ISO XCHG timer (used for IsoDep transceive's) a configurable setting. When this timer triggers in the hardware, the transaction will be aborted and the connection to the tag is broken. Also made the HCI timer configurable. This timer serves as a software watchdog for any HCI transaction. Change-Id: I927c7755378f793899c6d262a2f23ab5dca3817b
* Event field ON/OFF management added in the libnfcdaniel_tomas2011-01-122-10/+32
| | | | Change-Id: Ieafb6ab9094d9dc4b7edfb1e3676fd9794d8af28
* Fix bugs related to SE+P2P co-exisitance.Nick Pelly2011-01-111-2/+17
| | | | | | Source: Patrice @ NXP Change-Id: I9437a2c2798ffe7ea34f3f18df097d0036310568
* Libnfc updated to just notify the JNI when a transaction event is detecteddaniel_tomas2011-01-051-1/+1
| | | | Change-Id: Id2991644e9a45a66172377d66b5dc3e99bbd6a39
* Actually set the lock bits for static T1T and T2T.Martijn Coenen2011-01-046-42/+198
| | | | Change-Id: I594e588fb7f0f8151e54ac872640bb8d3e19bfce
* Add support for makeLowLevelReadonly() in libnfc.Martijn Coenen2010-12-1614-20/+1093
| | | | | | | | Implemented for T1T and T2T. There's also added code for formatting Desfire EV1, but it will not be used by the current implementation (DesFIRE doesn't have NdefFormatable tech). Change-Id: Iec1b85b560fbf800291fd307b56ab84328737635
* Add support for connecting to different handles on the same tag.Martijn Coenen2010-12-163-0/+273
| | | | | | | This is needed for proper multi-protocol tag support. (Before this required a restart of the polling loop). Change-Id: If61da437cda40d82bdbacf5a01ea4c585c7a5be9
* Enable reading a connection-oriented socket even if remotely closed.Sylvain Fonteneau2010-12-132-1/+15
| | | | | | | The receive function was failing when trying to read the data present in the linear buffer after receiving a remote disconnection request (DISC). Change-Id: I48a2aa058e85e265ca53e61dcde281e47a6e187f
* Fixed typo in context restitution.Sylvain Fonteneau2010-12-131-1/+1
| | | | Change-Id: I4784722900b9da58719b7b38a1cd31cbac3ff147
* Do not clear LLCP listen callback when an incoming socket is detected.Sylvain Fonteneau2010-12-131-2/+0
| | | | | | This would prohibit detection of multiple incoming socket in a row. Change-Id: I9e3907a92b706de2da7642ccd92668b9868d1996
* Protect callbacks to crash in LLCP MAC layer if aborted by deactivate.Sylvain Fonteneau2010-12-131-64/+48
| | | | | | Also include code factorization. Change-Id: I7284348d3a8afcc2ebcbd86d1658e60a2cc38b10
* Fix missing send callback in error upon deactivation.Sylvain Fonteneau2010-12-132-3/+41
| | | | Change-Id: I2a857c4e02fcf8c0f655a6fa960466f5ac4f191e
* Report error from lower layer to transport layer in LLCP.Sylvain Fonteneau2010-12-131-8/+7
| | | | | | Makes sure to call callback in case of error and before deactivating. Change-Id: I40cf77a89edc01533684c9c68b1915dac983c59e
* Fix failing presence check after a mifare classic reconnect.Martijn Coenen2010-12-131-0/+1
| | | | Change-Id: I6f833fc6e32cd99496468306af8204f6aee87fa7
* Download feature added in the libnfcdaniel_Tomas2010-12-096-12/+3052
| | | | Change-Id: Idfed8c90453a0acc7fa632f62a1e20617b4ae7f6
* Fix T3T R/W state detectionJan Brands2010-12-071-1/+5
| | | | Change-Id: Ic77a9929111f310b689ac3aa8f90e60c151420e0
* NDEF tag R/W-R/O status functionality from BangaloreJan Brands2010-12-072-0/+52
| | | | | | Provides all the states as defined by the NFC-Forum. Change-Id: I369138404e679b49613a391a9487766160afd8e2
* Avoid multiple callbacks for a single LLCP operation.Sylvain Fonteneau2010-12-071-4/+7
| | | | Change-Id: Ifa17a3a05790fece3f5aee747b186f721c510b7f
* Fix to prevent any action on a LLCP socket while disconnecting.Sylvain Fonteneau2010-12-071-3/+3
| | | | | | | Mark a socket as disconnecting as soon as the disconnect request is received instead of waiting for the DISC packet to be sent. Change-Id: I95330b7039c6fa741adc69ab1323852a60b7d49e
* Fixed file headers.Martijn Coenen2010-12-062-26/+28
| | | | Change-Id: I253cb340782d47ab15c955f3a58a9e662fe86ae0
* Enable setting General Bytes to emptyJan Brands2010-12-052-2/+1
| | | | Change-Id: Id481b30731c1986f9d36f7d9af00be282683b6e1
* Updated with format functionality for DESFire EV1 (T4Tv2)Jan Brands2010-12-052-328/+636
| | | | Change-Id: Ia636ef43087dae7eb0faafc4a977f901756d38b3
* Fix for LLCP concurence access with ConfigureDiscovery, NDEF read/write and ↵daniel_Tomas2010-12-055-4/+55
| | | | | | Presence Check Change-Id: Ie6fc7e26dde98ece2738dcad26f020833b4c0e93
* Fix buffer display in LLCP receive callbackdaniel_Tomas2010-12-052-9/+12
| | | | Change-Id: I85a4235a4f13e02a61d2c07ca301e72e7b369c8b