From ed55916e772264dc8278fc8c96d4139aec31e89e Mon Sep 17 00:00:00 2001 From: cbdev Date: Mon, 5 Jun 2017 16:37:02 +0200 Subject: Backend channel spec parsing --- artnet.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'artnet.c') 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){ -- cgit v1.2.3