Home/Support/Support Forum/wpan_envelope_t

wpan_envelope_t

0 votes
Hello,
I have a prototype board assembled with the programmable S2C module installed. The sample applications in CodeWarrior work fine, the one in particular I'm referring to is transmit_basic_frames.

When I try to get similar functionality into a new project, meaning not using the sample project, I get a undefined type error:
../Sources\main.c:125:error:C1815 wpan_envelope_t not declared (or typename)

I create a new application targeting the S2C solder-down module, add Xbee and Zigbee to the config.xml add the includes I see in the sample and then try to create an envelope. Compiling results in the error. I guess there's a library I'm not linking or an include path not referenced but I can't seem to find it.

Any ideas?

Full main.c:

#include <xbee_config.h>
#include <types.h>

#include <string.h>
#include <wpan/aps.h>
#include <xbee/transparent_serial.h>
#include <xbee/atcmd.h>

#ifdef ENABLE_XBEE_HANDLE_MODEM_STATUS_FRAMES
int xbee_modem_status_handler(xbee_dev_t *xbee, const void FAR *payload,
uint16_t length, void FAR *context)
{
/* Add your code here... */
return 0;
}
#endif

#ifdef ENABLE_XBEE_HANDLE_TX_STATUS_FRAMES
int xbee_transmit_status_handler(xbee_dev_t *xbee, const void FAR *payload,
uint16_t length, void FAR *context)
{
/* Add your code here... */
return 0;
}
#endif

#ifdef ENABLE_XBEE_HANDLE_RX
int xbee_transparent_rx(const wpan_envelope_t FAR *envelope, void FAR *context)
{
/* Add your code here... */

return 0;
}
#endif

void main(void)
{
sys_hw_init();
sys_xbee_init();
sys_app_banner();

wpan_envelope_t env; // <<<<< Error here, undefined type
char txbuf[30];
uint16_t msgcnt = 1;
wpan_envelope_create(&env, &xdev.wpan_dev, WPAN_IEEE_ADDR_COORDINATOR, WPAN_NET_ADDR_UNDEFINED);

for (;;) {
/* Write your code here... */
sys_watchdog_reset();
sys_xbee_tick();
}
}
asked Dec 13, 2016 in XBee Programmable Development by nwgarner New to the Community (2 points)

Please log in or register to answer this question.

2 Answers

0 votes
#include <xbee_config.h>
#include <types.h>

#include <stdio.h>

#include <xbee/discovery.h>
#include <xbee/transparent_serial.h>
#include <_nodetable.h>
#include <xbee/byteorder.h>
#include <xbee/atcmd.h>
answered Dec 14, 2016 by mvut Veteran of the Digi Community (15,223 points)
Hi Mvut,
I added another answer that should hopefully show up soon.  The only thing I had to do to fix the problem was move the variable declaration.  Didn't need to change any includes.

Nick
0 votes
I forgot to come back here and answer my question as it was still in moderation when I fixed it.

The only thing I did to fix the issue was move the env variable declaration above the init() functions.

void main(void)
{
wpan_envelope_t env; // <<<<< moved here, error went away
char txbuf[30];
uint16_t msgcnt = 1;

sys_hw_init();
sys_xbee_init();
sys_app_banner();

wpan_envelope_create(&env, &xdev.wpan_dev, WPAN_IEEE_ADDR_COORDINATOR, WPAN_NET_ADDR_UNDEFINED);
answered Dec 16, 2016 by nwgarner New to the Community (2 points)
...