This method processes functions 1 & 2 This method reads a bit array and transfers it to the master.
1304 uint8_t u8currentRegister, u8currentBit, u8bytesno, u8bitsno;
1305 uint8_t u8CopyBufferSize;
1306 uint16_t u16currentCoil, u16coil;
1313 u8bytesno = (uint8_t)(u16Coilno / 8);
1314 if (u16Coilno % 8 != 0)
1322 for (u16currentCoil = 0; u16currentCoil < u16Coilno; u16currentCoil++)
1324 u16coil = u16StartCoil + u16currentCoil;
1325 u8currentRegister = (uint8_t)(u16coil / 16);
1326 u8currentBit = (uint8_t)(u16coil % 16);
1331 bitRead(regs[u8currentRegister], u8currentBit));
1342 if (u16Coilno % 8 != 0)
1346 return u8CopyBufferSize;