Mute

From Sharpfin
Revision as of 13:40, 8 June 2025 by Philipp (talk | contribs) (Created page with "== Overview == The Libreciva mute function controls the radio's mute state. In order to use the library function, you must include the header file: <pre> #include "mute.h" </pre> === 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 fu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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:

#include "mute.h"

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