-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_config.php
More file actions
48 lines (40 loc) · 1.63 KB
/
build_config.php
File metadata and controls
48 lines (40 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
* This is the file that gets called for this module when OpenRepeater rebuilds the configuration files for SVXLink.
* Settings for the config file are created as a PHP associative array, when the file is called it will convert it into
* the requiried INI format and write the config file to the appropriate location with the correct naming.
*/
$options = unserialize($cur_mod['moduleOptions']);
$base_gpio_path = '/sys/class/gpio/gpio';
// Build Config
$module_config_array['Module'.$cur_mod['svxlinkName']] = [
'NAME' => $cur_mod['svxlinkName'],
'ID' => $cur_mod['svxlinkID'],
'PLUGIN_NAME' => 'Tcl',
];
# MODE: Select the operating mode "FOLLOW_PTT" or "COUNT_DOWN"
$module_config_array['Module'.$cur_mod['svxlinkName']] += [
'MODE' => $options['mode'],
'HYSTERESIS_TRIGGER' => $options['hysteresis'],
'DELAY' => $options['delay'],
];
# Path in the file system where the digital inputs can be monitored
# 2 paths are required, if there is only 1 PTT, assign them the same GPIO.
$module_config_array['Module'.$cur_mod['svxlinkName']] += [
'PTT_PATH_1' => $base_gpio_path . trim($options['ptt1_gpio']) . '/value',
];
if(trim($options['ptt2_gpio']) != '') {
$module_config_array['Module'.$cur_mod['svxlinkName']] += [
'PTT_PATH_2' => $base_gpio_path . trim($options['ptt2_gpio']) . '/value',
];
} else {
// Set PTT2 to same value as PTT1
$module_config_array['Module'.$cur_mod['svxlinkName']] += [
'PTT_PATH_2' => $base_gpio_path . trim($options['ptt1_gpio']) . '/value',
];
}
# Fan GPIO
$module_config_array['Module'.$cur_mod['svxlinkName']] += [
'FAN_GPIO' => $base_gpio_path . trim($options['fan_gpio']) . '/value',
];
?>