77 lines
1.7 KiB
C++
77 lines
1.7 KiB
C++
//****************************************************************************
|
|
// Copyright (C) 2012
|
|
// Nissan North America
|
|
// All Rights Reserved. Proprietary and Confidential.
|
|
//============================================================================
|
|
|
|
/* prevent multiple inclusions */
|
|
#ifndef __CanDaemon__
|
|
#define __CanDaemon__
|
|
|
|
/* includes *****************************************************************/
|
|
|
|
#include "TcpDaemon.h"
|
|
|
|
#include "CanDatabase.h"
|
|
|
|
#include "UdpCaster.h"
|
|
|
|
#include "CanListener.h"
|
|
#include "CanTxGenerator.h"
|
|
#include "CanRxListener.h"
|
|
|
|
/* defines ******************************************************************/
|
|
|
|
/* BSMPd */
|
|
#define CAND_NAME "cand"
|
|
#define CAND_SERVICE "cand"
|
|
#define CAND_PORT "2946"
|
|
|
|
/* macros *******************************************************************/
|
|
|
|
/* structs & typedefs *******************************************************/
|
|
|
|
/* c class definitions ******************************************************/
|
|
|
|
//
|
|
// Uses the Peak Systems CAN Linux driver and Nissan CAN data
|
|
//
|
|
class CanDaemon : public TcpDaemon {
|
|
// public data
|
|
public:
|
|
CanTxGenerator Generator;
|
|
CanRxListener Receiver;
|
|
CanListener Vehicle;
|
|
|
|
CanSocket Can;
|
|
|
|
// private data
|
|
private:
|
|
|
|
// public methods
|
|
public:
|
|
// constructors
|
|
CanDaemon();
|
|
|
|
// destructor
|
|
virtual ~CanDaemon();
|
|
|
|
// virtual functions
|
|
void DaemonStartup(void);
|
|
void DaemonShutdown(void);
|
|
int ClientIn( int sock, const char *buf, int n );
|
|
void ClientCast( const char *buf, int n );
|
|
int ServerSocket( void );
|
|
int ServerTimeout( void );
|
|
|
|
// public methods
|
|
int CanOpen( const char *can );
|
|
|
|
// static methods
|
|
|
|
// private methods
|
|
private:
|
|
};
|
|
|
|
#endif
|