pub fn start_sensor_listener() -> i32 {
    console_print(b"TMP poll \n");  //  SENSOR_DEVICE "\n";

    //  Set the sensor polling time to 10 seconds.  SENSOR_DEVICE is either "bme280_0" or "temp_stm32_0"
    let rc = unsafe { sensor_set_poll_rate_ms(SENSOR_DEVICE, SENSOR_POLL_TIME) };
    assert!(rc == 0);

    //  Fetch the sensor by name, without locking the driver for exclusive access.
    let listen_sensor = unsafe { sensor_mgr_find_next_bydevname(SENSOR_DEVICE, null_sensor()) };
    assert!(!unsafe{ is_null_sensor(listen_sensor) });

    //  Define the listener function to be called after polling the temperature sensor.
    let listener = SensorListener {
        sl_sensor_type: TEMP_SENSOR_TYPE,      //  Type of sensor: ambient temperature. Either computed (floating-point) or raw (integer)
        sl_func       : read_temperature,      //  Listener function to be called with the sensor data
        sl_arg        : LISTENER_CB,           //  Indicate to the listener function that this is a listener callback
        sl_next       : 0,                     //  Must be 0
    };

    //  Register the Listener Function to be called every 10 seconds, with the polled sensor data.
    let rc = register_listener(listen_sensor, listener);
    assert!(rc == 0);

    //  Return 0 to indicate success.  This line should not end with a semicolon (;).
    0
}
///  For Sensor Node and Standalone Node: Start polling the temperature sensor 
///  every 10 seconds in the background.  After polling the sensor, call the 
///  Listener Function to send the sensor data to the Collector Node (if this is a Sensor Node)
///  or CoAP Server (is this is a Standalone Node).
///  For Collector Node: Start the Listeners for Remote Sensor 
///  Otherwise this is a Standalone Node with ESP8266, or a Sensor Node with nRF24L01.
///  Return 0 if successful.
For Sensor Node and Standalone Node: Start polling the temperature sensor
every 10 seconds in the background.  After polling the sensor, call the
Listener Function to send the sensor data to the Collector Node (if this is a Sensor Node)
or CoAP Server (is this is a Standalone Node).
For Collector Node: Start the Listeners for Remote Sensor
Otherwise this is a Standalone Node with ESP8266, or a Sensor Node with nRF24L01.
Return 0 if successful.
For Sensor Node and Standalone Node : Start polling the temperature sensor every 10 seconds in the background . After polling the sensor call the Listener Function to send the sensor data to the Collector Node ( if this is a Sensor Node ) or CoAP Server ( is this is a Standalone Node ) . For Collector Node : Start the Listeners for Remote Sensor Otherwise this is a Standalone Node with ESP8266 or a Sensor Node with nRF24L01 . Return 0 if successful .
pub fn start_sensor_listener() -> i32 {
    console_print(b"TMP poll \n");  //  SENSOR_DEVICE "\n";
    //  Set the sensor polling time to 10 seconds.  SENSOR_DEVICE is either "bme280_0" or "temp_stm32_0"
    let rc = unsafe { sensor_set_poll_rate_ms(SENSOR_DEVICE, SENSOR_POLL_TIME) };
    assert!(rc == 0);
    //  Fetch the sensor by name, without locking the driver for exclusive access.
    let listen_sensor = unsafe { sensor_mgr_find_next_bydevname(SENSOR_DEVICE, null_sensor()) };
    assert!(!unsafe{ is_null_sensor(listen_sensor) });
    //  Define the listener function to be called after polling the temperature sensor.
    let listener = SensorListener {
        sl_sensor_type: TEMP_SENSOR_TYPE,      //  Type of sensor: ambient temperature. Either computed (floating-point) or raw (integer)
        sl_func       : read_temperature,      //  Listener function to be called with the sensor data
        sl_arg        : LISTENER_CB,           //  Indicate to the listener function that this is a listener callback
        sl_next       : 0,                     //  Must be 0
    };
    //  Register the Listener Function to be called every 10 seconds, with the polled sensor data.
    let rc = register_listener(listen_sensor, listener);
    assert!(rc == 0);
    //  Return 0 to indicate success.  This line should not end with a semicolon (;).
    0
}
pub fn start_sensor_listener ( ) -> i32 { console_print ( b" \n " ) ; //  SENSOR_DEVICE "\n"; //  Set the sensor polling time to 10 seconds.  SENSOR_DEVICE is either "bme280_0" or "temp_stm32_0" let rc = unsafe { sensor_set_poll_rate_ms ( SENSOR_DEVICE , SENSOR_POLL_TIME ) } ; assert ! ( rc 0 ) ; //  Fetch the sensor by name, without locking the driver for exclusive access. let listen_sensor = unsafe { sensor_mgr_find_next_bydevname ( SENSOR_DEVICE , null_sensor ( ) ) } ; assert ! ( unsafe { is_null_sensor ( listen_sensor ) } ) ; //  Define the listener function to be called after polling the temperature sensor. let listener = SensorListener { sl_sensor_type : TEMP_SENSOR_TYPE , //  Type of sensor: ambient temperature. Either computed (floating-point) or raw (integer) sl_func : read_temperature , //  Listener function to be called with the sensor data sl_arg : LISTENER_CB , //  Indicate to the listener function that this is a listener callback sl_next : 0 , //  Must be 0 } ; //  Register the Listener Function to be called every 10 seconds, with the polled sensor data. let rc = register_listener ( listen_sensor , listener ) ; assert ! ( rc 0 ) ; //  Return 0 to indicate success.  This line should not end with a semicolon (;). 0 }
For Sensor Node and Standalone Node: Start polling the temperature sensor
every 10 seconds in the background.
For Sensor Node and Standalone Node : Start polling the temperature sensor every 10 seconds in the background .