Function sh2_open
Defined in File sh2.h
Function Documentation
-
int sh2_open(sh2_Hal_t *pHal, sh2_EventCallback_t *eventCallback, void *eventCookie)
Open a session with a sensor hub.
This function should be called before others in this API. An instance of an SH2 HAL should be passed in. This call will result in the open() function of the HAL being called.
As part of the initialization process, a callback function is registered that will be invoked when the device generates certain events. (See sh2_AsyncEventId)
- Parameters:
pHal – Pointer to an SH2 HAL instance, provided by the target system.
eventCallback – Will be called when events, such as reset complete, occur.
eventCookie – Will be passed to eventCallback.
- Returns:
SH2_OK (0), on success. Negative value from sh2_err.h on error.