MultilevelSensor#

Modules#

_sensor_type

_sensor_read_result

_sensor_interface

_sensor_administration

Enumerations#

enum
SENSOR_NAME_AIR_TEMPERATURE = 0x00
SENSOR_NAME_GENERAL_PURPOSE
SENSOR_NAME_ILLUMINANCE
SENSOR_NAME_POWER
SENSOR_NAME_HUMIDITY
SENSOR_NAME_ACCELERATION_X
SENSOR_NAME_ACCELERATION_Y
SENSOR_NAME_ACCELERATION_Z
SENSOR_NAME_MAX_COUNT
}

Defined possible sensor types.

enum
SENSOR_READ_RESULT_SIZE_1 = 1
SENSOR_READ_RESULT_SIZE_2 = 2
SENSOR_READ_RESULT_SIZE_4 = 4
SENSOR_READ_RESULT_SIZE_END = 5
}

Defined possible sensor read size.

enum
SENSOR_READ_RESULT_PRECISION_1 = 1
SENSOR_READ_RESULT_PRECISION_2
SENSOR_READ_RESULT_PRECISION_3
SENSOR_READ_RESULT_PRECISION_END
}

Defined possible sensor read precision.

enum
SENSOR_INTERFACE_RETURN_VALUE_OK
SENSOR_INTERFACE_RETURN_VALUE_ALREADY_SET
SENSOR_INTERFACE_RETURN_VALUE_INVALID_SCALE_VALUE
SENSOR_INTERFACE_RETURN_VALUE_ERROR
SENSOR_INTERFACE_RETURN_VALUE_END
}

Defined sensor interface return values.

enum
CC_MULTILEVEL_SENSOR_RETURN_VALUE_OK
CC_MULTILEVEL_SENSOR_RETURN_VALUE_ERROR
CC_MULTILEVEL_SENSOR_RETURN_VALUE_NOT_FOUND
CC_MULTILEVEL_SENSOR_RETURN_VALUE_ALREADY_REGISTRATED
CC_MULTILEVEL_SENSOR_RETURN_VALUE_REGISTRATION_LIMIT_REACHED
CC_MULTILEVEL_SENSOR_RETURN_VALUE_END
}

Defined Multilevel Sensor return values.

Typedefs#

typedef enum sensor_name

Defined possible sensor types.

typedef struct _sensor_type

Structure that holds the attributes of a sensor type.

typedef struct _sensor_interface

Structure that holds a read result from the read interface.

typedef struct _sensor_administration

Structure that administrate all of the registered sensors.

Functions#

void

This function will report the registered sensor's measured datas to the Lifeline group.

void

Calls the init function for all of the registered sensor interfaces.

uint8_t
cc_multilevel_sensor_check_scale(const sensor_interface_t *i_interface, uint8_t i_scale)

Checks if the wanted scale is a legal one for an interface.

Checks if the wanted sensor type has a registered interface or not.

cc_multilevel_sensor_registration(sensor_interface_t *i_new_sensor)

Registers an interface to a specific sensor type.

cc_multilevel_sensor_get_supported_sensors(uint8_t *o_supported_sensor_buffer)

Fills an input buffer with flags where each flag represents a supported sensor.

cc_multilevel_sensor_get_supported_scale(uint8_t sensor_type_value, uint8_t *o_supported_scale)

Fills an input buffer with flags where each flag represents a supported scale.

cc_multilevel_sensor_get_interface(uint8_t sensor_type_value, sensor_interface_t **o_interface)

Getter function for a sensor type's interface.

cc_multilevel_sensor_get_default_sensor_type(uint8_t *o_default_sensor_type)

Gets the default sensor type value.

cc_multilevel_sensor_init_iterator(sensor_interface_iterator_t **i_iterator)

Initialize an iterator struct for the registered sensor interfaces.

void
cc_multilevel_sensor_next_iterator(sensor_interface_iterator_t **i_iterator)

Moves the iterator reference forward to the next registered interface, if the current is the last one then NULL If there is any registered interface the iterator will be NULL.