Skip to main content
. 2016 Jun 27;16(7):980. doi: 10.3390/s16070980
Algorithm 1 Time-based synchronization for raw-sensory data acquisition.
Require: buffersrc[1,...,n]: n is the total number of data sources
Ensure: bufferdst: queue for time-synchronized data packets
  1: procedure Sync(bufferdst)
  2:   msgcreate_msg(NULL)
  3:  while iNo_of_datasources do
  4:    buffersrc[i]Recv(data)        ▹ Complete-sync execution
  5:    msg.add(create_msg(buffersrc[i]))
  6:   if timesec>time_window then
  7:    if send_only=TRUE then      ▹ Incomplete-sync: Eager execution
  8:       break
  9:    end if
 10:    while jNo_of_datasources do    ▹ Incomplete-sync: Rendezvous execution
 11:       ji+1
 12:      if buffersrc[j].has_contents then
 13:         msg.add(create_msg(buffersrc[j])
 14:      end if
 15:     end while
 16:     break
 17:   end if
 18:  end while
 19:   msg.timestampbuffersrc[i].timestamp
 20:   bufferdst.enqueue(msg)
 21: end procedure