Enumerations | |
enum | LiSources_t { CO2A_UMM = 1, CO2B_UMM = 2, CO2D_UMM = 3, H2OA_MMM = 4, H2OB_MMM = 5, H2OD_MMM = 6, CO2A_PA = 10, CO2B_PA = 11, CO2D_PA = 12, H2OA_KPA = 13, H2OB_KPA = 14, H2OD_KPA = 15, H2OA_DPC = 16, H2OB_DPC = 17, H2OD_DPC = 18, P_KPA = 22, T_C = 23, CO2A_W = 50, CO2B_W = 51, H2OA_W = 52, H2OB_W = 53 } |
enum | LiTimestamp_t { STAMP_LONG = 0, STAMP_SHORT = 1, STAMP_NONE = 2 } |
enum | LiH2OReference_t { ESTIMATED = 0, DRY = 1, EXACT = 2, AUX1 = 2, AUX2 = 3 } |
enum | LiPumpRate_t { PUMP_OFF = 0, PUMP_SLOW = 1, PUMP_MEDIUM = 2, PUMP_FAST = 3 } |
Functions | |
Li7000_t * | liOpen (const char *const ttydevice) |
Open LI-7000 communication. | |
void | liClose (Li7000_t *obj) |
Close LI-7000 communication. | |
int | liGetFd (Li7000_t *obj) |
Return file descriptor of serial port. | |
int | liSend (Li7000_t *obj, const char *const data) |
Send data to LI-7000. | |
char * | liGetSavedLine (Li7000_t *obj) |
Return next saved response line. | |
char * | liReadNextLine (Li7000_t *obj, char *buf, size_t buflen) |
Read next line from LI-7000, and return it. | |
int | liSetDataTypes (Li7000_t *obj, LiTimestamp_t timestamp, int num,...) |
Set data sources. | |
int | liSetDataTypesV (Li7000_t *obj, LiTimestamp_t timestamp, LiSources_t *src, int num) |
Set data sources. | |
int | liQueryDataTypes (Li7000_t *obj, LiTimestamp_t *timestamp, LiSources_t *sources, int maxnum) |
Queries actually set DATA sources. | |
int | liSetDataRate (Li7000_t *obj, int rate) |
Sets DATA aquire rate. | |
int | liQueryDataRate (Li7000_t *obj) |
Queries DATA aquire rate. | |
int | liSetH2OReference (Li7000_t *obj, LiH2OReference_t mode, float conc) |
Sets H2O reference mode. | |
int | liParseData (char *const data, time_t *time, double *values, size_t len) |
Parses a DATA datagram sent by the LI-7000. | |
int | liPoll (Li7000_t *obj, time_t *time, double *values, size_t len) |
Polls one data set. | |
int | liCalibDoH2OReadA (Li7000_t *obj, float conc) |
Calibrates H2O: Make Cell A read (exact value) (![]() | |
int | liCalibDoH2OReadAM (Li7000_t *obj, float conc) |
Calibrates H2O: Make Cell A read (exact value) (mmol/mol). | |
int | liCalibDoH2OMatch (Li7000_t *obj) |
Calibrates H2O: Match Cell A and Cell B. | |
int | liGetH2OCalibCoefficients (Li7000_t *obj, double *z, double *zm, double *s, double *w0) |
Returns calibration coefficients. | |
const char * | liDataTypeString (LiSources_t type) |
Returns a string with the name of a Li_Sources_t type. | |
int | liSetPumpRate (Li7000_t *obj, LiPumpRate_t rate) |
Sets internal pump. | |
double | magnusFormula (double T) |
Calculates water vapour partial pressure of dew point using Magnus' formula. |
enum LiSources_t |
Sources that can be queried from LI-7000
enum LiTimestamp_t |
enum LiH2OReference_t |
enum LiPumpRate_t |
EXTERN Li7000_t * liOpen | ( | const char *const | ttydevice | ) |
Open LI-7000 communication.
This function initialises everything needed for communication with the LI-7000 device. It opens the port and does tty settings.
ttydevice | The device name of the serial port |
EXTERN void liClose | ( | Li7000_t * | obj | ) |
Close LI-7000 communication.
obj | Pointer to the Li7000 "object" structure |
EXTERN int liGetFd | ( | Li7000_t * | obj | ) |
Return file descriptor of serial port.
obj | Pointer to the Li7000 "object" structure |
EXTERN int liSend | ( | Li7000_t * | obj, | |
const char *const | data | |||
) |
Send data to LI-7000.
Sends the data contained in data and waits for the response
obj | Pointer to the Li7000 "object" structure | |
data | Null-terminated string which contains data to send |
EXTERN char * liGetSavedLine | ( | Li7000_t * | obj | ) |
Return next saved response line.
Returns the next saved line from the response buffer, or NULL if there is none left. The returned item is removed from the list.
obj | Pointer to the Li7000 "object" structure |
EXTERN char * liReadNextLine | ( | Li7000_t * | obj, | |
char * | buf, | |||
size_t | buflen | |||
) |
Read next line from LI-7000, and return it.
If there are saved lines in the response buffer, these are returned first. If there are no more unread lines, the function reads a line from the LI-7000. It will block until new data becomes available on the serial line.
obj | Pointer to the Li7000 "object" structure | |
buf | The buffer into which the string will be stored, or NULL if memory should be allocated for it. | |
buflen | The length of the buffer buf |
EXTERN int liSetDataTypes | ( | Li7000_t * | obj, | |
LiTimestamp_t | timestamp, | |||
int | num, | |||
... | ||||
) |
Set data sources.
Sets data sources to be returned by the LI-7000, either by polling or by fixed-rate output.
obj | Pointer to the Li7000 "object" structure | |
timestamp | The timestamp to be used | |
num | The number of data sources to be set | |
... | num arguments of type LiSources_t, describing what is to be returned in the corresponding location. |
liSetDataTypes(li, SHORT, 3, CO2B_UMM, H2OB_MMM, TC);
EXTERN int liSetDataTypesV | ( | Li7000_t * | obj, | |
LiTimestamp_t | timestamp, | |||
LiSources_t * | src, | |||
int | num | |||
) |
Set data sources.
Sets data sources to be returned by the LI-7000, either by polling or by fixed-rate output.
This is something like an overloaded member function, doing exactly the same as liSetDataTypes(), but with other types of arguments.
obj | Pointer to the Li7000 "object" structure | |
timestamp | The timestamp to be used | |
src | An array of LiSources_t | |
num | The number of elements in the src array |
EXTERN int liQueryDataTypes | ( | Li7000_t * | obj, | |
LiTimestamp_t * | timestamp, | |||
LiSources_t * | sources, | |||
int | maxnum | |||
) |
Queries actually set DATA sources.
obj | Pointer to the Li7000 "object" structure | |
timestamp | Returns the timestamp to be used | |
sources | Returns the sources set | |
maxnum | the maximum number of elements in the array sources |
EXTERN int liSetDataRate | ( | Li7000_t * | obj, | |
int | rate | |||
) |
Sets DATA aquire rate.
obj | Pointer to the Li7000 "object" structure | |
rate | the data rate in seconds to be used (e.g. 2 means send every 2 seconds); 0 = polled operation |
EXTERN int liQueryDataRate | ( | Li7000_t * | obj | ) |
Queries DATA aquire rate.
obj | Pointer to the Li7000 "object" structure |
EXTERN int liSetH2OReference | ( | Li7000_t * | obj, | |
LiH2OReference_t | mode, | |||
float | conc | |||
) |
Sets H2O reference mode.
This function sets the reference mode, i.e. the mode the LI-7000 uses to aquire data.
obj | Pointer to the Li7000 "object" structure | |
mode | The mode to be set | |
conc | The known Cell A concentration in EXACT mode |
EXTERN int liParseData | ( | char *const | data, | |
time_t * | time, | |||
double * | values, | |||
size_t | len | |||
) |
Parses a DATA datagram sent by the LI-7000.
data | A pointer to a string containing the data sent | |
time | This variable will be set to the time stamp of the data | |
values | A pointer to an array of double which stores the data transfered | |
len | The length of the values array |
EXTERN int liPoll | ( | Li7000_t * | obj, | |
time_t * | time, | |||
double * | values, | |||
size_t | len | |||
) |
Polls one data set.
This function is only to be called if the LI-7000 is in poll mode. See liSetDataRate() function.
obj | Pointer to the Li7000 "object" structure | |
time | This variable will be set to the time stamp of the data | |
values | A pointer to an array of double which stores the data transfered | |
len | The length of the values array |
EXTERN int liCalibDoH2OReadA | ( | Li7000_t * | obj, | |
float | conc | |||
) |
Calibrates H2O: Make Cell A read (exact value) ( C).
This function does H2O calibration. It assumes that a constant and known H2O concentration is actually flowing through cell A of the LI-7000 and it already has stabilised; if you are not sure whether values have stabilised yet, consider liCalibrateH2O().
The known concentration has to be given with the conc parameter.
obj | Pointer to the Li7000 "object" structure | |
conc | The H2O concentration, given as dew point (![]() |
EXTERN int liCalibDoH2OReadAM | ( | Li7000_t * | obj, | |
float | conc | |||
) |
Calibrates H2O: Make Cell A read (exact value) (mmol/mol).
This function is analogous to liCalibDoH2OReadA(), but the concentration is given in mmol/mol.
obj | Pointer to the Li7000 "object" structure | |
conc | The H2O concentration, given as dew point (mmol/mol) |
EXTERN int liCalibDoH2OMatch | ( | Li7000_t * | obj | ) |
Calibrates H2O: Match Cell A and Cell B.
This function does H2O calibration. It assumes that the same H2O concentration is actually flowing through both cells of the LI-7000 and it already has stabilised; if you are not sure whether values have stabilised yet, consider liCalibrateH2O().
obj | Pointer to the Li7000 "object" structure |
EXTERN int liGetH2OCalibCoefficients | ( | Li7000_t * | obj, | |
double * | z, | |||
double * | zm, | |||
double * | s, | |||
double * | w0 | |||
) |
Returns calibration coefficients.
This function returns the H2O calibration coefficients Z, Zm, S, and W0
obj | Pointer to the Li7000 "object" structure | |
z | Returns Z | |
zm | Returns Zm | |
s | Returns S | |
w0 | Returns W0 |
EXTERN const char * liDataTypeString | ( | LiSources_t | type | ) |
Returns a string with the name of a Li_Sources_t type.
type | The type |
EXTERN int liSetPumpRate | ( | Li7000_t * | obj, | |
LiPumpRate_t | rate | |||
) |
Sets internal pump.
Sets the speed of the internal pump of the LI-7000.
obj | Pointer to the Li7000 "object" structure | |
rate | The flow rate to be set |
EXTERN double magnusFormula | ( | double | T | ) |
Calculates water vapour partial pressure of dew point using Magnus' formula.
T | Temperature (K) |
Generated by![]() |
|