连续位的操作函数:

xMBUtilSetBits(UCHAR * ucByteBuf, USHORT usBitOffset, UCHAR ucNBits,UCHAR ucValue);

xMBUtilGetBits(UCHAR* ucByteBuf, USHORT usBitOffset, UCHAR ucNBits);

设置位:

将字节数组ucBytebuf看成连续的二进制位,从usBitOffset开始的连续ucNBits位都设置成ucValue
ucNBits:1~8
ucValue:0/1

读位:

将字节数组ucBytebuf看成连续的二进制位,读出从usBitOffset开始的连续ucNBits位
ucNBits:1~8

相关文章:

  • 2021-09-23
  • 2022-12-23
  • 2021-08-30
  • 2022-03-07
  • 2021-08-21
  • 2021-11-20
猜你喜欢
  • 2021-06-08
  • 2021-11-28
  • 2021-07-25
  • 2021-09-27
  • 2021-05-31
相关资源
相似解决方案