gsmHeadset (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2 pro, MX2 turbo, NX-200, NX-400

Firmware version:

1.00 / 1.00.00


This function can enable the headset interface on the device, routing all audio in- and output from the GSM modem through the audio jack to a connected headset.
Voice and DTMF functionality will be disabled when this function is used.

 

If gsmHandsfree is already enabled or the GSM modem is not powered on, the headset interface can not be enabled.

 

Input:        

enable : BOOL

TRUE:

The headset interface will be enabled. RTCU voice and DTMF capability is disabled.

FALSE:

The headset interface will be disabled. RTCU voice and DTMF capability is reactivated.

 

Returns: BOOL

TRUE:

Operation  was successful.

FALSE:

Failed to activate headset.

 

Declaration:

FUNCTION gsmHeadset : BOOL;
VAR_INPUT
  enable : BOOL;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
// Turn on power to the GSM module
gsmPower(power := TRUE);
 
BEGIN
  ...
  // Make a call
  IF gsmMakeCall(phonenumber := "+44 22 33 44 55") THEN
     // Successful, we have established a connection
    // Enable headset for 10 seconds
    gsmHeadset(enable:=TRUE);
    Sleep(delay:=10000);
    // Disable headset
    gsmHeadset(enable:=FALSE);
    // Hangup the phone
    gsmHangup();
     ...
  END_IF;
END;
 
END_PROGRAM;