locked
ProximityDevice publishBinaryMessage - how to detect if writing to tag fails

    Question

  • I have a question.

    We are currently building an app that reads and writes to NFC tags. Our problem is that when writing to the tag, sometimes if the person holding the tag moves away too fast, or the orientation is wrong, the write fails and the tag is left with no data written on it. 

    IS there any suggested way on verifying if tag writes are successful? Ive checked the documentation and the eventhandler for publishbinarymessage complete doesnt seem to have a flag that states if the write was completed successfully. When we try to re-read the tag immediately after write, it doesn't happen also. It seems we have to take the tag out of the field of view of the device and re-tap again in order to read it. Is there any workaround to this? Can I force the proximity device to re-read the tag while it is still in the field of view?

    Thanks

    Paulo

    Sunday, June 30, 2013 2:43 AM

Answers

  • Hello,

    when  you use the API function with a message handler for transmit

    public long PublishBinaryMessage(
      string messageType, 
      IBuffer message, 
      MessageTransmittedHandler messageTransmittedHandler
    )

    and you have registered a device departed handler

     proximityDevice.DeviceDeparted += ProximityDeviceDeparted; ...
    

    you can assume that for a good written driver the "device departed handler" is called after the "transmitted handler".  In my driver implementation for different NFC chips I call the transmitted handler only, when the NDEF message is successfully written to device.

    regards

    elli

    Wednesday, November 6, 2013 6:40 AM