Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RTno.h Source File

RTno.h

00001 #ifndef RTNO_HEADER_INCLUDED
00002 #define RTNO_HEADER_INCLUDED
00003 
00004 /*******************************************
00005  * RTno.h
00006  * @author Yuki Suga
00007  * @copyright Yuki Suga (ysuga.net) Nov, 10th, 2010.
00008  * @license LGPLv3
00009  *****************************************/
00010 
00011 
00012 //#define BAUDRATE 19200
00013 
00014 #define RTC_OK 0
00015 #define RTC_ERROR -1
00016 
00017 #include "BasicDataType.h"
00018 #include "InPort.h"
00019 #include "OutPort.h"
00020 
00021 
00022 extern "C" {
00023     void addInPort(InPortBase& inPort);
00024     void addOutPort(OutPortBase& outPort);
00025 }
00026 
00027 struct config_str {
00028     struct default_str {
00029         long baudrate;
00030     } _default;
00031 };
00032 
00033 struct exec_cxt_str {
00034     struct periodic_str {
00035         long type;
00036     } periodic;
00037 };
00038 
00039 #define ProxySynchronousExecutionContext 1
00040 
00041 extern exec_cxt_str exec_cxt;
00042 
00043 extern  config_str conf;
00044 
00045 
00046 extern "C" {
00047     void rtcconf(void);
00048 };
00049 
00050 namespace RTno {
00051 extern "C" {
00052     // setup function is defined in RTno.cpp
00053     void setup();
00054 
00055     // loop fuction is defined in RTno.cpp
00056     void loop();
00057 
00058     // These call-back funcitons should be defined in user program code.
00059     // Use RTno_template.pde to create your own project.
00060 
00061     /**
00062      * onInitialize()
00063      * This function is called when RTno is initialized.
00064      * RTno is usually initialized when the RTno-proxy is launched.
00065      */
00066     int onInitialize();
00067 
00068     /**
00069      * onActivated()
00070      * This function is called when RTno is activated.
00071      * RTno is usually activated by RT System Editor or other tools for OpenRTM-aist.
00072      */
00073     int onActivated();
00074 
00075     /**
00076      * onExecute()
00077      * This function is periodically called when the RTno-proxy is active.
00078      */
00079     int onExecute();
00080 
00081     /**
00082      * onDeactivated()
00083      * This function is called when RTno is deactivated.
00084      * RTno is usually deactivated by RT System Editor or other tools for OpenRTM-aist.
00085      */
00086     int onDeactivated();
00087 
00088     /**
00089      * onError
00090      * This function is called when RTno is error.
00091      * [DANGEROUS] This function is periodically called in very short interval.
00092      */
00093     int onError();
00094 
00095     /**
00096      * onReset
00097      * This function is called when RTno is reset.
00098      * RTno is usually reset by RT System Editor or other tools for OpenRTM-aist.
00099      */
00100     int onReset();
00101     };// extern "C"
00102 };
00103 
00104 
00105 #endif
00106