XBee Firmware Library
1.6.0
|
Modules | |
DOS16/OpenWatcom | |
Freescale/Codewarrior (Programmable XBee) | |
Rabbit/Dynamic C | |
Win32/cygwin/gcc | |
Files | |
file | platform.h |
Functions | |
void | hex_dump (const void FAR *address, uint16_t length, uint16_t flags) |
int | hexstrtobyte (const char FAR *p) |
Converts two hex characters (0-9A-Fa-f) to a byte. More... | |
int | memcheck (const void FAR *src, int c, size_t length) |
Test whether a block of memory is set to a single byte value. More... | |
uint32_t() | xbee_millisecond_timer (void) |
Platform-specific function to return the number of elapsed milliseconds. More... | |
int | xbee_readline (char *buffer, int length) |
This function is a non-blocking version of gets(), used to read a line of input from the user. More... | |
XBEE_BEGIN_DECLS uint32_t() | xbee_seconds_timer (void) |
Platform-specific function to return the number of elapsed seconds. More... | |
typedef struct xbee_serial_t | xbee_serial_t |
platform_stdint | |
Types typically defined in <stdint.h>, define manually if stdint.h is not available on this platform. | |
typedef signed char | int8_t |
A signed char variable 8 bits. More... | |
typedef unsigned char | uint8_t |
A unsigned char variable 8 bits. More... | |
typedef int | int16_t |
A signed integer variable 16 bits. More... | |
typedef unsigned int | uint16_t |
An unsigned integer variable 16 bits. More... | |
typedef long | int32_t |
A signed long variable 32 bits. More... | |
typedef unsigned long | uint32_t |
An unsigned long variable 32 bit. More... | |
A signed integer variable 16 bits.
16-bit signed integer
A signed long variable 32 bits.
32-bit signed integer
A signed char variable 8 bits.
8-bit signed integer
An unsigned integer variable 16 bits.
16-bit unsigned integer
An unsigned long variable 32 bit.
32-bit unsigned integer
_xbee_device_debug uint8_t |
A unsigned char variable 8 bits.
8-bit unsigned integer
Must be a structure with uint32_t member baudrate
and any additional members required by the functions in xbee/serial.h.
Helper function for printing a hex dump of memory to stdout. A reference implementation is provided in as util/hexdump.c. Dumps data in hex/printable format, 16 bytes to a line, to stdout.
[in] | address | Address of data to dump. |
[in] | length | Number of bytes to dump. |
[in] | flags | One of
|
int hexstrtobyte | ( | const char FAR * | p | ) |
Converts two hex characters (0-9A-Fa-f) to a byte.
[in] | p | String of hex characters to convert. |
-1 | Error (invalid character or string less than 2 bytes). |
0-255 | The byte represented by the first two characters of p. |
int memcheck | ( | const void FAR * | src, |
int | c, | ||
size_t | length | ||
) |
Test whether a block of memory is set to a single byte value.
[in] | src | starting address |
[in] | c | value to compare each byte to |
[in] | length | number of bytes to compare |
0 | length bytes from src are set to c |
<0 | length bytes from src would sort before length bytes of c |
>0 | length bytes from src would sort before length bytes of c |
uint32_t() xbee_millisecond_timer | ( | void | ) |
Platform-specific function to return the number of elapsed milliseconds.
OK for this counter to rollover. Used for timing and should have a resolution of at least 60ms.
(Function name wrapped in parentheses so platforms can use a macro function of the same name.)
int xbee_readline | ( | char * | buffer, |
int | length | ||
) |
This function is a non-blocking version of gets(), used to read a line of input from the user.
It waits for a string from stdin terminated by a return. It should be called repeatedly, until it returns a value other than -EAGAIN. The input string, stored in buffer is null-terminated without the return.
The user should make sure only one process calls this function at a time.
[in,out] | buffer | buffer to store input from user |
[in] | length | size of buffer |
>=0 | User ended the input with a newline, return value is number of bytes written. |
-EAGAIN | User has not completed a line. |
-EINVAL | NULL buffer or length is less than 1. |
XBEE_BEGIN_DECLS uint32_t() xbee_seconds_timer | ( | void | ) |
Platform-specific function to return the number of elapsed seconds.
On some platforms, this is the equivalent of an "uptime".
On other platforms, it may reflect the value of the RTC, which might not be synchronized with a time server and might include leap seconds.
Regardless, it should consistently report elapsed time and not jump on clock synchronization.
In addition to determining timeouts, the ZCL Time Cluster makes use of it to report current time.
(Function name wrapped in parentheses so platforms can use a macro function of the same name.)