Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call of overloaded 'write(int)' is ambiguous #99

Closed
kordeiro opened this issue Jun 4, 2020 · 4 comments
Closed

Call of overloaded 'write(int)' is ambiguous #99

kordeiro opened this issue Jun 4, 2020 · 4 comments
Assignees
Labels
PN532 Label for PN532 UAY Unassigned yet

Comments

@kordeiro
Copy link

kordeiro commented Jun 4, 2020

I get the following error: (PN532_HSU\PN532_HSU.cpp:21:21: error: call of overloaded 'write(int)' is ambiguous) when trying to use the PN532_HSU lib.

#include <PN532_HSU.h>

PN532_HSU pn532_interface(Serial1);
PN532 nfc(pn532_interface);

void setup(void) {
  Serial.begin(115200);
  Serial.println("Hello!");

  nfc.begin();

  uint32_t versiondata = nfc.getFirmwareVersion();
  if (! versiondata) {
    Serial.print("Didn't find PN53x board");
    while (1); // halt
  }
  // Got ok data, print it out!
  Serial.print("Found chip PN5"); Serial.println((versiondata>>24) & 0xFF, HEX); 
  Serial.print("Firmware ver. "); Serial.print((versiondata>>16) & 0xFF, DEC); 
  Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);
  
  // configure board to read RFID tags
  nfc.SAMConfig();
  
  Serial.println("Waiting for an ISO14443A Card ...");
}

Am I doing something wrong?

I am using Platform IO, and an Arduino Due
@Ariel-International
Copy link

Ariel-International commented Feb 4, 2021

Solved!
In library file PN5323_HSU.cpp one must specify data type every time an integer is used, pecause it could be a pointer, which is not.
Example from line 16 on:
`
void PN532_HSU::wakeup()

{

_serial->write(0x55);                      //_serial->write((byte)0x55);

_serial->write(0x55);                      //_serial->write((byte)0x55);

_serial->write(uint8_t(0x00));            //_serial->write((byte)0x00);

_serial->write(uint8_t(0x00));            //_serial->write((byte)0x00);

_serial->write(uint8_t(0x00));            //_serial->write((byte)0x00);

`

Line 52 is correct: _serial->write(uint8_t(PN532_PREAMBLE));
But line 60 again is not: _serial->write(PN532_HOSTTOPN532);

This error shows up only in some platforms, ie. SAMD.
It's a different compiler with different requirements.

@kordeiro
Copy link
Author

kordeiro commented Feb 4, 2021

Thanks so much! I will give it a try this evening 👍

@MatthewJeffson MatthewJeffson added UAY Unassigned yet PN532 Label for PN532 and removed UAY Unassigned yet labels Oct 9, 2024
@Cincinnatu
Copy link

非常感谢!今晚👍我会试一试

Hello Is the issue resolved now?

@Lesords
Copy link

Lesords commented Nov 4, 2024

Hello,

I'm going to close this issue, feel free to re-open it if you have any other questions.

[Autocommentary]

@Lesords Lesords closed this as completed Nov 4, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PR Assemble Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PN532 Label for PN532 UAY Unassigned yet
Projects
Status: Done
Development

No branches or pull requests

5 participants