Develop and Download Open Source Software

Browse Subversion Repository

Contents of /runCtrl/TransmitPacket.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 191 - (show annotations) (download) (as text)
Fri Jan 4 02:49:36 2008 UTC (16 years, 4 months ago) by satofumi
File MIME type: text/x-chdr
File size: 954 byte(s)
using namespace beego

1 #ifndef TRANSMIT_PACKET_H
2 #define TRANSMIT_PACKET_H
3
4 /*!
5 \file
6 \brief 走行制御の通信パケット定義
7
8 \author Satofumi KAMIMURA
9
10 $Id$
11
12 \todo チェックサムの生成、確認、の関数をここで定義する
13 \todo 定義、宣言を beego の名前空間に含める
14 */
15
16
17 enum {
18 // !!! SCI の設定値よりも小さくしておかなければならない
19 BUFFER_SIZE = 512,
20 HEADER_SIZE = 16,
21
22 REPLY_UNKNOWN = 0,
23 REPLY_REQUEST = 1,
24 REPLY_OK = 2,
25 REPLY_ERROR = 3,
26 };
27
28 #define FirstTag "\x40\xaa\x55"
29
30 /*!
31 \brief パケットの種類
32 */
33 typedef enum {
34 UNKNOWN_PACKET = 0,
35 READ_PACKET = 1,
36 READ_REPLY_PACKET = 2,
37 WRITE_PACKET = 3,
38 WRITE_REPLY_PACKET = 4,
39 } packet_type;
40
41
42 /*!
43 \brief パケットの構成
44 */
45 typedef enum {
46 RECV_HEADER = 0,
47 RECV_DATA,
48 } state_type;
49
50
51 /*!
52 \brief パケット情報管理
53 */
54 typedef struct {
55 unsigned char* top;
56 char buffer[BUFFER_SIZE];
57 packet_type type;
58 state_type state;
59 int total_size;
60 int filled;
61 } packet_t;
62
63 #endif /* !TRANSMIT_PACKET_H */

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26