• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ReadInt16LE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ReadInt16LE函数的典型用法代码示例。如果您正苦于以下问题:C++ ReadInt16LE函数的具体用法?C++ ReadInt16LE怎么用?C++ ReadInt16LE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ReadInt16LE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: NetAIOGets16

int32 NetAIOGets16(NetAIO *ob,int16* buf) {
  Stream *out = ob->out;
  int ret_len;
  int32 ret;
  WriteInt16LE(ob->out,0x0009);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x16);
  WriteInt32LE(ob->out,ArrayLength(buf));
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0009) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x16) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x13) longjmp(ob->conn->exception,3);
  ret = ReadInt32LE(out);
  if (ReadUInt8LE(ob->in) != 0x51) longjmp(ob->conn->exception,3);
  if (ReadInt32LE(ob->in)!=ArrayLength(buf)) longjmp(ob->conn->exception,5);
  {
    int i;
    for(i=0;i<ArrayLength(buf);i++) {
      buf[i] = ReadInt16LE(out);
    }
  }
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:30,代码来源:NetAIO.c


示例2: NetCANTx

CANResult NetCANTx(NetCAN *ob,uint32 flags,uint32 id,const int8* data) {
  Stream *out = ob->out;
  int ret_len;
  CANResult ret;
  WriteInt16LE(ob->out,0x0007);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x01);
  WriteUInt32LE(ob->out,flags);
  WriteUInt32LE(ob->out,id);
  int i;
  WriteInt32LE(ob->out,ArrayLength(data));
  for (i=0;i<ArrayLength(data);i++) {
    WriteInt8LE(ob->out,data[i]);
  }
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0007) longjmp(ob->conn->exception,1);
  if (ReadInt8LE(ob->in) != 0x01) longjmp(ob->conn->exception,2);
  if (ReadInt8LE(ob->in) != 0xCB) longjmp(ob->conn->exception,3);
  ret = ReadInt32LE(out);
  if (ReadInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:coherentsolutions,项目名称:libtsctl,代码行数:28,代码来源:NetCAN.c


示例3: NetAIOPeriodRangeList

PeriodRange* NetAIOPeriodRangeList(NetAIO *ob) {
  Stream *out = ob->out;
  int ret_len;
  PeriodRange* ret;
  WriteInt16LE(ob->out,0x0009);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x06);
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0009) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x06) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x71) longjmp(ob->conn->exception,3);
  ret_len = ReadInt32LE(ob->in);
  ret = ArrayAlloc(ret_len,12);
  {
    int i;
    for(i=0;i<ret_len;i++) {
      if (ReadUInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,3);
      ret[i].start = ReadUInt32LE(out);
      if (ReadUInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,3);
      ret[i].step = ReadUInt32LE(out);
      if (ReadUInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,3);
      ret[i].count = ReadUInt32LE(out);
    }
  }
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:33,代码来源:NetAIO.c


示例4: NetAIOReadys32

int32 NetAIOReadys32(NetAIO *ob,const int32* buf) {
  Stream *out = ob->out;
  int ret_len;
  int32 ret;
  WriteInt16LE(ob->out,0x0009);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x1D);
  int i;
  WriteInt32LE(ob->out,ArrayLength(buf));
  for (i=0;i<ArrayLength(buf);i++) {
    WriteInt32LE(ob->out,buf[i]);
  }
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0009) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x1D) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x13) longjmp(ob->conn->exception,3);
  ret = ReadInt32LE(out);
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:26,代码来源:NetAIO.c


示例5: NetBusPeekStream

void NetBusPeekStream(NetBus *ob,int32 address,int32 direction,int8* dest) {
  Stream *out = ob->out;
  int ret_len;
  WriteInt16LE(ob->out,0x0001);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x15);
  WriteInt32LE(ob->out,address);
  WriteInt32LE(ob->out,direction);
  WriteInt32LE(ob->out,ArrayLength(dest));
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0001) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x15) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x50) longjmp(ob->conn->exception,3);
  if (ReadInt32LE(ob->in)!=ArrayLength(dest)) longjmp(ob->conn->exception,5);
  {
    int i;
    for(i=0;i<ArrayLength(dest);i++) {
      dest[i] = ReadInt8LE(out);
    }
  }
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:28,代码来源:NetBus.c


示例6: NetBusAssign32X

uint32 NetBusAssign32X(NetBus *ob,int32 Address,int32 BitMSB,int32 BitLSB,int32 Value) {
  Stream *out = ob->out;
  int ret_len;
  uint32 ret;
  WriteInt16LE(ob->out,0x0001);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x1E);
  WriteInt32LE(ob->out,Address);
  WriteInt32LE(ob->out,BitMSB);
  WriteInt32LE(ob->out,BitLSB);
  WriteInt32LE(ob->out,Value);
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0001) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x1E) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,3);
  ret = ReadUInt32LE(out);
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:25,代码来源:NetBus.c


示例7: NetAIOTriggerList

int32* NetAIOTriggerList(NetAIO *ob) {
  Stream *out = ob->out;
  int ret_len;
  int32* ret;
  WriteInt16LE(ob->out,0x0009);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x07);
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0009) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x07) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x53) longjmp(ob->conn->exception,3);
  ret_len = ReadInt32LE(ob->in);
  ret = ArrayAlloc(ret_len,4);
  {
    int i;
    for(i=0;i<ret_len;i++) {
      ret[i] = ReadInt32LE(out);
    }
  }
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:28,代码来源:NetAIO.c


示例8: NetDIOGetMulti

int32 NetDIOGetMulti(NetDIO *ob,int8* state,int32 offset) {
  Stream *out = ob->out;
  int ret_len;
  int32 ret;
  WriteInt16LE(ob->out,0x0005);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x0C);
  WriteInt32LE(ob->out,ArrayLength(state));
  WriteInt32LE(ob->out,offset);
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0005) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x0C) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x13) longjmp(ob->conn->exception,3);
  ret = ReadInt32LE(out);
  if (ReadUInt8LE(ob->in) != 0x50) longjmp(ob->conn->exception,3);
  if (ReadInt32LE(ob->in)!=ArrayLength(state)) longjmp(ob->conn->exception,5);
  {
    int i;
    for(i=0;i<ArrayLength(state);i++) {
      state[i] = ReadInt8LE(out);
    }
  }
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:31,代码来源:NetDIO.c


示例9: NetEDIOQueryFunction

int32* NetEDIOQueryFunction(NetEDIO *ob,EDIOType type) {
  Stream *out = ob->out;
  int ret_len;
  int32* ret;
  WriteInt16LE(ob->out,0x000A);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x03);
  WriteInt32LE(ob->out,type);
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x000A) longjmp(ob->conn->exception,1);
  if (ReadInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,2);
  if (ReadInt8LE(ob->in) != 0x53) longjmp(ob->conn->exception,3);
  ret_len = ReadInt32LE(ob->in);
  ret = ArrayAlloc(ret_len,4);
  {
    int i;
    for(i=0;i<ret_len;i++) {
      ret[i] = ReadInt32LE(out);
    }
  }
  if (ReadInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:coherentsolutions,项目名称:libtsctl,代码行数:29,代码来源:NetEDIO.c


示例10: MOZ_ASSERT

bool WaveReader::DecodeAudioData()
{
  MOZ_ASSERT(OnTaskQueue());

  int64_t pos = GetPosition() - mWavePCMOffset;
  int64_t len = GetDataLength();
  int64_t remaining = len - pos;
  NS_ASSERTION(remaining >= 0, "Current wave position is greater than wave file length");

  static const int64_t BLOCK_SIZE = 4096;
  int64_t readSize = std::min(BLOCK_SIZE, remaining);
  int64_t frames = readSize / mFrameSize;

  static_assert(uint64_t(BLOCK_SIZE) < UINT_MAX /
                sizeof(AudioDataValue) / MAX_CHANNELS,
                "bufferSize calculation could overflow.");
  const size_t bufferSize = static_cast<size_t>(frames * mChannels);
  nsAutoArrayPtr<AudioDataValue> sampleBuffer(new AudioDataValue[bufferSize]);

  static_assert(uint64_t(BLOCK_SIZE) < UINT_MAX / sizeof(char),
                "BLOCK_SIZE too large for enumerator.");
  nsAutoArrayPtr<char> dataBuffer(new char[static_cast<size_t>(readSize)]);

  if (!ReadAll(dataBuffer, readSize)) {
    return false;
  }

  // convert data to samples
  const char* d = dataBuffer.get();
  AudioDataValue* s = sampleBuffer.get();
  for (int i = 0; i < frames; ++i) {
    for (unsigned int j = 0; j < mChannels; ++j) {
      if (mSampleFormat == FORMAT_U8) {
        uint8_t v =  ReadUint8(&d);
        *s++ = UnsignedByteToAudioSample<AudioDataValue>(v);
      } else if (mSampleFormat == FORMAT_S16) {
        int16_t v =  ReadInt16LE(&d);
        *s++ = SignedShortToAudioSample<AudioDataValue>(v);
      }
    }
  }

  double posTime = BytesToTime(pos);
  double readSizeTime = BytesToTime(readSize);
  NS_ASSERTION(posTime <= INT64_MAX / USECS_PER_S, "posTime overflow");
  NS_ASSERTION(readSizeTime <= INT64_MAX / USECS_PER_S, "readSizeTime overflow");
  NS_ASSERTION(frames < INT32_MAX, "frames overflow");

  mAudioQueue.Push(new AudioData(pos,
                                 static_cast<int64_t>(posTime * USECS_PER_S),
                                 static_cast<int64_t>(readSizeTime * USECS_PER_S),
                                 static_cast<int32_t>(frames),
                                 sampleBuffer.forget(),
                                 mChannels,
                                 mSampleRate));

  return true;
}
开发者ID:lgarner,项目名称:mozilla-central,代码行数:58,代码来源:WaveReader.cpp


示例11: NetModeDec

void NetModeDec(NetMode *ob) {
  Stream *out = ob->out;
  int ret_len;
  WriteInt16LE(ob->out,0x000B);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x04);
  if (ob->conn->mode > 0) ob->conn->count++;
  if (ob->conn->mode < 2)  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) return;
  if (ReadInt16LE(ob->in) != 0x000B) longjmp(ob->conn->exception,1);
  if (ReadInt8LE(ob->in) != 0x04) longjmp(ob->conn->exception,2);
  if (ReadInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
} 
开发者ID:coherentsolutions,项目名称:libtsctl,代码行数:13,代码来源:NetMode.c


示例12: NetBusRefresh

void NetBusRefresh(NetBus *ob) {
  Stream *out = ob->out;
  int ret_len;
  WriteInt16LE(ob->out,0x0001);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x17);
  if (ob->conn->mode > 0) ob->conn->count++;
  if (ob->conn->mode < 2)  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) return;
  if (ReadInt16LE(ob->in) != 0x0001) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x17) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:13,代码来源:NetBus.c


示例13: NetBusCommit

void NetBusCommit(NetBus *ob,int32 ForceAll) {
  Stream *out = ob->out;
  int ret_len;
  WriteInt16LE(ob->out,0x0001);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x18);
  WriteInt32LE(ob->out,ForceAll);
  if (ob->conn->mode > 0) ob->conn->count++;
  if (ob->conn->mode < 2)  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) return;
  if (ReadInt16LE(ob->in) != 0x0001) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x18) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:14,代码来源:NetBus.c


示例14: NetBusBitClear32

void NetBusBitClear32(NetBus *ob,int32 Address,int32 BitNumber) {
  Stream *out = ob->out;
  int ret_len;
  WriteInt16LE(ob->out,0x0001);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x14);
  WriteInt32LE(ob->out,Address);
  WriteInt32LE(ob->out,BitNumber);
  if (ob->conn->mode > 0) ob->conn->count++;
  if (ob->conn->mode < 2)  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) return;
  if (ReadInt16LE(ob->in) != 0x0001) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x14) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:15,代码来源:NetBus.c


示例15: NetBusPoke32

void NetBusPoke32(NetBus *ob,int32 Address,uint32 Value) {
  Stream *out = ob->out;
  int ret_len;
  WriteInt16LE(ob->out,0x0001);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x08);
  WriteInt32LE(ob->out,Address);
  WriteUInt32LE(ob->out,Value);
  if (ob->conn->mode > 0) ob->conn->count++;
  if (ob->conn->mode < 2)  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) return;
  if (ReadInt16LE(ob->in) != 0x0001) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x08) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:15,代码来源:NetBus.c


示例16: NetDIOSetAsync

void NetDIOSetAsync(NetDIO *ob,int32 DIONum,DIOState State) {
  Stream *out = ob->out;
  int ret_len;
  WriteInt16LE(ob->out,0x0005);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x07);
  WriteInt32LE(ob->out,DIONum);
  WriteInt32LE(ob->out,State);
  if (ob->conn->mode > 0) ob->conn->count++;
  if (ob->conn->mode < 2)  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) return;
  if (ReadInt16LE(ob->in) != 0x0005) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x07) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:15,代码来源:NetDIO.c


示例17: NetCANRxMulti

CANResult NetCANRxMulti(NetCAN *ob,CANMessage* msg,int32 min) {
  Stream *out = ob->out;
  int ret_len;
  CANResult ret;
  WriteInt16LE(ob->out,0x0007);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x05);
  WriteInt32LE(ob->out,ArrayLength(msg));
  WriteInt32LE(ob->out,min);
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0007) longjmp(ob->conn->exception,1);
  if (ReadInt8LE(ob->in) != 0x05) longjmp(ob->conn->exception,2);
  if (ReadInt8LE(ob->in) != 0xCB) longjmp(ob->conn->exception,3);
  ret = ReadInt32LE(out);
  if (ReadInt8LE(ob->in) != 0x74) longjmp(ob->conn->exception,3);
  if (ReadInt32LE(ob->in)!=ArrayLength(msg)) longjmp(ob->conn->exception,5);
  {
    int i;
    for(i=0;i<ArrayLength(msg);i++) {
      if (ReadInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,3);
      msg[i].flags = ReadUInt32LE(out);
      if (ReadInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,3);
      msg[i].id = ReadUInt32LE(out);
      if (ReadInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,3);
      msg[i].t_sec = ReadUInt32LE(out);
      if (ReadInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,3);
      msg[i].t_usec = ReadUInt32LE(out);
      if (ReadInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,3);
      msg[i].length = ReadUInt32LE(out);
      if (ReadInt8LE(ob->in) != 0x40) longjmp(ob->conn->exception,3);
      ReadInt32LE(out);
      {
        int k;
        for(k=0;k<8;k++) {
          msg[i].data[i] = ReadUInt8LE(out);
        }
      }
    }
  }
  if (ReadInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:coherentsolutions,项目名称:libtsctl,代码行数:48,代码来源:NetCAN.c


示例18: NetAIOConfigure

int32 NetAIOConfigure(NetAIO *ob,const real32* low,const real32* high,const int32* prec,const int32* rate,const int32* trigger,int32 itrig) {
  Stream *out = ob->out;
  int ret_len;
  int32 ret;
  WriteInt16LE(ob->out,0x0009);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x10);
  int i;
  WriteInt32LE(ob->out,ArrayLength(low));
  for (i=0;i<ArrayLength(low);i++) {
    WriteReal32LE(ob->out,low[i]);
  }
  WriteInt32LE(ob->out,ArrayLength(high));
  for (i=0;i<ArrayLength(high);i++) {
    WriteReal32LE(ob->out,high[i]);
  }
  WriteInt32LE(ob->out,ArrayLength(prec));
  for (i=0;i<ArrayLength(prec);i++) {
    WriteInt32LE(ob->out,prec[i]);
  }
  WriteInt32LE(ob->out,ArrayLength(rate));
  for (i=0;i<ArrayLength(rate);i++) {
    WriteInt32LE(ob->out,rate[i]);
  }
  WriteInt32LE(ob->out,ArrayLength(trigger));
  for (i=0;i<ArrayLength(trigger);i++) {
    WriteInt32LE(ob->out,trigger[i]);
  }
  WriteInt32LE(ob->out,itrig);
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0009) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x10) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x13) longjmp(ob->conn->exception,3);
  ret = ReadInt32LE(out);
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:43,代码来源:NetAIO.c


示例19: NetBusPokeStream

void NetBusPokeStream(NetBus *ob,int32 address,int32 direction,const int8* data) {
  Stream *out = ob->out;
  int ret_len;
  WriteInt16LE(ob->out,0x0001);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x16);
  WriteInt32LE(ob->out,address);
  WriteInt32LE(ob->out,direction);
  int i;
  WriteInt32LE(ob->out,ArrayLength(data));
  for (i=0;i<ArrayLength(data);i++) {
    WriteInt8LE(ob->out,data[i]);
  }
  if (ob->conn->mode > 0) ob->conn->count++;
  if (ob->conn->mode < 2)  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) return;
  if (ReadInt16LE(ob->in) != 0x0001) longjmp(ob->conn->exception,1);
  if (ReadUInt8LE(ob->in) != 0x16) longjmp(ob->conn->exception,2);
  if (ReadUInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
} 
开发者ID:embeddedarm,项目名称:libtsctl,代码行数:20,代码来源:NetBus.c


示例20: NetCANBaudGet

uint32 NetCANBaudGet(NetCAN *ob) {
  Stream *out = ob->out;
  int ret_len;
  uint32 ret;
  WriteInt16LE(ob->out,0x0007);
  WriteInt8LE(ob->out,ob->instance);
  WriteInt8LE(ob->out,0x03);
  ob->out->Flush(ob->out);
  if (ob->conn->mode > 0) {
    while (ob->conn->count) {
      ob->conn->count--;
      ReadInt32LE(ob->in);
    }
  }
  if (ReadInt16LE(ob->in) != 0x0007) longjmp(ob->conn->exception,1);
  if (ReadInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,2);
  if (ReadInt8LE(ob->in) != 0x03) longjmp(ob->conn->exception,3);
  ret = ReadUInt32LE(out);
  if (ReadInt8LE(ob->in) != 0x80) longjmp(ob->conn->exception,2);
  return ret;
} 
开发者ID:coherentsolutions,项目名称:libtsctl,代码行数:21,代码来源:NetCAN.c



注:本文中的ReadInt16LE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ReadInt32函数代码示例发布时间:2022-05-30
下一篇:
C++ ReadInt函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap