Hello,
I have been looking around the Internet and I cant really find what I am looking for. I was wondering if you guys can help me out and I will try to make this as clear as I can.

I have this long hex string in 2 byte form:
0431, 0000, 0154, 0153, 0151, 0157, 0051, 0052, 0160, 1020, 0075, 2197, 0152, 0158, 0057, 0058
Binary:
00000100 00110001,00000000 00000000,00000001 01010100,00000001 01010011,00000001 01010001,00000001 01010111,00000000 01010001,00000000 01010010,00000001 01100000,00010000 00100000,00000000 01110101,00100001 10010111,00000001 01010010,00000001 01011000,00000000 01010111,00000000 01011000,




Now have this other hex string that controls the long hex string:
BF FF

So if you are thinking yes BF controls one half and FF controls the other:
BF = 0431, 0000, 0154, 0153, 0151, 0157, 0051, 0052
Bin = 00000100 00110001,00000000 00000000,00000001 01010100,00000001 01010011,00000001 01010001,00000001 01010111,00000000 01010001,00000000 01010010,

FF = 0160, 1020, 0075, 2197, 0152, 0158, 0057, 0058
Bin= 00000001 01100000,00010000 00100000,00000000 01110101,00100001 10010111,00000001 01010010,00000001 01011000,00000000 01010111,00000000 01011000,

Now I know for sure if I change BF FF to 00 00 this happens:
BF to 00 = 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000
Bin = All Zeros
FF to 00 = 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000
Bin = All Zeros

And if I do this 00 FF this happens:
BF to 00 = 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000
Bin = All Zeros
FF = 0160, 1020, 0075, 2197, 0152, 0158, 0057, 0058
Bin= 00000001 01100000,00010000 00100000,00000000 01110101,00100001 10010111,00000001 01010010,00000001 01011000,00000000 01010111,00000000 01011000,

I know this a lot of info but I am trying to be as clear as I can lol. Ok so now my question, is there a C code that can determine the BF sequence?

If BF = 0431, 0000, 0154, 0153, 0151, 0157, 0051, 0052 what does C1 equal?

Let say I want to do this:
0431, 0000, 0154, 0153, 0151, 0157, 0051, 0052 change to 0431, 0000, 0154, 0153, 0000, 0157, 0000, 0052 what will I change BF to then??

0431, 0000, 0154, 0153, 0000, 0157, 0000, 0052 = ??

If the long hex needs to 1 byte like so, then cool:
04, 31, 00, 00, 01, 54, 01, 53, 01, 51, 01, 57, 00, 51, 00, 52
00000100, 00110001, 00000000, 00000000, 00000001, 01010100, 00000001, 01010011, 00000001, 01010001, 00000001, 01010111, 00000000, 01010001, 00000000, 01010010,

The commas are to help to visual see what bin is goes to which hex. In nutshell I guess, there a way in C to input the hex (or bin if need be) and it will calculate to the correct shortened/converted BF or BF FF?

Thanks,
Kevin.