Macro use and format: Difference between revisions
mNo edit summary |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==What is a 'macro'?== | ==What is a 'macro'?== | ||
The purpose of a macro is to store normal command(s). Macros may be called by direct command, [https://wiki.allstarlink.org/wiki/Scheduler_(ASL_System) | The purpose of a macro is to store normal command(s). Macros may be called by direct command, [https://wiki.allstarlink.org/wiki/Scheduler_(ASL_System) by the system scheduler], or even by an external script. They can be a series of commands to make short work of a larger task. | ||
==How to configure within a node== | ==How to configure within a node== | ||
Line 30: | Line 30: | ||
<pre> | <pre> | ||
[macro12345] | [macro12345] | ||
1=*81 ;Play time | 1=*81# ;Play time | ||
2=*81 *31999 *937 P P *995# ; say time, connect node, play net announcement, pause, and turn off telemetry for net | 2=*81 *31999 *937 P P *995# ; say time, connect node, play net announcement, pause, and turn off telemetry for net | ||
3=*31999 *937 *512# ; here we are calling other macro (12) in a string *512. One way to extend a macro with existing. | 3=*31999 *937 *512# ; here we are calling other macro (12) in a string *512. One way to extend a macro with existing. A '#' should be used at the end to terminate. | ||
</pre> | </pre> | ||
Line 41: | Line 41: | ||
Macro's are called with a *5 (star 5) prefix and followed with the number assigned in the [macro] stanza | Macro's are called with a *5 (star 5) prefix and followed with the number assigned in the [macro] stanza | ||
You can also call them from the system schedular by number. Calling a macro # is the only method the scheduler supports. So if you wish to schedule with the system scheduler, you need a macro to execute it. | You can also call them from the system schedular by number. Calling a macro # is the only method the scheduler supports. So if you wish to schedule with the system scheduler, you need a macro to execute it. | ||
Note: You can link additional macro's from any macro to limit how long or how many duplicate entries you have. - *5xxx |
Latest revision as of 16:16, 13 September 2024
What is a 'macro'?
The purpose of a macro is to store normal command(s). Macros may be called by direct command, by the system scheduler, or even by an external script. They can be a series of commands to make short work of a larger task.
How to configure within a node
The first part of macro settings is the macro=
setting. The example here points to a stanza named [macro]
. This is likely already in your config.
[12345] ; Assigned node number rxchannel = SimpleUSB/usb_node# ; Rx audio/signaling channel duplex=2 linktolink=no controlstates=controlstates ; System control state list scheduler=scheduler events=events morse=morse macro=macro ; <===== note this in your rpt.conf tonemacro=tonemacro functions=functions phone_functions=phone_functions link_functions=link_functions wait_times=wait_times telemetry=telemetry
If you have more than one node on a given server and you want all nodes to have the same macros then the above macro=macro is fine. However you may want your nodes to have separate set of macros. In that case you need a separation for a specific node. For example...
macro=macro12345
- where 12345 could be your node number for clarity. And would correspond with macro later in the file as...
[macro12345] 1=*81# ;Play time 2=*81 *31999 *937 P P *995# ; say time, connect node, play net announcement, pause, and turn off telemetry for net 3=*31999 *937 *512# ; here we are calling other macro (12) in a string *512. One way to extend a macro with existing. A '#' should be used at the end to terminate.
Each macro command string is on the same line separated by a space and ends the string with a # (hashtag). A "P" can be used to cause a pause of 500ms or a series of them for more. This would allow time of a script or connection to execute before the next command is issued. The system reads/executes them left to right when called. You should test them after creating them to be sure timing has no interference before you actually need to use them. And note that use of our macro #2 might possibly also require us to create a new one to 'undo' any of our changes. Which in this case might be manually called at the end of the purposed example net.
Execution
Macro's are called with a *5 (star 5) prefix and followed with the number assigned in the [macro] stanza You can also call them from the system schedular by number. Calling a macro # is the only method the scheduler supports. So if you wish to schedule with the system scheduler, you need a macro to execute it.
Note: You can link additional macro's from any macro to limit how long or how many duplicate entries you have. - *5xxx