Search code examples
c#windows-phone-8nfcproximity

How to detect writeable capacity of nfc chip


I wanna know a tag's writeable capacity.

What am i doing:

  • subscribing for a message

m_proxdevice.SubscribeForMessage("WriteableTag", OnTagDetect);

  • receive the message

private void OnTagDetect(ProximityDevice sender, ProximityMessage message)

{

   System.Diagnostics.Debug.WriteLine(message.Data.Capacity.ToString());

}

but every time the capacity is just 4. I'm doing something wrong, but what?

Thanks in advance!


Solution

  • message.Data.Capacity is the wrong property.

    Use

    int writeableSize = System.BitConverter.ToInt32(message.Data.ToArray(), 0);
    

    instead.