Wrap device name and size in a struct
As a benefit, this avoids to take care of the device name length on the caller side.
This commit is contained in:
@@ -14,6 +14,12 @@
|
||||
#include "util/net.h"
|
||||
#include "util/thread.h"
|
||||
|
||||
#define DEVICE_NAME_FIELD_LENGTH 64
|
||||
struct server_info {
|
||||
char device_name[DEVICE_NAME_FIELD_LENGTH];
|
||||
struct sc_size frame_size;
|
||||
};
|
||||
|
||||
struct server {
|
||||
char *serial;
|
||||
process_t process;
|
||||
@@ -58,12 +64,9 @@ server_init(struct server *server);
|
||||
bool
|
||||
server_start(struct server *server, const struct server_params *params);
|
||||
|
||||
#define DEVICE_NAME_FIELD_LENGTH 64
|
||||
// block until the communication with the server is established
|
||||
// device_name must point to a buffer of at least DEVICE_NAME_FIELD_LENGTH bytes
|
||||
bool
|
||||
server_connect_to(struct server *server, char *device_name,
|
||||
struct sc_size *size);
|
||||
server_connect_to(struct server *server, struct server_info *info);
|
||||
|
||||
// disconnect and kill the server process
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user