valentiniljaz / cordova-nfcv-plugin

Cordova plugin for reading and writing to NFC tags using NfcV protocol (with support for Ionic2)
14 stars 9 forks source link

Getting error message "E_SYSTEM_INFO_FAILED | CODE:undefined" while reading Tag's SystemInfo #1

Closed SantoshSah closed 7 years ago

SantoshSah commented 7 years ago

Hello @valentiniljaz ,

I have carried over our conversation from https://github.com/chariotsolutions/phonegap-nfc/issues/195#issuecomment-291551518.

I am able to use single intent after setting parameter value from true to false but getting same error message E_SYSTEM_INFO_FAILED | CODE:undefined every time i move mobile to tag.

valentiniljaz commented 7 years ago

Hi @SantoshSah,

The getSystemInfo method should print out in the console what was read from the tag. You should see something like:

** SYSTEM INFO END **
... byte array od read data ...

Could you please paste this printout.

SantoshSah commented 7 years ago

Hello @valentiniljaz ,

Console output:

** SYSTEM INFO START **
** SYSTEM INFO END ** Uint8Array(1)
Error reading: E_SYSTEM_INFO_FAILED | CODE: undefined

Please see detail in below screenshot.

systeminfo_error

I am using below code:

      this.nfcvService.waitForTag();
      this.nfcvService.onTag(
          (tag) => {
              console.log('Found tag', tag);
                this.nfcvService
                .getSystemInfo(false)
                .then((systemInfo) => {
                    console.log('SystemInfo:', systemInfo); // Check the tag's UID and AFI (optionally)
                    this.nfcvService.waitForTag();
                })
                .catch((error) => {
                    console.log('Error reading:', error);
                    this.nfcvService.waitForTag();
                });

          },
          (error) => {
              console.log('Error on tag', error);
              this.nfcvService.waitForTag();
          });
valentiniljaz commented 7 years ago

The return value of getSystemInfo should be an array of bytes, where the first byte should be 0. In your case you received value of 3, which means there was an error reading system info. Value 3 also tells you what kind of error occurred, but to know for sure I would need the datasheet of your tag. Have you, by any chance, received the datasheet from the manufacturer?