Go to the source code of this file.
Data Structures | |
struct | serconfig |
Structure used with em_serconfig_set and em_serconfig_get. More... | |
Defines | |
#define | NORMAL 0x0 |
For use with em_devtype function. | |
#define | EMATE 0x1 |
For use with em_devtype function. | |
#define | CONTROL_DTR 0x20 /* data terminal ready - flow control - host to device */ |
For use with em_linecontrol function. | |
#define | CONTROL_RTS 0x10 /* request to send - flow control - host to device */ |
For use with em_linecontrol function. | |
#define | CONTROL_RESET 0x08 /* sent with output report (unknown affect) - host to device */ |
For use with em_linecontrol function. | |
#define | CONTROL_DROP 0x00 /* drop all lines */ |
For use with em_linecontrol function. | |
#define | PAR_ODD 0x30 |
For use with parameter parity of structure serconfig. | |
#define | PAR_EVEN 0x10 |
For use with parameter parity of structure serconfig. | |
#define | PAR_NONE 0x00 |
For use with parameter parity of structure serconfig. | |
#define | EM_MAX_READ 4096 |
For use with em_read function. | |
#define | EM_MAX_WRITE 4096 |
For use with em_write function. | |
#define | EMT_ACTIVE 1 |
For use with em_change_state function. | |
#define | EMT_IDLING 0 |
For use with em_change_state function. | |
#define | VENDOR_ID_DELORME 0x1163 |
The USB Vendor ID used to find the Earthmate device with libusb. | |
#define | PRODUCT_ID_EARTHMATEUSB 0x0100 |
The USB Product ID used to find the Earthmate device with libusb. | |
#define | MAX_READ_WRITE 30 |
For use with em_raw_read and em_raw_write. | |
Functions | |
void | em_devtype (int type) |
Sets the device type, either a normal tty or earthmate device. | |
int | em_isemate (void) |
Indicates whether or not device type is set to normal tty or earthmate device. | |
int | em_isactive (void) |
Indicates whether or not the device has been opened and thread is active. | |
int | em_open (void) |
Opens the earthmate device and starts thread. | |
void | em_close (void) |
Closes the earthmate device and stops thread. | |
int | em_replug (void) |
Causes reenumeration after device and thread have been stopped. | |
void | em_linecontrol (u_int8_t lines) |
Sets the line state for the earthmate device. | |
int | em_serconfig_set (struct serconfig *sconfig) |
Function for setting serial parameters using serconfig object. | |
int | em_serconfig_get (struct serconfig *sconfig) |
Function for retrieving serial parameters using serconfig object. | |
int | em_read (u_int8_t buffer[], int count) |
Function for retrieving read data from Earthmate device from read buffer. | |
int | em_write (const u_int8_t *buffer, int count) |
Function for sending write data from the program to the write buffer. | |
int | em_flush (int queue_selector) |
Function for clearing either the read, write, or both buffers. | |
int | em_read_data_avail (void) |
Function that indicates how much data is available in the read buffer. | |
int | em_write_data_avail (void) |
Function that indicates how much data is available in the write buffer. | |
int | em_datawait (struct timeval *tv, int jumpout) |
Function that stops execution by sleeping either until data becomes available in the read buffer, or the timeout value expires. Behaves almost like select. | |
int | em_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) |
Function that waits on select activity and/or read buffer data becoming available. | |
void | em_writewait (void) |
Counterpart to tcdrain. Sleeps until all data in write buffer has been written. | |
void | em_debuglevel (int mode) |
Function that sets the debugging level of the emul library. | |
ssize_t | READ (int fd, void *buf, size_t count) |
Function that can be placed wherever read() is used safely. | |
ssize_t | WRITE (int fd, const void *buf, size_t count) |
Function that can be placed wherever write() is used safely. | |
unsigned int | em_getbaudmask (unsigned int rate) |
Function for retrieving integer baud rate from masked rate. | |
long | em_getbaudrate (void) |
Function for retriving current baudrate of connection with the Earthmate device. | |
int | em_raw_read (u_int8_t buffer[]) |
Function that reads directly from the Earthmate device. If the thread is active, this function should never be called as libusb will have you pulling your hair out. | |
int | em_raw_write (u_int8_t *buffer, int size) |
Function that writes directly to the Earthmate device. If the thread is active, this function should never be called as libusb will have you pulling your hair out. |
Contains facilities for accessing the earthmate.
|
For use with em_linecontrol function. When used in conjunction with em_linecontrol, this will drop both dtr and rts lines on the Earthmate device. This should be issued without bitmask. |
|
For use with em_linecontrol function. When used in conjunction with em_linecontrol, this will raise the dtr line on the Earthmate device. This can be bitmasked with CONTROL_RTS and CONTROL_RESET. FYI, DTR is an acronym for data terminal ready. |
|
For use with em_linecontrol function. When used in conjunction with em_linecontrol, this will cause a device reset which has and as yet unknown affect on the Earthmate device. This can be bitmasked with CONTROL_DTR and CONTROL_RTS. |
|
For use with em_linecontrol function. When used in conjunction with em_linecontrol, this will raise the rts line on the Earthmate device. This can be bitmasked with CONTROL_DTR and CONTROL_RESET. FYI, RTS is an acronym for request to send. |
|
For use with em_read function. This is the max amount of data the read buffer can store. |
|
For use with em_write function. This is the max amount of data the write buffer can store. |
|
For use with em_devtype function. When used in conjunction with em_devtype, this will set the active device to an Earthmate device. |
|
For use with em_change_state function. When used in conjunction with the em_change_state function, this will change the thread state to active. |
|
For use with em_change_state function. When used in conjunction with the em_change_state function, the thread state will change to idle. |
|
For use with em_raw_read and em_raw_write. This is the max amount of data that can be transmitted with em_raw_read and em_raw_write. The device can handle 32 bytes for the input/output reports, but 2 bytes are used for length, control line, uart status, etc. |
|
For use with em_devtype function. When used in conjunction with em_devtype, this will set the active device to a normal tty device. |
|
For use with parameter parity of structure serconfig. Indicates even parity. |
|
For use with parameter parity of structure serconfig. Indicates no parity. |
|
For use with parameter parity of structure serconfig. Indicates odd parity. |
|
Closes the earthmate device and stops thread. em_close should be called when the program has finished communicating with the device. |
|
Function that stops execution by sleeping either until data becomes available in the read buffer, or the timeout value expires. Behaves almost like select.
|
|
Function that sets the debugging level of the emul library.
|
|
Sets the device type, either a normal tty or earthmate device.
|
|
Function for clearing either the read, write, or both buffers.
|
|
Function for retrieving integer baud rate from masked rate.
|
|
Function for retriving current baudrate of connection with the Earthmate device.
|
|
Indicates whether or not the device has been opened and thread is active.
|
|
Indicates whether or not device type is set to normal tty or earthmate device.
|
|
Sets the line state for the earthmate device.
|
|
Opens the earthmate device and starts thread. This must be the first function called before device can be accessed. Only a few functions can be called without opening the device first.
|
|
Function that reads directly from the Earthmate device. If the thread is active, this function should never be called as libusb will have you pulling your hair out.
|
|
Function that writes directly to the Earthmate device. If the thread is active, this function should never be called as libusb will have you pulling your hair out.
|
|
Function for retrieving read data from Earthmate device from read buffer.
|
|
Function that indicates how much data is available in the read buffer.
|
|
Causes reenumeration after device and thread have been stopped. After a successful call, a new usb device handle will have been obtained and the thread will start again. The usual functions may be called once more.
|
|
Function that waits on select activity and/or read buffer data becoming available.
|
|
Function for retrieving serial parameters using serconfig object.
|
|
Function for setting serial parameters using serconfig object.
|
|
Function for sending write data from the program to the write buffer.
|
|
Function that indicates how much data is available in the write buffer.
|
|
Function that can be placed wherever read() is used safely.
|
|
Function that can be placed wherever write() is used safely.
|