User Tools

Site Tools


devel:development_documentation

Differences

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

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
devel:development_documentation [2008/08/27 13:56] – created pkubanekdevel:development_documentation [2009/01/04 17:08] – Fixed telescope_driver link pkubanek
Line 1: Line 1:
-====== Messaging ======+[[devel:Messaging]]
  
-RTS2 uses its own messaging system. Messages contains name of the originator, type (debug, info, warning, error) and message text, which is unformated string. Please note that this message subsystem is intended only to pass string messages. It was not invited to pass some structured infromation from one component to the other - for such tasks are commands.+Description of messaging system used by RTS2.
  
-To send message from any RTS2 code, use:+[[code:telescope_driver|How to implement telescope driver]]
  
-<code c++> +Short introduction how to implement a telescope driver and integrate it in RTS2.
-logStream (type)  +
-  << 1234      // use it as stream, add others values if necessary +
-  << sendLog;  // send it +
-</code>+
  
-where type is one of **MESSAGE_ERROR**, **MESSAGE_WARNING**, **MESSAGE_INFO**, **MESSAGE_DEBUG** (defined in [[http://rts-2.svn.sf.net/svnroot/rts-2/trunk/rts-2/include/message.h|include/message.h]]).+[[devel:Modbus TCP/IP]]
  
-So for example to send warning message, use:+Modbus TCP/IP connection.
  
-<code c++> +[[devel:Database Structure]]
-logStream (MESSAGE_WARNING)  +
-   << "This is warning message, component " +
-   << 123454 +
-   << " failed with error " +
-   << 12 +
-   << " (external intelligence not found)" +
-   << sendLog; +
-</code> +
- +
-To process messages coming from other connected devices over TCP/IP, hook on to public virtual function +
- +
-<code c++> +
-  virtual void message (Rts2Message & msg) +
-</code> +
- +
-Please see [[http://rts-2.svn.sf.net/svnroot/rts-2/trunk/rts-2/src/utils/rts2message.h|utils/rts2message.h]] for operations allowed on message. +
- +
-To process messages which are generated inside application, you need to hook on virtual function sendMessage: +
- +
-<code c++> +
-void Rts2Centrald::sendMessage (messageType_t in_messageType, const char *in_messageString) +
-</code> +
- +
-You get message type and string to send. In order to send generated message to all connected devices, you need to call sendMessageAll. However, please note that usual infrastructure of RTS2 assumes that you send message only to centrald, and then centrald distributed message to log and to other components in the system. So you should not care about sending messages.+
  
 +Commented database structure.
devel/development_documentation.txt · Last modified: 2009/01/04 00:00 (external edit)