Real2Virtual202111

CommandBuffer?.h

٤Ƴ٤Ĥ
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
 
-
|
!
-
|
|
!
 
 
 
 
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
!
|
|
|
|
-
!
|
|
|
-
!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
!
|
|
|
|
|
|
|
|
|
!
-
|
!
 
#pragma once
//#ifndef COMMANDBUFFER_H
//#define COMMANDBUFFER_H
#include "common.h"
//#include "Initialize.h" 
//#include "Initialize.cpp"
//#include "OutBuffer.h"
 
class OutBuffer;
class InBuffer;
class StringQueue;
 
class CommandBuffer{
private:
   char myname[IdLenMax]; // name of the tesla dice
   char upname[IdLenMax]; // up dice name
   unsigned char id;  // id of this buffer
   InBuffer * faceIn[FaceMax]; //
   OutBuffer  * faceOut[FaceMax];
   char faceID[FaceMax];  // faceID[i] は、このtesla dice の i 面に隣接する他の dice の 面を表す。
   char dirID[FaceMax];   // dirID[i] は、この tesla dice の i面に隣接する他の dice の面との向きを表す。
   char myDirID[FaceMax]; // myDirID[i] は、このtesla dice のi面が隣接するdice と通信するための、こちら側の向きを表す。
   int IX;               // 送信関数-->受信関数間で面の情報を引き渡すための変数
   int UpFaceID;         // 上位(probeに近い)の dice が接続された面, -1 はシリアル通信チャネルを表す。
   InBuffer *nextDoorIn;
   OutBuffer *nextDoorOut;
   OutBuffer *currentOutFace;
   int p;
   char buff[CMax];
   unsigned char in;
   unsigned char parsingNow;
   int FirstTime;                                          // first time parse
   int resetFlag;
   int thisIsProbe;
   int thisIsMonitoring;
   int echoBackUART;
 
//
// command queue for h8
//
   char commandFaceID[CMax]; //
   int cqp1;
   unsigned char lock;
   StringQueue *squeue;
 
//   unsigned char (*parse)(struct comBuffer *this);
   void appendString( int fid, char *s);
   unsigned char getRegisterValue( int fid);
   int response2ack1( int fid, int nextDoor, int dir, int uDir);
   int response2ack2( int fid, int nextDoor, int dir, int uDir);
//   int response2cq( int fid, char *n, int nextDoor, int nextDir);
   int response2cq( int fid, int nextDoor, int nextDir);
   void sendHelpMessage( int fid);
   void setCurrentOutFace( OutBuffer *obuffer); 
   int startsWithStringConst(char *s);
     void sendCq(char i);
     int parseAck2(int fid);
     int parseAck1(int fid);
     int parseCq(int fid);
     int parseSend(int fid);
     void sendCommandToConnectedFace( int faceID, char *s);
 
public:
   CommandBuffer(unsigned char idx);
   void ackReturned( int faceID);
   unsigned char isLocked(void);
   unsigned char faceIsConnected(char x);
   StringQueue * getStringQueue();
//   void  init(void);
   void  initBuffer(void);
   void interruptProcess(void);
   int  isBufferNull(void);
   void output(void);
   void putCommand(int faceID, char *s);
   int putQueue( int faceID, char *s, int l);
   void putChar( int faceID, unsigned char c);
   void putInt(int faceID, unsigned char i);
   void put_error(int fid);
   void resetBuffer(void);
   void shift( int i ) ;
   void startRecursiveReset( int UpFaceID);
   void startRecursiveStructureSearch( int UpFaceID, char *upName);
   void skipSpace(void);
   int  startsWith( char *s);
   int  startsWithPInt( int *x);
   int  startsWithHexDec(int *x);
//   int  startsWithStringConst(char *x);
   void setLock( unsigned char trueOrFalse);
   void sendCommand( int faceID, char *s);
   unsigned char faceIsConnected( int faceID);
    void setName( char *name);
   void setUpFaceID( int id);
   void interpretCommand( int faceID);
   void setFaceIn( unsigned char i, InBuffer *fin);
   void setFaceOut( unsigned char i,OutBuffer *fout);
   void setBuffers(void);
 
} ;
//unsigned char parseForComBuffer(struct comBuffer *this);
//#endif
 
 

Counter: 82, today: 1, yesterday: 1

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2021-12-05 (日) 16:40:07 (873d)