Partager via


BthSetSecurityUI (Windows Embedded CE 6.0)

1/6/2010

This function allows an application to provide an event that will be signaled by the stack when a device without a PIN sends a PIN request.

Syntax

int BthSetSecurityUI(
  HANDLE hEvent,
  DWORD dwStoreTimeout,
  DWORD dwProcTimeout
);

Parameters

  • hEvent
    [in] The event handle. The event must be kept open. When hEvent=NULL, the handler is freed.
  • dwStoreTimeout
    [in] The period of time, in msec, for which the PIN request is active (not refused) before it is read by BthGetPINRequest.
  • dwProcTimeout
    [in] The period of time, in msec, for which PIN request is kept open after it has been retrieved if the shell responded with BthRefusePINRequest or BthSetPIN.

Return Value

This function returns ERROR_SUCCESS when it completes successfully.

A return value of ERROR_SERVICE_NOT_ACTIVE indicates that the hardware is not inserted or that the Bluetooth stack is not present.

A return value of ERROR_INVALID_PARAMETER indicates that time is either too short (<1000 msec) or too long (>600sec).

A return value of ERROR_ALREADY_ASSIGNED indicates that the event was already set by another application.

Other standard error codes may be returned as appropriate.

Remarks

This is intended for use by the shell to provide Bluetooth PIN a code input dialog box, which is displayed when the PIN request comes from Bluetooth adapter.

Only one application at a time can establish itself as the security UI handler.

Until the application clears its status, by calling BthSetSecurityUI with NULL event handler, all attempts by other processes to establish themselves as handlers of PIN requests will fail. However, the application itself can call the function with different parameters as many times as necessary.

Requirements

Header bt_api.h
Library Btdrt.lib
Windows Embedded CE Windows CE .NET 4.2 and later

See Also

Reference

Bluetooth OS Functions

Other Resources

Bluetooth Application Development