Platform/ECM3532/M3/framework/sensor_mgr/src/sensor.c
/**
 * Close sensor driver
 *
 * @param sHandle  Sensor driver handle
 *
 * @return 0 on success, negative error code on failure.
 */
Close sensor driver
@param sHandle  Sensor driver handle

@return 0 on success, negative error code on failure.
Close sensor driver @param sHandle Sensor driver handle @return 0 on success negative error code on failure .
int32_t SalSensorClose(tSDrvHandle sDrvHandle)
{
    uint8_t ui8Idx;
    uint32_t ret  = 0;
    tDrvHandle vDrvHandle;
    if ((sDrvHandle != INVALID_HANDLE) && (sDrvHandle < DRIVER_MAX_CNT))
    {
        vDrvHandle = sHandleMapList[sDrvHandle].vDrvHandle;
        if (vDrvHandle != INVALID_HANDLE)
        {
            ui8Idx = sHandleMapList[sDrvHandle].ui8SensorDevIndex;
            xSemaphoreTake(SmLock, portMAX_DELAY);
            ret = sSensorDevList[ui8Idx].sDops->DrvClose(vDrvHandle);
            if (ret >= 0 )
            {
                sHandleMapList[sDrvHandle].vDrvHandle = INVALID_HANDLE;
            }
            xSemaphoreGive(SmLock);
        }
        else
        {
            ret = -EINVAL;
            ecm35xx_printf("SM Close: Error Invalid Handle\r\n");
        }
    }
    return ret;
}
int32_t SalSensorClose ( tSDrvHandle sDrvHandle ) { uint8_t ui8Idx ; uint32_t ret = 0 ; tDrvHandle vDrvHandle ; if ( ( sDrvHandle != INVALID_HANDLE ) && ( sDrvHandle < DRIVER_MAX_CNT ) ) { vDrvHandle = sHandleMapList [ sDrvHandle ] . vDrvHandle ; if ( vDrvHandle != INVALID_HANDLE ) { ui8Idx = sHandleMapList [ sDrvHandle ] . ui8SensorDevIndex ; xSemaphoreTake ( SmLock , portMAX_DELAY ) ; ret = sSensorDevList [ ui8Idx ] . sDops -> DrvClose ( vDrvHandle ) ; if ( ret >= 0 ) { sHandleMapList [ sDrvHandle ] . vDrvHandle = INVALID_HANDLE ; } xSemaphoreGive ( SmLock ) ; } else { ret = - EINVAL ; ecm35xx_printf ( " \r \n " ) ; } } return ret ; }
Close sensor driver
 @param sHandle  Sensor driver handle
Close sensor driver @param sHandle Sensor driver handle