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

Add uint64_t or int64_t support for SafeString.print #78

Open
dakotahorstman opened this issue Jan 8, 2025 · 3 comments
Open

Add uint64_t or int64_t support for SafeString.print #78

dakotahorstman opened this issue Jan 8, 2025 · 3 comments
Assignees

Comments

@dakotahorstman
Copy link

It'd be very convenient if SafeString objects could support printing uint64_t and int64_t types. For my use case, I'm converting these types to hexadecimal (e.g. SafeString.print(num, HEX) like Serial.print(num, HEX)).

This is already supported by BufferedOutput, for example, as the Print object implements functionality that could likely be replicated over.

I understand this deviates from wstring as String doesn't support these types either, but it'd still be great to have.

@dakotahorstman dakotahorstman changed the title Add support uint64_t or int64_t for SafeString.print Add uint64_t or int64_t support for SafeString.print Jan 8, 2025
@drmpf
Copy link
Collaborator

drmpf commented Jan 9, 2025

Happy to consider a pull request to implement this.

@dakotahorstman
Copy link
Author

dakotahorstman commented Jan 9, 2025

Sure, I can look into creating a PR. I assume to test, I would need to upload those outlined in examples/SafeString_Tests to an Arduino and just see if it works? Any specific board(s) I should use/you want me to test with specifically?

I have the following:

  • Adafruit STM32F405 (and my own STM32F405 variant)
  • Arduino Nano 33 IoT
  • Uno 3
  • Mega 2560
  • Silicognition wESP32

@drmpf
Copy link
Collaborator

drmpf commented Jan 10, 2025

testing on a 16bit and 32bit board should be enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants