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;
gsmPower(power := TRUE);
BEGIN
...
IF gsmMakeCall(phonenumber := "+44 22 33 44 55") THEN
gsmHeadset(enable:=TRUE);
Sleep(delay:=10000);
gsmHeadset(enable:=FALSE);
gsmHangup();
...
END_IF;
END;
END_PROGRAM;
|