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

Add elphel_num_sensors function

parent 7869cf5a
...@@ -237,6 +237,7 @@ static zend_function_entry elphel_functions[] = { ...@@ -237,6 +237,7 @@ static zend_function_entry elphel_functions[] = {
PHP_FE(elphel_histogram_get_raw, NULL) PHP_FE(elphel_histogram_get_raw, NULL)
PHP_FE(elphel_histogram_get, NULL) PHP_FE(elphel_histogram_get, NULL)
PHP_FE(elphel_get_state, NULL) PHP_FE(elphel_get_state, NULL)
PHP_FE(elphel_num_sensors, NULL)
PHP_FE(elphel_compressor_reset, NULL) PHP_FE(elphel_compressor_reset, NULL)
PHP_FE(elphel_compressor_run, NULL) PHP_FE(elphel_compressor_run, NULL)
...@@ -562,6 +563,13 @@ PHP_FUNCTION(elphel_test) ...@@ -562,6 +563,13 @@ PHP_FUNCTION(elphel_test)
RETURN_LONG(result); 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 ///NOTE: Just for compatibility with older code
//!Get sensor state, usually 7- sensor is running, compressor is stopped, 8 - compressor is runing //!Get sensor state, usually 7- sensor is running, compressor is stopped, 8 - compressor is runing
......
...@@ -93,6 +93,7 @@ PHP_FUNCTION(elphel_histogram_get_raw); ...@@ -93,6 +93,7 @@ PHP_FUNCTION(elphel_histogram_get_raw);
PHP_FUNCTION(elphel_histogram_get); PHP_FUNCTION(elphel_histogram_get);
PHP_FUNCTION(elphel_get_state); /// compatibility with old code 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_reset); /// these elphel_compressor_*() functions are for compatibility. Reset will now just stop, not actually reset
PHP_FUNCTION(elphel_compressor_run); PHP_FUNCTION(elphel_compressor_run);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment