6 line state analysis services, Line state analysis services, M1x22_measure_start – Maxim Integrated 73M1822/73M1922 Control Module User Manual
Page 48: E m1x22_measure_start

73M1822/73M1922 Control Module User Guide
UG_1x22_053
48
Rev. 1.0
6.6 Line State Analysis Services
The following services control the modem line state via line current and line voltage measurements.
Table 6 provides the summary of each IOCTL. These IOCTLs can be used for both measuring entities –
the line current and line voltage.
Table 6: Line State Analysis Services
Name
Description
Descriptor
M1X22_MEASURE_START Start line measurement.
Channel
Stop line measurement.
Channel
Update line measurement parameter (IET).
Channel
6.6.1 M1X22_MEASURE_START
Description
Starts the measurement of a measuring entity (current or voltage) as specified by its IET parameters. The
param
parameter points to a structure that contains the requested measurement criteria.
#define M1X22_MEASURE_START _IOWR(0xA4, 0xE5, unsigned int)
Prototype
int ioctl (
int chan_fd,
int M1X22_MEASURE_START,
unsigned long param );
Parameters
Data Type
Name
Description
int
chan_fd
Channel descriptor.
int
M1X22_MEASURE_START I/O control identifier for this operation.
unsigned long
param
Pointer to M1X22_MEASURE_START_STOP_
Return Values
Data Type
Description
unsigned int
0 – Successful.
-1 – Failed to start measurement.
Example
The following example code illustrates the starting of the line current monitoring.
M1X22_MEASURE_START_t current;
int ret;
current.entity = M1X22_MEASURE_ENTITY_CURRENT; /* start current monitor */
current.sample_time = 100; /* sampling at 100ms interval */
current.average_sample_count = 10; /* averaging over 10 samples */
ret = ioctl (fd, M1X22_MEASURE_START, ¤t);
if (ret < 0)
printf (“Failed to start line current monitoring”);
else
printf (“Successful”);