aboutsummaryrefslogtreecommitdiffhomepage
path: root/artnet.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2017-06-05 16:37:02 +0200
committercbdev <cb@cbcdn.com>2017-06-05 16:37:02 +0200
commited55916e772264dc8278fc8c96d4139aec31e89e (patch)
tree9c003bc1e41aceb9a0af3a664785dcd76c03b8f6 /artnet.c
parentc47b0765a8605b9afcc6205a6d2396ccbe3d5e05 (diff)
downloadmidimonster-ed55916e772264dc8278fc8c96d4139aec31e89e.tar.gz
midimonster-ed55916e772264dc8278fc8c96d4139aec31e89e.tar.bz2
midimonster-ed55916e772264dc8278fc8c96d4139aec31e89e.zip
Backend channel spec parsing
Diffstat (limited to 'artnet.c')
-rw-r--r--artnet.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/artnet.c b/artnet.c
index 1fe8fb2..2684d46 100644
--- a/artnet.c
+++ b/artnet.c
@@ -80,9 +80,12 @@ static int artnet_configure_instance(instance* instance, char* option, char* val
}
static channel* artnet_channel(instance* instance, char* spec){
- fprintf(stderr, "Parsing ArtNet channelspec %s\n", spec);
- //TODO
- return NULL;
+ unsigned channel = strtoul(spec, NULL, 10);
+ if(channel > 512 || channel < 1){
+ fprintf(stderr, "Invalid ArtNet channel %s\n", spec);
+ return NULL;
+ }
+ return mm_channel(instance, channel);
}
static int artnet_set(size_t num, channel* c, channel_value* v){