This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ZEngine definition not found

Hi,

I'm trying to implement znp-bringup.zjs in C#. I gave reference to TI.ZPI.dll in my program. Definition for every thing except ZEngine are found.

Can you please give path to definition of ZEngine.

BR

Srikanth

  • Not sure if you can do this from C#. I suggest you to contact TI local representative to sign SLA and see if you can get source code of ZTool.
  • Hi,

    I made following changes in the script in my C# program:

    ZPort portArray ; 

    ps[0] = new PortSettings("COM11", true);
    portArray = new ZPort(ps[0]);


    MessageAvailHandle = new ZPort.MsgAvailEventHandler(this.MessageHandler1);
    portArray.AddOnMsgAvail(MessageAvailHandle);

    private void MessageHandler1(ZPort zp, MsgAvailEventArgs msg)
    {
    msgHandler(zp.Name, (MESSAGE_ID)msg.ID1, msg.Message);
    }

    Similarly, I changed ZEngine.Send to 

    portArray.SendMsg(req);

    1. But I'm not receiving any events in  MessageHandler1. Any reasons why it is not working?

    2. Also, what are the advantages of implementing ZNP. Currently, the only drawback I'm experiencing in the normal approach are:

             a. While sending messages to the coordinator over COM port, I need to wait for the previous message to go over the air, before writing another message to the port.

             b. When the coordinator receives messages from multiple sources at the same time, the messages are getting mixed up and I need to  separate them in my program.

    But, even in ZNP script whenever, ZEngine.Send is called, immediately ZEngine.Pause is called to create a delay and send message coordination is not automatically taken care even in ZNP. So, what are the other advantages to prefer ZNP over normal approach? 

    BR

    Srikanth

  • ZTool is just a PC example that shows you MT commands communications and I don't think it is suitable to be used as ZAP. I would suggest you to refer to Portable ZigBee Plug-In Software Framework for any OS at www.ti.com/.../TIDC-ZNP-HOST-SW3. For the advantage of ZNP, it would be that you can use any your familiar MCU to run ZAP instead of running application on the same unfamiliar MCU of ZNP. Besides, you don't have to buy IAR license when you use ZNP.
  • Hi,

    Even in Zigbee Plug-In Framework, whenever a message is sent, it is followed by a wait as:
    afDataRequest(&DataRequest);
    rpcWaitMqClientMsg(500);
    Why is it not taken care by some handshake mechanism? What if the message size is big and it is not transmitted within 0.5 seconds?

    BR
    Srikanth
  • After you send SREQ: AF_DATA_REQUEST, you would get SRSP command back. Isn't this handshake mechanism?
  • Hi,

    But, why to add the delay immedately after sending afdatarequest.
    I'm yet to run the framework. I will get back with my observations.

    BR
    Srikanth

  • You can try to shorten the delay to see if it has impact.
  • Hey!

    So I'm looking at doing something similar right now and I'm having issues with not having ZEngine in C# as well. Did you end up finding a solution that works around it? Also what is the ZPort that you are referring to in your post here?

    Thanks,
    KD
  • I suggest you to contact TI local representative to sign SLA and see if you can get source code of ZTool.
  • Hi, I tried by translating selective portions of the example script into c#. But I couldn't get the events working. So, I switched to znp host framework. It is working on both Linux and cygwin on Windows. To integrate with c# app, you need to compile it as a Windows application may be with visual studio. This may be easier than ztool.
  • Thanks! 

    I'll take a look at the znp host framework. Is there any where in particular you started with or a resource that you found helpful?

    Cheers,

    KD

  • There are some 4 examples provided by ti. I started with dataSendRcv. In the initial stage you can just ensure that devices are joining the network before making suitable modifications to suit your requirement.