net: Implement net_serial_devices
This function provides a platform-specific list of serial devices that can be accessed.
This commit is contained in:
parent
26692e8cb9
commit
b108afb6e7
|
@ -0,0 +1,17 @@
|
|||
#ifndef NET_SERIAL_H
|
||||
#define NET_SERIAL_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
const char *const *net_serial_devices(size_t *n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* NET_SERIAL_H */
|
|
@ -1,4 +1,5 @@
|
|||
#include <net.h>
|
||||
#include <net/serial.h>
|
||||
#include <net_private.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
@ -42,3 +43,8 @@ int net_init_serial(void)
|
|||
void net_deinit_serial(void)
|
||||
{
|
||||
}
|
||||
|
||||
const char *const *net_serial_devices(size_t *const n)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <net.h>
|
||||
#include <net/serial.h>
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
@ -40,3 +41,14 @@ int net_init(void)
|
|||
void net_deinit(void)
|
||||
{
|
||||
}
|
||||
|
||||
const char *const *net_serial_devices(size_t *const n)
|
||||
{
|
||||
static const char *const dev[] =
|
||||
{
|
||||
"PS1 port"
|
||||
};
|
||||
|
||||
*n = sizeof dev / sizeof *dev;
|
||||
return dev;
|
||||
}
|
||||
|
|
|
@ -42,3 +42,8 @@ int net_init_serial(void)
|
|||
void net_deinit_serial(void)
|
||||
{
|
||||
}
|
||||
|
||||
const char *const *net_serial_devices(size_t *const n)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue