Menu

question about the protocol listener

Yolan
2013-03-11
2013-03-13
  • Yolan

    Yolan - 2013-03-11

    Hi,

    I can't manage to receive message responses.
    My listener receives broadcast requests responses only.
    Do I need to use a spyListener ?

    Is there an example in C# ?

    Thanks for reading

     
  • Thierry CHOMAUD

    Thierry CHOMAUD - 2013-03-11

    Hello,
    What do you mean by message response. A response to a request, or a spontaneous message reception?

     
  • Yolan

    Yolan - 2013-03-12

    I mean a spontaneous message reception.
    The aim is to receive alerts sent by the Waveflow.

    I'm assuming that if I send a message with SendApplicationMessage(), the listener should receive the response.
    Instead, he receives only if I use SendApplicationBroadcastRequest().

     
  • Thierry CHOMAUD

    Thierry CHOMAUD - 2013-03-12

    To listen for spontaneous message reception you have to create your implementation of IProtocolListener and to add this listener to your protocol instance by using the service "AddMessageListener".

    The listener method "ReceiveRadioExchangeCommand(RadioExchangeCommand receiveCommand)" will be called when a spontaneous message is received.

    If you use the "sendApplicationMessage", your radio modem will not wait for a response, and because the waveflow reply with a radio response mode, your radio modem will not receive the response. So your listener will not be notified of this radio message.

    To sum up:
    -> To receive a response you have to use the protocol service "sendApplicationRequest".
    -> To receive a spontenous message, you have to implement your "IProtocolListener" and to be sure that the message we wait for is send by the radio device as a "message". This is the case of Waveflow alarms.

    If you have got 2 waveports with you, I can write an example for you that will send a message from waveport1 and will show how to receive it with Waveport2?

     
  • Yolan

    Yolan - 2013-03-13

    Ok, I thought the listener could receive the response from a sendApplicationMessage().

    I only got one Waveport but I think I understand now.

    Thanks for the help !

     
  • Thierry CHOMAUD

    Thierry CHOMAUD - 2013-03-13

    Just to give you some more explanation on Wavenis response process:
    -> in the case of using SDK method "sendApplicationMessage", this is not the SDK that doesn't return the response as a spontaneous receive message, but this is the Radio modem that doesn't catch the radio response.
    -> Wavenis product listen the radio activity only during a short time every 1sec. This is call the wakeup length and it is an important feature of Wavenis protocol to be low power. It means that to request a product, you need to launch a radio preambule with a period superior to 1sec (1.1sec by default), just to be sure that the destination node will catch your request.
    -> To save energy (because launching a radio preambule during 1.1 sec is very consumer), a response is made with a short wakeup (0.1 sec by default). In the case of a request, the product that wait for the response, listens radio activity only during this time.
    -> In your case (send of message), the Waveflow make a response with a short wakeup (0,1sec), but because your Waveport doesn't wait for a response, there is an important probability that it receives the response during its sleep time (1sec), and as a consequence, that it doesn't detect the response.

    Don't hesitate to come back if you have got other problems in the use of SDK.
    Thierry

     

Log in to post a comment.

MongoDB Logo MongoDB