Hi,
I’m running a RadioUSB channel driver setup with an RA-35 USB peripheral with a CM119A that has several GPIO pins available. I’m attempting to write a test event to set a GPIO pin on that USB peripheral based on a system variable state, but I believe the app_rpt event parser is not correctly working and I’m wondering if this is a bug or there is a work around.
Here’s my GPIO setup in usbradio.conf
[general]
gpio1 = in
gpio2 = out0
gpio4 = out1
gpio5 = in
Here’s my event in rpt.conf
[events1999]
cop,62,GPIO4=1 = c|t|RPT_RXKEYED
cop,62,GPIO4=0 = c|f|RPT_RXKEYED
I receive the following error within the CLI when monitoring activity
ERROR[4499]: app_rpt.c:3483 rpt_event_process: Unrecognized event action (0) in exec item malformed: 0 = c|t|RPT_RXKEYED
ERROR[4499]: app_rpt.c:3483 rpt_event_process: Unrecognized event action (1) in exec item malformed: 1 = c|f|RPT_RXKEYED
It appears the first ‘=’ in the GPIOn=x setting is causing the parser to break the too early per the docs here
http://ohnosec.org/drupal/node/176
Apparently the parser is NOT really looking for ’ = ’ as the delimiting string, but catching ‘=’ instead. I see cop 61 event is looking for “GPIO%d=%d” per line 12827 in app_rpt.c as far as I can tell, but its never getting to that code
https://github.com/AllStarLink/Asterisk/blob/master/asterisk/apps/app_rpt.c
Note I can use the CLI and cop,62 command to properly toggle the GPIO so I know that part of the parser seems to be working OK. I’ve also set a DTMF function command to toggle GPIO and that works too. I’ve also placed other that don’t have an ‘=’ in place of my above cop,62 and that works fine as well.
Any suggestions, fixes or workarounds?
Thanks & 73
andyz - K1RA