simpleCommunicator_priv.hΒΆ

Generated using fsm -tss simpleCommunicator.fsm

/**
	simpleCommunicator_priv.h

	This file automatically generated by FSMLang
*/

#ifndef _SIMPLECOMMUNICATOR_PRIV_H_
#define _SIMPLECOMMUNICATOR_PRIV_H_

#include "simpleCommunicator.h"
#ifndef SIMPLE_COMMUNICATOR_NATIVE_PROLOG
#define SIMPLE_COMMUNICATOR_NATIVE_PROLOG

#include <stdio.h>
#define DBG_PRINTF(...) printf(__VA_ARGS__); printf("\n")

#endif

#ifdef SIMPLE_COMMUNICATOR_DEBUG
#include <stdio.h>
#include <stdlib.h>
#endif

#include <stdbool.h>
#undef FSM_TYPE_PTR
#define FSM_TYPE_PTR pSIMPLE_COMMUNICATOR
#undef DECLARE_INSTANCE
#define DECLARE_INSTANCE(A) FSM_TYPE_PTR A = (FSM_TYPE_PTR) pfsm

#ifdef SIMPLE_COMMUNICATOR_DEBUG
extern char *SIMPLE_COMMUNICATOR_EVENT_NAMES[];
extern char *SIMPLE_COMMUNICATOR_STATE_NAMES[];
#endif

typedef enum {
	simpleCommunicator_IDLE
	, simpleCommunicator_AWAITING_ACK
}  SIMPLE_COMMUNICATOR_STATE;

typedef struct _simpleCommunicator_struct_ SIMPLE_COMMUNICATOR;
typedef SIMPLE_COMMUNICATOR_EVENT (*SIMPLE_COMMUNICATOR_ACTION_FN)(pSIMPLE_COMMUNICATOR);

typedef void (*SIMPLE_COMMUNICATOR_FSM)(pSIMPLE_COMMUNICATOR,SIMPLE_COMMUNICATOR_EVENT);

void simpleCommunicatorFSM(pSIMPLE_COMMUNICATOR,SIMPLE_COMMUNICATOR_EVENT);

struct _simpleCommunicator_struct_ {
	unsigned                    instance;
	SIMPLE_COMMUNICATOR_STATE         state;
	SIMPLE_COMMUNICATOR_EVENT         event;
	SIMPLE_COMMUNICATOR_FSM           fsm;
};

SIMPLE_COMMUNICATOR_EVENT simpleCommunicator_neverExecuted(pSIMPLE_COMMUNICATOR);
SIMPLE_COMMUNICATOR_EVENT simpleCommunicator_sendMessage(pSIMPLE_COMMUNICATOR);
SIMPLE_COMMUNICATOR_EVENT simpleCommunicator_queueMessage(pSIMPLE_COMMUNICATOR);
SIMPLE_COMMUNICATOR_EVENT simpleCommunicator_checkQueue(pSIMPLE_COMMUNICATOR);



#endif