how can I use the serial(UART) in the Zboss?which function should I call? thank you

11 years ago
  •  ma haichao

how can I use the serial(UART) in the Zboss?which function should I call? thank you.

 

Replies (4)

RE: how can I use the serial(UART) in the Zboss?which function should I call? thank you

do you mean the preprocessor symbols?my project is as the following:

 

ZB_PLATFORM_8051_SIM

 

ZB_CC25XX

 

ZB_IAR

 

ZB_SECURITY

 

xZB_ED_ROLE

 

ZB_COORDINATOR_ROLE

 

xZB_TRACE_LEVEL=5

 

xZB_TRACE_MASK=-1

 

xZB_TRAFFIC_DUMP_ON

 

RE: how can I use the serial(UART) in the Zboss?which function should I call? thank you

There is know need to include zb_8051_serial.h directly. All the transport routines are already in zb_g_context. Please, send me the set of preprocessor directives of your project.

 

RE: how can I use the serial(UART) in the Zboss?which function should I call? thank you

I have done just like the following in the zdo_start_zc.c:

 

zb_init_8051_serial();

 

zb_8051_serial_put_bytes((zb_uint8_t *)&ptr, sizeof(ptr));

 

and I have include the zb_8051_serial.h.

 

but it occured the following error:

 

Error[e46]: Undefined external "zb_init_8051_serial::?relay" referred in zdo_start_zc ( F:\download\ZBOSS_v1.0_src\out\Zboss-CC25XX-Debug\Obj\zdo_start_zc.r51 )

 

Error[e46]: Undefined external "zb_8051_serial_put_bytes::?relay" referred in zdo_start_zc ( F:\download\ZBOSS_v1.0_src\out\Zboss-CC25XX-Debug\Obj\zdo_start_zc.r51 )

 

what's the problem?

 

RE: how can I use the serial(UART) in the Zboss?which function should I call? thank you

Hello,

 

Possibly, you're looking for

 

void zb_8051_serial_put_bytes(zb_uint8_t *buf, zb_short_t len)

 

zb_ushort_t zb_8051_serial_get_bytes(zb_uint8_t *buf, zb_ushort_t size)

 

See stack/osif/8051/zb_8051_serial.c

 

Also don't forget to initialize uart before using it. Call

 

void zb_init_8051_serial()

 

See stack/osif/8051/zb_8051_serial_init.c