Mute: Difference between revisions
Jump to navigation
Jump to search
Line 31: | Line 31: | ||
main(int argc, char *argv[]) | main(int argc, char *argv[]) | ||
{ | { | ||
if (argc==2 && strcmp(argv[1],"on")==0) mute_set(SMUTE_ON) ; | if (argc==2 && strcmp(argv[1],"on")==0) { | ||
else if (argc==2 && strcmp(argv[1],"off")==0) mute_set(SMUTE_OFF) ; | mute_set(SMUTE_ON); | ||
else { printf("mutectl on|off | } else if (argc==2 && strcmp(argv[1],"off")==0) { | ||
") ; return ; } | mute_set(SMUTE_OFF); | ||
} else { | |||
printf("mutectl on|off | |||
"); | |||
return; | |||
} | |||
printf("Mute state is %d | printf("Mute state is %d | ||
", mute_get()) ; | ", mute_get()); | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 10:00, 31 December 2011
Overview
The Libreciva mute function controls the radio's mute state.
In order to use the library function, you must include the header file:
<syntaxhighlight>
- include "mute.h"
</syntaxhighlight>
void mute_set(enum smute_e_state state)
This function changes the radio's mute state. The passed parameter is either:
- SMUTE_ON
- SMUTE_OFF
It is recommended that this function is called when the radio application first starts.
enum smute_e_state mute_get()
This function gets the current mute state. Note that this function will only produce an accurate response if mute_set() has been previously called.
Example
<syntaxhighlight>
- include "mute.h"
- include <string.h>
- include <stdio.h>
main(int argc, char *argv[]) {
if (argc==2 && strcmp(argv[1],"on")==0) { mute_set(SMUTE_ON); } else if (argc==2 && strcmp(argv[1],"off")==0) { mute_set(SMUTE_OFF); } else { printf("mutectl on|off
");
return; } printf("Mute state is %d
", mute_get()); } </syntaxhighlight>