forked from LongHairedHacker/twinkl-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
message_wrapper.c
32 lines (24 loc) · 820 Bytes
/
message_wrapper.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "message.h"
#include <stdlib.h>
// Wrapper for the inline functions in message.h
// Also enforces a consistent naming scheme for symbols in twinklclient.so
struct twinkl_message* twinklmsg_create() {
struct twinkl_message* msg = malloc(sizeof(struct twinkl_message));
twinkl_init_message(msg);
return msg;
}
void twinklmsg_reset(struct twinkl_message *msg) {
twinkl_init_message(msg);
}
void twinklmsg_set_value(struct twinkl_message *msg, uint16_t chan, uint8_t value) {
twinkl_set_value(msg, chan, value);
}
void twinklmsg_unset_value(struct twinkl_message *msg, uint16_t chan) {
twinkl_unset_value(msg, chan);
}
void twinklmsg_set_priority(struct twinkl_message *msg, uint8_t priority) {
twinkl_set_priority(msg, priority);
}
void twinklmsg_destroy(struct twinkl_message* msg) {
free(msg);
}