urbiParse

PURPOSE ^

Parse messages from the URBI server

SYNOPSIS ^

function [timeStamp, tag, type, rnum, rstring] = urbiParse(message)

DESCRIPTION ^

 Parse messages from the URBI server
 This function parses messages comming from the server, however binary
 strings are not read nor converted to the corresponding object and should
 therefore be processed by the user. 
 Use urbiFullParse if you need the full message processing.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [timeStamp, tag, type, rnum, rstring] = urbiParse(message)
0002 % Parse messages from the URBI server
0003 % This function parses messages comming from the server, however binary
0004 % strings are not read nor converted to the corresponding object and should
0005 % therefore be processed by the user.
0006 % Use urbiFullParse if you need the full message processing.
0007 
0008 
0009  string = strread(message, '%s') ;
0010 
0011  %keyboard;
0012  [timeStamp, tag] = strread(string{1}, '[%u:%s]', 'whitespace', ']') ;
0013 
0014  f = sscanf(string{2}, '%f') ;
0015  s = sscanf(string{2}, '%s') ;
0016 
0017  if ~isempty(f)
0018      type =  'numeric';
0019      rnum = f;
0020      rstring = '';
0021  else
0022      if strcmp(s, 'BIN')
0023         type = 'BIN';
0024         rnum = 0 ;
0025         rstring = string ;
0026     else
0027         if strcmp(s, '***')
0028             type = 'system';
0029             rnum = 0 ;
0030             rstring = string ;
0031         else
0032             type = 'string';
0033             rnum = 0 ;
0034             rstring = s ;
0035         end
0036     end
0037 end ;
0038

Generated on Tue 20-Dec-2005 19:05:34 by m2html © 2003