AnsweredAssumed Answered

Send/receive message to Host PC

Question asked by Min Gwak on Mar 18, 2015
Latest reply on Mar 31, 2015 by Ole Hattebol
Branched from an earlier discussion

Thanks for reply.

Wow. That is not easy to do. I think, using ZTC isn't good idea for my application.

I think should better use UART directly.

Actually what I want to do...

I'd like to send message from coordinator to host PC though UART (using UART2USB) when I rotate the potentiometer of ZED.

(The dimmer switch(ZED) has a potentiometer for changing battery voltage level. )


so far, my understanding is...

(On EndDevice)

The 'BeeApp.c' has BatteryVoltageCallback() handler and it treat potentiometer value.

And the value set to the attribute of 'ZCL_Power'

After than,I think, BeeStack will send this value to coordinator.


(On Coordinator)

main() create Application Task call 'BeeAppTask(event)'

BeeAppTask() jump to event handler when it got the event.

I think the 'BeeAppDataIndication()' handler treat main message in/out. and It calls ZCL_InterpretFrame().

I look up the ZCL_interpretFrame() and it looks like a general treatment of payloads. I cannot found the 'BatteryVoltage'(ZCL_Power) treatment section.

If I found the BatteryVoltage treat handler, I should write the UART code on that. right?


Question 1. Could you help to found the BatteryVoltage treat handler?


One other Questions (on Coordinator)

I show BeeAppHandlerKeys() method that handle key(sw1 or sw2) event.

but it only call by BeeAppInit() that call at the first initialize of main().

Question 2. How it can treat run time of key input (key pushed by ED and send to Coordinator) ?


Question 3. If you can, Could you draw (or describe) the message flowing?


Get message from air -> ?? ->

create 'gKBD_EventSW1_c' and call BeeAppHandleKeys [at ??] ->

call DimmableLight_AppMove() if got 'gKBD_EventSW1_c' [at BeeAppHandleKeys(), BeeApp.c]  ->

call ASL_ZclLevelControlReq() [at DimmableLight_AppMove(),BeeApp.c] -> Create ZCL_frame -> what will be next??



Question 4. On the code, how it identify the device type(coordinator, router or end-device) itself?