22 #if !defined(ZB_SERIAL_H)
25 #if defined(__cplusplus)
128 int zb_encode(uint8_t *destination, uint8_t device_number,
129 uint8_t command_number, int32_t data);
152 int zb_decode(int32_t *destination,
const uint8_t *reply);
210 #if defined(__cplusplus)
int zb_drain(z_port port)
Flushes all input received but not yet read, and attempts to drain all input that would be incoming...
int zb_disconnect(z_port port)
Gracefully closes a connection.
int zb_set_timeout(z_port port, int milliseconds)
Change the duration zb_receive() will wait before timing out and returning without having read anythi...
int zb_send(z_port port, const uint8_t *command)
Sends a command to a serial port.
int zb_connect(z_port *port, const char *port_name)
Connect to a serial port specified by port_name.
int zb_encode(uint8_t *destination, uint8_t device_number, uint8_t command_number, int32_t data)
Encodes a command according to Zaber's Binary Protocol Manual.
Defines a few things that all of the serial API has in common.
void zb_set_verbose(int value)
Sets whether errors and extra info are reported to stderr.
int zb_receive(z_port port, uint8_t *destination)
Receives a message from the serial port.
int zb_decode(int32_t *destination, const uint8_t *reply)
Decodes the last 4 bytes of a 6-byte (complete) reply.
HANDLE z_port
A type to represent a port connected to one or more Zaber devices.
Definition: z_common.h:31