diff options
author | cbdev <cb@cbcdn.com> | 2017-06-05 16:37:02 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2017-06-05 16:37:02 +0200 |
commit | ed55916e772264dc8278fc8c96d4139aec31e89e (patch) | |
tree | 9c003bc1e41aceb9a0af3a664785dcd76c03b8f6 /artnet.c | |
parent | c47b0765a8605b9afcc6205a6d2396ccbe3d5e05 (diff) | |
download | midimonster-ed55916e772264dc8278fc8c96d4139aec31e89e.tar.gz midimonster-ed55916e772264dc8278fc8c96d4139aec31e89e.tar.bz2 midimonster-ed55916e772264dc8278fc8c96d4139aec31e89e.zip |
Backend channel spec parsing
Diffstat (limited to 'artnet.c')
-rw-r--r-- | artnet.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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){ |