Mute

From Sharpfin
Revision as of 09:58, 31 December 2011 by Philipp (talk | contribs) (→‎Overview)
Jump to navigation Jump to search

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>

  1. 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

#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()) ;
}