This function can enable the hands-free interface on the device, routing all audio in- and output from the GSM modem through the audio jack to a connected speaker and microphone.
Voice and DTMF functionality will be disabled when this function is used.
If gsmHeadset is already enabled or the GSM modem is not powered on, the hands-free interface can not be enabled.
Input:
enable : BOOL
TRUE:
|
The hands-free interface will be enabled. RTCU voice and DTMF capability is disabled.
|
FALSE:
|
The hands-free interface will be disabled. RTCU voice and DTMF capability is reactivated.
|
Returns: INT
0
|
- Operation was successful.
|
1
|
- Audio interface already opened by gsmHeadset.
|
2
|
- GSM module not powered on.
|
3
|
- General error.
|
5
|
- Not supported on this device.
|
Declaration:
FUNCTION gsmHandsfree : INT;
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
gsmHandsfreeVolume( spk := 50, mic := 50);
gsmHandsfree(enable:=TRUE);
Sleep(delay:=10000);
gsmHandsfree(enable:=FALSE);
gsmHangup();
...
END_IF;
END;
END_PROGRAM;
|