Write some Software
Budget £5-10 GBP / time
I need to take a piece of code written in C for creating a CRC8 and turn it into a function in VB6. I want to be able to input 2 digit string values representing hex values (STX, Keyboard number, Lamp number, Command number, ETX and it to produce the CRC.
For example:-
82 60 00 00 83 would give DA
82 60 00 04 83 would give 42
82 60 00 22 83 would give B9
82 60 00 2F 83 would give 54
The C code is below:
The following section of the program explains the calculation of the CRC character. The type U8 is a 8 bit variable unsigned integer (0 through 255)
The function put_tx1_buffer ( U8 c ) send the characters via the serial interface.
#define POLYNOM 0xB1 // 28+27+25+24+20+1
#define INIT_TX_CRC {tx_crc=0xA5;} U8 tx_crc ;
void build_tx_crc8( U8 a )
{
U8 i=8 ;
do
{
if (( a & 0x01 ) != ( tx_crc & 0x01 ))
{
tx_crc >>= 1 ;
tx_crc ^= POLYNOM ;
}
else
{
tx_crc >>= 1 ;
}
a >>= 1 ;
}
while (--i!=0) ;
}
void set_lamp( U8 keyboardnumber, U8 lampnumber, U8 command )
{
INIT_TX_CRC ;
put_tx1_buffer( STX+0x80 ) ;
build_tx_crc8( STX+0x80 ) ;
put_tx1_buffer( command ) ;
build_tx_crc8( command ) ;
put_tx1_buffer( keyboardnumber ) ;
build_tx_crc8( keyboardnumber ) ;
put_tx1_buffer( lampnumber ) ;
build_tx_crc8( lampnumber ) ;
put_tx1_buffer( ETX+0x80 ) ;
build_tx_crc8( ETX+0x80 ) ;
put_tx1_buffer( tx_crc ) ;
}
7 freelancere byder i gennemsnit £8/time for dette job
Hello, How are you? I have read your project description carefully I am very interested in this project. I have a lot of experience in this type of work. I'm sure I can complete it on time with high quality acco Flere
Greetings!I hope you are doing well. I have read your proposal and i have keen interest to work with you because my experience and my knowledge meet your requirements. I will provide good quality of work. Definately y Flere
Hi. I am a Senior VB6, VB.NET Developer living in Paris, I have read your specifications and i want to realize your application. i have already developed several applications you can find in my folio. I need more Flere