/* --------------------------------------------------------------------------- * RemoteProcedureCalls.h - v0.1 (c) 2008 Micro-key bv * --------------------------------------------------------------------------- * Micro-key bv * Industrieweg 28, 9804 TG Noordhorn * Postbus 92, 9800 AB Zuidhorn * The Netherlands * Tel: +31 594 503020 * Fax: +31 594 505825 * Email: support@microkey.nl * Web: www.microkey.nl * --------------------------------------------------------------------------- * Description: Holds supported Remote Procedure Calls * --------------------------------------------------------------------------- * Version(s): 0.1, Jan 29, 2008, FSc * Creation. * --------------------------------------------------------------------------- */ #ifndef __REMOTEPROCEDURECALLS_H__ #define __REMOTEPROCEDURECALLS_H__ /** \file RemoteProcedureCalls.h \brief */ /* --------------------------------------------------------------------------- * System include files. * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Application include files. * --------------------------------------------------------------------------- */ #include "BpMessageFormat.h" /* --------------------------------------------------------------------------- * Constant and macro definitions. * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Type definitions. * --------------------------------------------------------------------------- */ typedef void (*t_rpc_remote_procedure_call)( UINT8 senderId, UINT8 targetId, UINT8 requestNr, UINT8 functionId, UINT8 nrOfParams, UINT32 *params ); typedef struct t_RPC_ENTITY { UINT8 functionId; char * functionName; UINT8 nrOfParams; t_rpc_remote_procedure_call rpcFunction; struct t_RPC_ENTITY *next; struct t_RPC_ENTITY *previous; } t_rpc_entity; typedef struct t_RPC_ADMIN { t_rpc_entity *firstEntry; t_rpc_entity *lastEntry; } t_rpc_admin; /* --------------------------------------------------------------------------- * Variable declarations. * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Function declarations. * --------------------------------------------------------------------------- */ /** \brief Initialises a Remote Procedure Call administration */ int rpcInit(); /** \brief Deinitialises the Remote Procedure Call administration */ void rpcDeinit( int handle ); /** \brief Adds a Remote Procedure Call to the administration */ void rpcAdd( int handle, UINT8 functionId, char * functionName, t_rpc_remote_procedure_call funcptr, UINT8 nrOfParams ); /** \brief Removes a Remote Procedure Call to the administration */ void rpcRemove( int handle, UINT8 functionId ); /** \brief Looks up a Remote Procedure Call to the administration */ t_rpc_remote_procedure_call rpcLookup( int handle, UINT8 functionId ); /** \brief Executes a Remote Procedure Call */ RESULT rpcExecute( int handle, UINT8 functionId, UINT8 nrOfParams, const UINT32 *params ); t_rpc_entity *rpcLookupEntry( int handle, UINT8 functionId ); /** \brief Message handler for RPC-requests */ void rpcRequestHandler(t_bpmsg_message *msg, int ownHandler); #endif /* __REMOTEPROCEDURECALLS_H__ */