| 275 | |
| 276 | template<typename... Args> |
| 277 | inline size_t SerialPort::printf(const char* format, Args... args) { |
| 278 | if (!format) { |
| 279 | return 0; |
| 280 | } |
| 281 | |
| 282 | // Format into a fixed-size buffer using fl::snprintf |
| 283 | char buffer[256]; // Maximum formatted string length |
| 284 | int len = fl::snprintf(buffer, sizeof(buffer), format, args...); |
| 285 | |
| 286 | if (len < 0) { |
| 287 | return 0; // Formatting error |
| 288 | } |
| 289 | |
| 290 | // Delegate to print() method |
| 291 | return print(buffer); |
| 292 | } |
| 293 | |
| 294 | // Global Serial object (Arduino-compatible) |
| 295 | // FL_MAYBE_UNUSED allows compiler to elide if not used |
no test coverage detected