24 #ifndef __XBEE_PLATFORM 25 #define __XBEE_PLATFORM 37 #if defined(__cplusplus) 38 #define XBEE_BEGIN_DECLS extern "C" { 39 #define XBEE_END_DECLS } 41 #define XBEE_BEGIN_DECLS 42 #define XBEE_END_DECLS 118 #define EBADMSG 20010 121 #define ENOTSUP 20011 124 #define ETIMEDOUT 20012 139 #define ECANCELED 20017 142 #define EMSGSIZE 20018 338 #define ZCL_TIME_EPOCH_DELTA_1980 ((UINT32_C(20) * 365 + 5) * 24 * 60 * 60) 344 #define ZCL_TIME_EPOCH_DELTA_1970 ((UINT32_C(30) * 365 + 7) * 24 * 60 * 60) 346 #ifdef XBEE_PLATFORM_HEADER 347 #include XBEE_PLATFORM_HEADER 349 #include "../ports/rabbit/platform_config.h" 351 #include "../ports/posix/platform_config.h" 352 #elif defined __DOS__ 356 #include "../ports/dos/platform_config.h" 357 #elif defined WIN32 || defined _WIN32 || defined _WIN32_ || defined __WIN32__ \ 358 || defined __CYGWIN32__ || defined MINGW32 359 #include "../ports/win32/platform_config.h" 360 #elif defined __MWERKS__ && defined __HC08__ 361 #include "../ports/hcs08/platform_config.h" 363 #error "Unknown target" 373 #ifndef PACKED_STRUCT 374 #define PACKED_STRUCT struct 377 #define XBEE_PACKED(name, decl) PACKED_STRUCT name decl 381 #ifndef xbee_get_unaligned16 382 #define xbee_get_unaligned16( p) (*(uint16_t FAR *)(p)) 384 #ifndef xbee_get_unaligned32 385 #define xbee_get_unaligned32( p) (*(uint32_t FAR *)(p)) 387 #ifndef xbee_set_unaligned16 388 #define xbee_set_unaligned16( p, v) *(uint16_t FAR *)(p) = (v) 390 #ifndef xbee_set_unaligned32 391 #define xbee_set_unaligned32( p, v) *(uint32_t FAR *)(p) = (v) 399 #ifndef CAST_FAR_TO_NEAR 400 #define CAST_FAR_TO_NEAR(p) (p) 402 #ifndef INTERRUPT_ENABLE 403 #define INTERRUPT_ENABLE 406 #ifndef INTERRUPT_DISABLE 407 #define INTERRUPT_DISABLE 410 #if defined(XBEE_WIFI_ENABLE) || defined(XBEE_WIFI_DISABLE) 411 #error "The XBEE_WIFI_ENABLE and XBEE_WIFI_DISABLE macros " \ 412 "are deprecated. Please use XBEE_WIFI_ENABLED instead." 416 #ifndef XBEE_SERIAL_MAX_BAUDRATE 417 #define XBEE_SERIAL_MAX_BAUDRATE 115200 424 #ifndef XBEE_UNUSED_PARAMETER 425 #define XBEE_UNUSED_PARAMETER(p) (void) p 463 #ifndef XBEE_RESET_FN 464 #define XBEE_RESET_FN NULL 466 #ifndef XBEE_IS_AWAKE_FN 467 #define XBEE_IS_AWAKE_FN NULL 471 #define _TABLE_ENTRIES(array) ((sizeof (array)) / (sizeof (*array))) 578 #define HEX_DUMP_FLAG_NONE 0x0000 580 #define HEX_DUMP_FLAG_OFFSET 0x0001 582 #define HEX_DUMP_FLAG_ADDRESS 0x0002 584 #define HEX_DUMP_FLAG_TAB 0x0004 604 int memcheck(
const void FAR *src,
int c,
size_t length);
629 #define XBEE_TIMER_COMPARE( a, op, b) \ 630 ( ((int16_t)((uint16_t)(a) - (uint16_t)(b))) op 0 ) 661 #define XBEE_SET_TIMEOUT_MS(delay) \ 662 ((uint16_t)xbee_millisecond_timer() + (delay)) 677 #define XBEE_CHECK_TIMEOUT_MS(timer) \ 678 ((int16_t)((uint16_t)xbee_millisecond_timer() - (timer)) >= 0) 710 #define XBEE_SET_TIMEOUT_SEC(delay) ((uint16_t)xbee_seconds_timer() + (delay)) 725 #define XBEE_CHECK_TIMEOUT_SEC(timer) \ 726 ((int16_t)((uint16_t)xbee_seconds_timer() - (timer)) >= 0) 729 #include "xbee/jslong_glue.h" unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
#define FAR
On platforms with "far" pointers, define to the proper keyword; empty definition if not required...
Definition: platform.h:396
void hex_dump(const void FAR *address, uint16_t length, uint16_t flags)
Helper function for printing a hex dump of memory to stdout.
Definition: hexdump.c:28
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...
Definition: xbee_readline.c:92
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
int hexstrtobyte(const char FAR *p)
Converts two hex characters (0-9A-Fa-f) to a byte.
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
uint32_t() xbee_millisecond_timer(void)
Platform-specific function to return the number of elapsed milliseconds.
Definition: xbee_platform_digiapix.c:45
uint32_t() xbee_seconds_timer(void)
Platform-specific function to return the number of elapsed seconds.
Definition: xbee_platform_digiapix.c:37
int memcheck(const void FAR *src, int c, size_t length)
Test whether a block of memory is set to a single byte value.
Definition: memcheck.c:21