Mute: Difference between revisions
Jump to navigation
Jump to search
Line 24: | Line 24: | ||
== Example == | == Example == | ||
< | <syntaxhighlight> | ||
#include "mute.h" | #include "mute.h" | ||
#include <string.h> | #include <string.h> | ||
Line 38: | Line 38: | ||
", mute_get()) ; | ", mute_get()) ; | ||
} | } | ||
</ | </syntaxhighlight> |
Revision as of 09:59, 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>