Digi XBee(R) ANSI C Host Library
Macros | Functions | Variables
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "xbee/platform.h"
#include "xbee/atcmd.h"
#include "xbee/byteorder.h"
#include "xbee/io.h"

Functions

int xbee_io_response_parse (xbee_io_t FAR *parsed, const void FAR *source)
 Parse an I/O response and store it in an xbee_io_t structure. More...
 
char * _xbee_mask_to_binary (char *buf, uint16_t mask, char *digits, int maxbit)
 
char * _xbee_2masks_to_quaternary (char *buf, uint16_t mask_lo, uint16_t mask_hi, char *digits, int maxbit)
 
void xbee_io_response_dump (const xbee_io_t FAR *io)
 Debugging function used to dump an xbee_io_t structure to stdout. More...
 
int xbee_io_get_digital_input (const xbee_io_t FAR *io, uint_fast8_t index)
 Return state of a digital input. More...
 
int xbee_io_get_digital_output (const xbee_io_t FAR *io, uint_fast8_t index)
 Return state of a digital output. More...
 
int16_t xbee_io_get_analog_input (const xbee_io_t FAR *io, uint_fast8_t index)
 Return reading of an analog input. More...
 
int xbee_io_set_digital_output (xbee_dev_t *xbee, xbee_io_t FAR *io, uint_fast8_t index, enum xbee_io_digital_output_state state, const wpan_address_t FAR *address)
 Set state of a digital output. More...
 
int xbee_io_configure (xbee_dev_t *xbee, xbee_io_t FAR *io, uint_fast8_t index, enum xbee_io_type type, const wpan_address_t FAR *address)
 Configure XBee digital and analog I/Os. More...
 
int xbee_io_set_options (xbee_dev_t *xbee, xbee_io_t FAR *io, uint16_t sample_rate, uint16_t change_mask, const wpan_address_t FAR *address)
 Configure XBee automatic I/O sampling options. More...
 
void _xbee_io_query_handle_pr (const xbee_cmd_response_t FAR *response, const struct xbee_atcmd_reg_t FAR *reg, void FAR *base)
 
void _xbee_io_query_handle_end (const xbee_cmd_response_t FAR *response, const struct xbee_atcmd_reg_t FAR *reg, void FAR *base)
 
int xbee_io_query (xbee_dev_t *xbee, xbee_io_t FAR *io, const wpan_address_t FAR *address)
 
int xbee_io_query_status (xbee_io_t FAR *io)
 Check the status of querying an XBee device, as initiated by xbee_io_query(). More...
 

Variables

const FAR xbee_at_cmd_t xbee_io_cmd_by_index [16]
 
const uint16_t _xbee_pullup_atcmd_to_iomask [16]
 Read current configuration of XBee digital and analog I/Os. More...
 
const xbee_atcmd_reg_t _xbee_io_query_regs []
 

Detailed Description

Note
This code is not directly concerned with collecting I/O samples. To do that, it is necessary to register a command handler for ATIS commands, and/or appropriate endpoints to handle the incoming data frames. If not using the Simple XBee API (SXA) layer, then see xbee_sxa.c for examples of how to register the necessary callback functions. Otherwise, it is recommended to use SXA for all I/O manipulation.