// Generic portable-C no-op defaults for the serial add-on (Category B
// platform service). Serial is inherently platform-specific hardware, so the
// "generic" is a no-op/zero stub that lets a blank/template port link with the
// serial module present; every real port overrides via JL_HAS_SERIAL_<OP>.
// A port with no serial hardware links these and the API reports "no port
// open" -- jlSerialOpen returns false, reads yield 0. Always compiled in via
// the src/generic/*.c wildcard; dead-stripped on ports that override.

#include "joey/serial.h"
#include "port.h"


uint16_t jlpGenericSerialAvailable(void) {
    return 0u;
}


void jlpGenericSerialClose(void) {
}


void jlpGenericSerialFlush(void) {
}


bool jlpGenericSerialOpen(jlSerialDeviceE device, const jlSerialConfigT *config) {
    (void)device;
    (void)config;
    return false;
}


void jlpGenericSerialPoll(void) {
}


uint16_t jlpGenericSerialRead(uint8_t *buf, uint16_t max) {
    (void)buf;
    (void)max;
    return 0u;
}


uint16_t jlpGenericSerialWrite(const uint8_t *buf, uint16_t len) {
    (void)buf;
    (void)len;
    return 0u;
}
