Commit 7dbb2566 authored by Mikhail Karpenko's avatar Mikhail Karpenko
Browse files

Add elphel_num_sensors function

parent 7869cf5a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -237,6 +237,7 @@ static zend_function_entry elphel_functions[] = {
        PHP_FE(elphel_histogram_get_raw, NULL)
        PHP_FE(elphel_histogram_get, NULL)
        PHP_FE(elphel_get_state, NULL)
        PHP_FE(elphel_num_sensors, NULL)

        PHP_FE(elphel_compressor_reset, NULL)
        PHP_FE(elphel_compressor_run, NULL)
@@ -562,6 +563,13 @@ PHP_FUNCTION(elphel_test)
    RETURN_LONG(result);
} 

/** Return the number of sensor ports */
PHP_FUNCTION(elphel_num_sensors)
{
	long result = SENSOR_PORTS;
    RETURN_LONG(result);
}


///NOTE: Just for compatibility with older code
//!Get sensor state, usually 7- sensor is running,  compressor is stopped, 8 - compressor is runing
+1 −0
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ PHP_FUNCTION(elphel_histogram_get_raw);
PHP_FUNCTION(elphel_histogram_get);

PHP_FUNCTION(elphel_get_state); /// compatibility with old code
PHP_FUNCTION(elphel_num_sensors);

PHP_FUNCTION(elphel_compressor_reset); /// these elphel_compressor_*() functions are for compatibility. Reset will now just stop, not actually reset
PHP_FUNCTION(elphel_compressor_run);