I gang

Write some Software

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 ) ;

}

Færdigheder: C programmering, Visual Basic

Se mere: write software reviews, looking someone write software, write software brochure, write software requirement specification, write software mobile, msr206 write software demo, someone write software, find someone write software, write software gps system, write software iphone gps, need someone write software

Om arbejdsgiveren:
( 0 bedømmelser ) Forest Hill, United Kingdom

Projekt-ID: #14889411

Tildelt til:

vano101

Hello. I have much experience in converting code from one programming language to another programming language, including converting C/C++ to VB6. I know both programming languages very well and I know significant diff Mere

£7 GBP / time
(971 bedømmelser)
7.2

7 freelancere byder i gennemsnit £8/time for dette job

ljnath

Hello, I am a professional software developer proficient in C and VB6. I have read your project requirement, and i can quickly convert your C code to VB6 application. Or i can create a VM6 application to calculate CRC8 Mere

£10 GBP / time
(30 bedømmelser)
5.2
cometgroup

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 Mere

£8 GBP / time
(1 bedømmelse)
2.1
fanlancer

Hello,Sir High-Quality+fast development+good credit+fast communication=My work method! My first aim is to provide you quality and professional task. i have developed for 7 years on freelancer.com. This is my new Ac Mere

£8 GBP / time
(1 bedømmelse)
2.2
vw7981979vw

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 Mere

£8 GBP / time
(0 bedømmelser)
0.0
djamilasrar

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 Mere

£11 GBP / time
(0 bedømmelser)
0.0
£5 GBP / time
(0 bedømmelser)
0.0