Digi XBee(R) ANSI C Host Library
user_data.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 Digi International Inc.,
3  * All rights not expressly granted are reserved.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
7  * You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343
10  * ===========================================================================
11  */
12 
20 #ifndef XBEE_USER_DATA_H
21 #define XBEE_USER_DATA_H
22 
23 #include "xbee/platform.h"
24 #include "xbee/device.h"
25 
27 
29 #define XBEE_FRAME_USER_DATA_TX 0x2D
30 
32 #define XBEE_FRAME_USER_DATA_RX 0xAD
33 
34 // Interface identifiers used with USER_DATA_TX and USER_DATA_RX frames.
35 #define XBEE_USER_DATA_IF_SERIAL 0x00
36 #define XBEE_USER_DATA_IF_BLE 0x01
37 #define XBEE_USER_DATA_IF_MICROPYTHON 0x02
38 
39 typedef XBEE_PACKED(xbee_header_user_data_tx_t, {
42  uint8_t frame_type;
43  uint8_t frame_id;
44  uint8_t destination;
46 
49 typedef XBEE_PACKED(xbee_frame_user_data_rx_t, {
50  uint8_t frame_type;
51  uint8_t source;
52  uint8_t payload[1];
54 
55 // See src/xbee/xbee_user_data.c for function documentation.
56 
58  const void *payload, uint16_t length);
59 
60 const char *xbee_user_data_interface(uint8_t iface);
61 
63 
64 #endif // XBEE_USER_DATA_H
65 
int xbee_user_data_relay_tx(xbee_dev_t *xbee, uint8_t dest, const void *payload, uint16_t length)
Send a User Data Relay frame (XBEE_FRAME_USER_DATA_TX, type 0x2D).
Definition: xbee_user_data.c:37
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
Common header for Hardware Abstraction Layer.
const char * xbee_user_data_interface(uint8_t iface)
Return a string description for an XBEE_USER_DATA_IF_xxx value.
Definition: xbee_user_data.c:62
Format of XBee API frame type 0xAD (XBEE_FRAME_USER_DATA_RX); received from XBee by host...
Definition: user_data.h:53
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
Header of XBee API frame type 0x2D (XBEE_FRAME_USER_DATA_TX); sent from host to XBee.
Definition: user_data.h:45
Definition: device.h:361
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42