/* * このファイルは tecsgen によりテンプレートとして自動生成されました * このファイルを編集して使用することが意図されていますが * tecsgen の再実行により上書きされてしまうため、通常 * gen/tBuddy_template.c => src/tBuddy.c * のように名前, フォルダを変更してから修正します */ /* #[]# * #[<...>]# から #[]# で囲まれたコメントは編集しないでください * tecsmerge によるマージに使用されます * * #[]# */ /* プロトタイプ宣言や変数の定義をここに書きます #_PAC_# */ #include "tBuddy_tecsgen.h" #ifndef E_OK #define E_OK 0 /* success */ #define E_ID (-18) /* illegal ID */ #endif /* 受け口関数 #_TEPF_# */ /* #[]# eEnt * entry port: eEnt * signature: sHello * context: task * #[]# */ /* #[]# eEnt_myMessage * name: eEnt_myMessage * global_name: tBuddy_eEnt_myMessage * oneway: false * #[]# */ ER eEnt_myMessage(CELLIDX idx, const char* buf) { ER ercd = E_OK; CELLCB *p_cellcb; if (VALID_IDX(idx)) { p_cellcb = GET_CELLCB(idx); } else { return(E_ID); } /* end if VALID_IDX(idx) */ /* ここに処理本体を記述します #_TEFB_# */ printf( "[Buddy received] %s\n", buf ); return(ercd); } /* #[]# eEnt_yourMessage * name: eEnt_yourMessage * global_name: tBuddy_eEnt_yourMessage * oneway: false * #[]# */ ER eEnt_yourMessage(CELLIDX idx, char_t* buf, int32_t len) { ER ercd = E_OK; CELLCB *p_cellcb; if (VALID_IDX(idx)) { p_cellcb = GET_CELLCB(idx); } else { return(E_ID); } /* end if VALID_IDX(idx) */ /* ここに処理本体を記述します #_TEFB_# */ #define TECS_MESSAGE "Hello mruby! (from TECS)" strncpy( buf, TECS_MESSAGE, len ); return(ercd); } /* #[]# * これより下に非受け口関数を書きます * #[]#*/