File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -55,5 +55,19 @@ void loop() {
5555 client.notify (" blink" );
5656 Serial.println (" Sent a blink notification" );
5757
58+ int duration_ms = 100 ;
59+ client.notify (" blink" , duration_ms);
60+ Serial.println (" Sent a 100ms blink notification" );
61+
62+ MsgPack::object::nil_t out;
63+ ok = client.call (" blink" , out);
64+ Serial.print (" Sent a blink RPC -> " );
65+
66+ if (ok) {
67+ Serial.println (" Server returns without issues" );
68+ } else {
69+ Serial.println (" Server could not handle a notification as a call" );
70+ }
71+
5872 delay (2000 );
5973}
Original file line number Diff line number Diff line change @@ -15,11 +15,14 @@ def divide(a, b):
1515 print ("0 denominator: this will raise an exception" )
1616 return a / b
1717
18- def blink ():
18+ def blink (duration = None ):
1919 """
20- Used for notification
20+ Used for notification w/o parameter. Use also for testing calls returning None
2121 """
22- print ("Blink maybe" )
22+ if duration is not None :
23+ print (f"Blink for { duration } " )
24+ else :
25+ print ("Blink maybe" )
2326
2427def get_rand ():
2528 """
You can’t perform that action at this time.
0 commit comments