Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cf-dev] Hooking into the acknowledgement of a observe notification

Hi Carles,

Try to checkout the branch “notify_ack_handler” or see

https://github.com/eclipse/californium/tree/notify_ack_handler

The solution uses a MessageObserverAdapter for the response, which callsback the onAcknowledgement when receiving the ACK for the notify.

Mit freundlichen Grüßen / Best regards 

Achim Kraus

(INST/ECS4) 
Bosch Software Innovations GmbH | Stuttgarter Straße 130 | 71332 Waiblingen | GERMANY | http://www.bosch-si.com 

Sitz: Berlin, Registergericht: Amtsgericht Charlottenburg; HRB 148411 B
Aufsichtsratsvorsitzender: Dr.-Ing. Thorsten Lücke; Geschäftsführung: Dr. Stefan Ferber, Michael Hahn



From: cf-dev-bounces@xxxxxxxxxxx [mailto:cf-dev-bounces@xxxxxxxxxxx] On Behalf Of Carles
Sent: Montag, 22. Januar 2018 18:58
To: cf-dev@xxxxxxxxxxx
Subject: [cf-dev] Hooking into the acknowledgement of a observe notification

Hi

I'm implementing a resource endpoint based on the Observe example at

https://github.com/eclipse/californium/blob/master/demo-apps/cf-plugtest-server/src/main/java/org/eclipse/californium/plugtests/resources/Observe.java

Following that this example sets 

setObserveType(Type.CON);

i would expect notifications on resource changes to be acknowledged once the client has received them. The problem is that i cannot manage to understand if it's possible to hook into that acknoledgment in the server, so i can plug in my code once the server receives that acknowledgment.

Digging into the core code i suspect that  public void onAcknowledgement at

https://github.com/eclipse/californium/blob/8f6b7f00a461ed249a0997d13cced19e050c46c3/californium-core/src/main/java/org/eclipse/californium/core/network/stack/ObserveLayer.java#L192

has something to to with it, but i cannot find any example or test that shows me how to hook into that.

First time developing Javahere, so apologise if not using the right words, or asking something that is a Java question instead of a Californium question. Any answer will be apreaciated!

Thank you

Back to the top