btHsOpen (Function) |
Top Previous Next |
The btHsOpen is used to open the audio connection to a connected headset. It is possible to issue a Ring command by setting Ring to TRUE when the function is called. Then the headset will play a ring tone until the user accepts/rejects the call or the defined number of rings is reached. If the user accepts the incoming call, the audio connection is active until the user hang-ups by pressing the hang-up button on the headset or the audio connection is closed with btHsClose. If the headset hang-up method is used, the audio connection is closed automatically when the user hang-up, from the headset and it is not necessary to use btHsClose. However, the call is not hung up automatically, and the program must do this manually with gsmHangup. If the Ring parameter is FALSE, the audio connection will be opened without user notification and must be closed with btHsClose.
Use btHsConnected to get the connection status and btHsRingAccept or btHsRingReject to stop the ring asynchronously.
Input: Ring : BOOL When TRUE, the headset will play a ring tone until the user accepts or rejects the call or the number of RingCounts is reached.
RingCount : SINT The number of rings to play before the function returns with a timeout.
Return: SINT
Declaration: FUNCTION btHsOpen : INT;
Example: INCLUDE rtcu.inc |