Subversion Repositories Projects

Rev

Rev 211 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
211 dhylands 1
/****************************************************************************
2
*
3
*   Copyright (c) 2009 Dave Hylands     <dhylands@gmail.com>
4
*
5
*   This program is free software; you can redistribute it and/or modify
6
*   it under the terms of the GNU General Public License version 2 as
7
*   published by the Free Software Foundation.
8
*
9
*   Alternatively, this software may be distributed under the terms of BSD
10
*   license.
11
*
12
*   See README and COPYING for more details.
13
*
14
****************************************************************************/
15
/**
16
*
17
*   @file   SimBus.h
18
*
19
*   @brief  Implements a simulated bioloid bus which is useful for some
20
*           types of debugging.
21
*
22
*   The simulated bus prints out all of the packets that would be
23
*   sent over the bus.
24
*
25
****************************************************************************/
26
 
27
#if !defined( SIMBUS_H )
28
#define SIMBUS_H       /**< Include Guard                             */
29
 
30
// ---- Include Files -------------------------------------------------------
31
 
32
#include "BioloidBus.h"
33
#include "SimPacket.h"
34
 
35
/**
36
 * @addtogroup bioloid
37
 * @{
38
 */
39
 
40
class SimBus : public BioloidBus
41
{
42
public:
43
    //------------------------------------------------------------------------
44
    // Default constructor
45
 
46
    SimBus();
47
 
48
    //------------------------------------------------------------------------
49
    // Destructor
50
 
51
    virtual ~SimBus();
52
 
53
    //------------------------------------------------------------------------
213 dhylands 54
    // Reads a byte.
55
 
56
    virtual bool ReadByte( uint8_t *ch );
57
 
58
    //------------------------------------------------------------------------
211 dhylands 59
    // Sends a byte. This will automatically accumulate the byte into 
60
    // the checksum
61
 
62
    virtual void SendByte( uint8_t data );
63
 
64
private:
65
 
66
    SimPacket   m_packet;
67
 
68
};
69
 
70
/** @} */
71
 
72
#endif /* SIMBUS_H */
73