aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/visca.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-09-19 01:09:43 +0200
committercbdev <cb@cbcdn.com>2020-09-19 01:09:43 +0200
commit7d3bde27e412ebb6783c2c94f52a08f0e8d8ba49 (patch)
tree12357a9dac252d816002f173c8a67abc2ce71bc6 /backends/visca.c
parente96ca85d8febf559817b43066ba16c8441ba391b (diff)
downloadmidimonster-7d3bde27e412ebb6783c2c94f52a08f0e8d8ba49.tar.gz
midimonster-7d3bde27e412ebb6783c2c94f52a08f0e8d8ba49.tar.bz2
midimonster-7d3bde27e412ebb6783c2c94f52a08f0e8d8ba49.zip
Fix VISCA channel parser
Diffstat (limited to 'backends/visca.c')
-rw-r--r--backends/visca.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/backends/visca.c b/backends/visca.c
index 32f11c9..8465c14 100644
--- a/backends/visca.c
+++ b/backends/visca.c
@@ -110,8 +110,7 @@ static int ptz_instance(instance* inst){
}
static channel* ptz_channel(instance* inst, char* spec, uint8_t flags){
- uint64_t ident = pan;
- size_t command = 0;
+ uint64_t command = 0;
if(flags & mmchannel_input){
LOG("This backend currently only supports output channels");
@@ -120,21 +119,23 @@ static channel* ptz_channel(instance* inst, char* spec, uint8_t flags){
for(command = 0; command < sentinel; command++){
if(!strncmp(spec, ptz_channels[command].name, strlen(ptz_channels[command].name))){
- ident = command;
+ break;
}
}
- if(ident == sentinel){
+ DBGPF("Matched spec %s as %s", spec, ptz_channels[command].name ? ptz_channels[command].name : "sentinel");
+
+ if(command == sentinel){
LOGPF("Unknown channel spec %s", spec);
return NULL;
}
//store the memory to be called above the command type
- if(ident == call || ident == store){
- ident |= (strtoul(spec + strlen(ptz_channels[ident].name), NULL, 10) << 8);
+ if(command == call || command == store){
+ command |= (strtoul(spec + strlen(ptz_channels[command].name), NULL, 10) << 8);
}
- return mm_channel(inst, ident, 1);
+ return mm_channel(inst, command, 1);
}
static size_t ptz_set_pantilt(instance* inst, channel* c, channel_value* v, uint8_t* msg){