User Tools

Site Tools


realvnc:cdbsbp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
realvnc:cdbsbp [2012/10/23 16:58]
andy created
realvnc:cdbsbp [2012/11/09 13:15]
andy
Line 1: Line 1:
 ====== CDB/SBP Implementation ====== ====== CDB/SBP Implementation ======
  
-The **SBP sink** should obey the following operation:+The following diagram outlines the operation of the **SBP Sink**:
  
 <​graphviz dot> <​graphviz dot>
 digraph G { digraph G {
-  graph [dpi=60]; +  graph [dpi=48]; 
-  node [shape=circle];​ +  node [shape=circle ​margin="​0.1,​0.05"​]; 
-  "​Idle";​ +  ​idle [label="​Idle"​]; 
-  ​sent_get ​[label="​GET\nsent"]; +   
-  node [shape=box style=rounded];​ +  node [shape=diamond margin="​0.05,​0.05"​]
-  "Idle" ​-> "Validate GET message"​ [label="​sendGet()"]; +  ​check_valid ​[label="​Message\nvalid?"]; 
-  "Validate GET message"​ -> "Return error from sendGet()"; +  check_pending [label="​Same type\nalready pending?"​];​ 
-  "Return error from sendGet()" -> "Idle"; +  check_active_timer [label="​Timer already active?"​];​ 
-  "Validate GET message" -> "Queue GET message"; +  check_timers [label="​Are there messages timed out?"​];​ 
-  "Queue GET message" -> sent_get+  check_rx_pending [label="​Request\npending?"​];​ 
-  "Queue GET message" -> "Return error from sendGet()";+   
 +  node [shape=parallelogram margin="​0.0"​];​ 
 +  send_call [label="​API call to send message"​];​ 
 +  timeout [label="​Timer expires"​];​ 
 +  response [label="​Receive command response"​];​ 
 + 
 +  node [shape=box style=rounded ​margin="​0.1,​0.05"​]; 
 +  ​return_error [label="Return error from API"]; 
 +  return_success [label="​Return success from API"​];​ 
 +  queue_message [label="Pass message ​to CDB thread"]; 
 +  mark_queued ​[label="​Record type as pending"]; 
 +  ​set_timer [label="​Initiate 5 second timer"​];​ 
 +  reset_timer [label="​Reset timer to next timeout, if any"​];​ 
 +  cancel_pending [label="Cancel pending ​message"​]; 
 +  timeout_callback [label="​Call client callback to inform app"​];​ 
 +  response_callback [label="​Pass response to client callback"​];​ 
 + 
 +  idle -> send_call -> check_valid;​ 
 +  check_valid -> return_error [label="no"]
 +  ​check_valid -> check_pending [label="yes"]; 
 +  return_error ​-> idle; 
 +  check_pending -> return_error [label="yes"]
 +  ​check_pending -> queue_message [label="no"]; 
 +  queue_message ​-> mark_queued -> check_active_timer;​ 
 +  check_active_timer -> set_timer [label="no"]
 +  ​check_active_timer -> return_success [label="yes"]; 
 +  set_timer ​-> return_success -> idle; 
 + 
 +  ​idle -> timeout -> check_timers;​ 
 +  check_timers -> reset_timer [label="no"]; 
 +  check_timers ​-> timeout_callback [label="yes"]; 
 +  timeout_callback -> reset_timer -> cancel_pending -> idle; 
 +   
 +  idle -> response -> check_rx_pending;​ 
 +  check_rx_pending -> idle [label="​no"​];​ 
 +  check_rx_pending -> response_callback [label="​yes"​];​ 
 +  response_callback -> cancel_pending;
 } }
 </​graphviz>​ </​graphviz>​
  
 +===== CDB Endpoint =====
 +
 +This sequence diagram indicates the calls performed by the source and sink during a standard CDB-level endpoint exchange:
 +
 +<​graphviz>​
 +digraph sequence {
 +  graph [dpi=60];
 +  node [shape=box];​
 +  {rank=same; "​Source";​ "​Sink";​ "​SDK";​}
 +  node [shape=point];​
 +  "​Source"​ -> "​src_2"​ [arrowhead=none];​
 +  "​SDK"​ -> "​dst_2"​ [arrowhead=none];​
 +  {rank=same; "​src_2"​ -> "​dst_2"​ [label="​VNCCDBSDKInitialize()"​];​}
 +  "​src_2"​ -> "​src_3"​ [arrowhead=none];​
 +  "​dst_2"​ -> "​dst_3"​ [arrowhead=none];​
 +  {rank=same; "​src_3"​ -> "​dst_3"​ [label="​VNCCDBEndpointCreate()"​];​}
 +  "​src_3"​ -> "​src_4"​ [arrowhead=none];​
 +  "​dst_3"​ -> "​dst_4"​ [arrowhead=none];​
 +  {rank=same; "​src_4"​ -> "​dst_4"​ [label="​VNCCDBEndpointAddLicense()"​];​}
 +  "​src_4"​ -> "​src_5"​ [arrowhead=none];​
 +  "​dst_4"​ -> "​dst_5"​ [arrowhead=none];​
 +  {rank=same; "​src_5"​ -> "​dst_5"​ [label="​VNCCDBEndpointAddCDBSource()"​];​}
 +  "​src_5"​ -> "​src_6"​ [arrowhead=none];​
 +  "​dst_5"​ -> "​dst_6"​ [arrowhead=none];​
 +  {rank=same; "​src_6"​ -> "​dst_6"​ [label="​VNCCDBEndpointStart()"​];​}
 +  "​Sink"​ -> "​src_8"​ [arrowhead=none];​
 +  "​dst_6"​ -> "​dst_8"​ [arrowhead=none];​
 +  {rank=same; "​dst_8"​ -> "​src_8"​ [label="​VNCCDBSDKInitialize()"​ dir=back];}
 +  "​src_8"​ -> "​src_9"​ [arrowhead=none];​
 +  "​dst_8"​ -> "​dst_9"​ [arrowhead=none];​
 +  {rank=same; "​dst_9"​ -> "​src_9"​ [label="​VNCCDBEndpointCreate()"​ dir=back];}
 +  "​src_9"​ -> "​src_10"​ [arrowhead=none];​
 +  "​dst_9"​ -> "​dst_10"​ [arrowhead=none];​
 +  {rank=same; "​dst_10"​ -> "​src_10"​ [label="​VNCCDBEndpointAddLicense()"​ dir=back];}
 +  "​dst_10"​ -> "​src_11"​ [arrowhead=none];​
 +  "​src_10"​ -> "​dst_11"​ [arrowhead=none];​
 +  {rank=same; "​src_11"​ -> "​dst_11"​ [label="​VNCCDBEndpointServicesSupportedCallback()"​];​}
 +  "​dst_11"​ -> "​src_12"​ [arrowhead=none];​
 +  "​src_11"​ -> "​dst_12"​ [arrowhead=none];​
 +  {rank=same; "​dst_12"​ -> "​src_12"​ [label="​VNCCDBEndpointAddCDBSink()"​ dir=back];}
 +  "​src_12"​ -> "​src_13"​ [arrowhead=none];​
 +  "​dst_12"​ -> "​dst_13"​ [arrowhead=none];​
 +  {rank=same; "​dst_13"​ -> "​src_13"​ [label="​VNCCDBEndpointSendStartService()"​ dir=back];}
 +  "​dst_13"​ -> "​src_15"​ [arrowhead=none];​
 +  "​src_6"​ -> "​dst_15"​ [arrowhead=none];​
 +  {rank=same; "​dst_15"​ -> "​src_15"​ [label="​VNCCDBEndpointStartServiceCallback()"​ dir=back];}
 +  "​dst_15"​ -> "​src_16"​ [arrowhead=none];​
 +  "​src_15"​ -> "​dst_16"​ [arrowhead=none];​
 +  {rank=same; "​src_16"​ -> "​dst_16"​ [label="​VNCCDBEndpointSendServiceResponse()"​];​}
 +  "​dst_16"​ -> "​src_17"​ [arrowhead=none];​
 +  "​src_13"​ -> "​dst_17"​ [arrowhead=none];​
 +  {rank=same; "​src_17"​ -> "​dst_17"​ [label="​VNCCDBEndpointServiceResponseCallback()"​];​}
 +  "​dst_17"​ -> "​src_19"​ [arrowhead=none];​
 +  "​src_17"​ -> "​dst_19"​ [arrowhead=none];​
 +  {rank=same; "​dst_19"​ -> "​src_19"​ [label="​VNCCDBEndpointSendServicePayload()"​ dir=back];}
 +  "​dst_19"​ -> "​src_20"​ [arrowhead=none];​
 +  "​src_16"​ -> "​dst_20"​ [arrowhead=none];​
 +  {rank=same; "​dst_20"​ -> "​src_20"​ [label="​VNCCDBEndpointServicePayloadCallback()"​ dir=back];}
 +  "​dst_20"​ -> "​src_21"​ [arrowhead=none];​
 +  "​src_20"​ -> "​dst_21"​ [arrowhead=none];​
 +  {rank=same; "​src_21"​ -> "​dst_21"​ [label="​VNCCDBEndpointSendServicePayload()"​];​}
 +  "​dst_21"​ -> "​src_22"​ [arrowhead=none];​
 +  "​src_19"​ -> "​dst_22"​ [arrowhead=none];​
 +  {rank=same; "​src_22"​ -> "​dst_22"​ [label="​VNCCDBEndpointServicePayloadCallback()"​];​}
 +  "​dst_22"​ -> "​src_24"​ [arrowhead=none];​
 +  "​src_22"​ -> "​dst_24"​ [arrowhead=none];​
 +  {rank=same; "​dst_24"​ -> "​src_24"​ [label="​VNCCDBEndpointSendStopService()"​ dir=back];}
 +  "​dst_24"​ -> "​src_25"​ [arrowhead=none];​
 +  "​src_21"​ -> "​dst_25"​ [arrowhead=none];​
 +  {rank=same; "​dst_25"​ -> "​src_25"​ [label="​VNCCDBEndpointStopServiceCallback()"​ dir=back];}
 +  "​dst_25"​ -> "​src_26"​ [arrowhead=none];​
 +  "​src_25"​ -> "​dst_26"​ [arrowhead=none];​
 +  {rank=same; "​src_26"​ -> "​dst_26"​ [label="​VNCCDBEndpointSendServiceResponse()"​];​}
 +  "​dst_26"​ -> "​src_27"​ [arrowhead=none];​
 +  "​src_24"​ -> "​dst_27"​ [arrowhead=none];​
 +  {rank=same; "​src_27"​ -> "​dst_27"​ [label="​VNCCDBEndpointServiceResponseCallback()"​];​}
 +  "​dst_27"​ -> "​src_29"​ [arrowhead=none];​
 +  "​src_27"​ -> "​dst_29"​ [arrowhead=none];​
 +  {rank=same; "​dst_29"​ -> "​src_29"​ [label="​VNCCDBEndpointStop()"​ dir=back];}
 +  "​src_29"​ -> "​src_30"​ [arrowhead=none];​
 +  "​dst_29"​ -> "​dst_30"​ [arrowhead=none];​
 +  {rank=same; "​dst_30"​ -> "​src_30"​ [label="​VNCCDBEndpointDestroy()"​ dir=back];}
 +  "​src_26"​ -> "​src_31"​ [arrowhead=none];​
 +  "​dst_30"​ -> "​dst_31"​ [arrowhead=none];​
 +  {rank=same; "​src_31"​ -> "​dst_31"​ [label="​VNCCDBEndpointStop()"​];​}
 +  "​src_31"​ -> "​src_32"​ [arrowhead=none];​
 +  "​dst_31"​ -> "​dst_32"​ [arrowhead=none];​
 +  {rank=same; "​src_32"​ -> "​dst_32"​ [label="​VNCCDBEndpointDestroy()"​];​}
 +  node [shape=box]
 +  {rank=same; "​end_Source"​ [label="​Source"​];"​end_Sink"​ [label="​Sink"​];"​end_SDK"​ [label="​SDK"​];​}
 +  "​src_32"​ -> "​end_Source"​ [arrowhead=none];​
 +  "​src_30"​ -> "​end_Sink"​ [arrowhead=none];​
 +  "​dst_32"​ -> "​end_SDK"​ [arrowhead=none];​
 +
 +}
 +</​graphviz>​
realvnc/cdbsbp.txt · Last modified: 2012/11/09 13:22 by andy