mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
node: add short forms of node_{read,write}() for handling single samples
This commit is contained in:
parent
57495543a9
commit
c5d0622e94
3 changed files with 18 additions and 4 deletions
|
@ -198,9 +198,13 @@ struct vlist * node_input_signals(struct vnode *n);
|
|||
*/
|
||||
int node_reverse(struct vnode *n);
|
||||
|
||||
int node_read(struct vnode *n, struct sample * smps[], unsigned cnt);
|
||||
int node_read(struct vnode *n, struct sample *smps[], unsigned cnt);
|
||||
|
||||
int node_write(struct vnode *n, struct sample * smps[], unsigned cnt, bool clone_if_modified = false);
|
||||
int node_write(struct vnode *n, struct sample *smps[], unsigned cnt);
|
||||
|
||||
int node_read(struct vnode *n, struct sample *smp);
|
||||
|
||||
int node_write(struct vnode *n, struct sample *smp);
|
||||
|
||||
int node_poll_fds(struct vnode *n, int fds[]);
|
||||
|
||||
|
|
10
lib/node.cpp
10
lib/node.cpp
|
@ -721,3 +721,13 @@ json_t * node_to_json(struct vnode *n)
|
|||
|
||||
return json_node;
|
||||
}
|
||||
|
||||
int node_read(struct vnode *n, struct sample *smp)
|
||||
{
|
||||
return node_read(n, &smp, 1);
|
||||
}
|
||||
|
||||
int node_write(struct vnode *n, struct sample *smp)
|
||||
{
|
||||
return node_write(n, &smp, 1);
|
||||
}
|
||||
|
|
|
@ -206,8 +206,8 @@ check: if (optarg == endptr)
|
|||
while (!stop && (count < 0 || count--)) {
|
||||
clock_gettime(CLOCK_ID, &send);
|
||||
|
||||
node_write(node, &smp_send, 1); /* Ping */
|
||||
node_read(node, &smp_recv, 1); /* Pong */
|
||||
node_write(node, smp_send); /* Ping */
|
||||
node_read(node, smp_recv); /* Pong */
|
||||
|
||||
clock_gettime(CLOCK_ID, &recv);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue