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.cpp
18
*
19
*   @brief  This file implements the SimBus class, which is a simulated
20
*           bioloid bus, that just prints out the contents of the packets received.
21
*
22
****************************************************************************/
23
 
24
// ---- Include Files -------------------------------------------------------
25
 
26
#include "Log.h"
27
#include "SimBus.h"
28
 
29
// ---- Public Variables ----------------------------------------------------
30
// ---- Private Constants and Types -----------------------------------------
31
// ---- Private Variables ---------------------------------------------------
32
// ---- Private Function Prototypes -----------------------------------------
33
// ---- Functions -----------------------------------------------------------
34
 
35
/**
36
 * @addtogroup bioloid
37
 * @{
38
 */
39
 
40
//***************************************************************************
41
/**
42
*   Constructor
43
*/
44
 
45
SimBus::SimBus()
46
{
47
}
48
 
49
//***************************************************************************
50
/**
51
*   Destructor
52
*
53
*   virtual
54
*/
55
 
56
SimBus::~SimBus()
57
{
58
}
59
 
60
//***************************************************************************
61
/**
213 dhylands 62
*   Reads a byte.
63
*
64
*   virtual
65
*/
66
 
67
bool SimBus::ReadByte( uint8_t *ch )
68
{
69
    return false;
70
}
71
 
72
//***************************************************************************
73
/**
211 dhylands 74
*   Sends a byte. This will automatically accumulate the byte into
75
*   the checksum)
76
*
77
*   virtual
78
*/
79
 
80
void SimBus::SendByte( uint8_t data )
81
{
82
    m_checksum += data;
83
 
84
    m_packet.ProcessChar( data );
85
}
86
 
87
/** @} */
88