simpleCommunicator_priv.hΒΆ

Generated using fsm -ts simpleCommunicator.fsm

/**
        simpleCommunicator_priv.h

        This file automatically generated by FSMLang
*/

#ifndef _SIMPLECOMMUNICATOR_PRIV_H_
#define _SIMPLECOMMUNICATOR_PRIV_H_

#include "simpleCommunicator.h"

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


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

typedef enum {
    simpleCommunicator_IDLE
    , simpleCommunicator_AWAITING_ACK
    , simpleCommunicator_numStates
}  SIMPLE_COMMUNICATOR_STATE;

typedef struct _simpleCommunicator_struct_ SIMPLE_COMMUNICATOR;
#undef FSM_TYPE_PTR
#define FSM_TYPE_PTR pSIMPLE_COMMUNICATOR
extern SIMPLE_COMMUNICATOR simpleCommunicator;

typedef SIMPLE_COMMUNICATOR_EVENT (*SIMPLE_COMMUNICATOR_ACTION_FN)(FSM_TYPE_PTR);

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

void simpleCommunicatorFSM(FSM_TYPE_PTR,SIMPLE_COMMUNICATOR_EVENT);

typedef ACTION_RETURN_TYPE (*SIMPLE_COMMUNICATOR_STATE_FN)(pSIMPLE_COMMUNICATOR,SIMPLE_COMMUNICATOR_EVENT);

static const SIMPLE_COMMUNICATOR_STATE_FN simpleCommunicator_state_fn_array[simpleCommunicator_numStates];

struct _simpleCommunicator_struct_ {
    SIMPLE_COMMUNICATOR_STATE            state;
    SIMPLE_COMMUNICATOR_EVENT            event;
    SIMPLE_COMMUNICATOR_STATE_FN   const (*statesArray)[simpleCommunicator_numStates];
    SIMPLE_COMMUNICATOR_FSM              fsm;
};


ACTION_RETURN_TYPE simpleCommunicator_sendMessage(FSM_TYPE_PTR);
ACTION_RETURN_TYPE simpleCommunicator_queueMessage(FSM_TYPE_PTR);
ACTION_RETURN_TYPE simpleCommunicator_checkQueue(FSM_TYPE_PTR);



#endif