Apologies for the funny title but im seriously stuck trying to figure out how to tackle this.
I have a list of users with some details that i send to a device. When sending a small list of users then everything is fine, it fails however when i send +200, and i know the reason.
In project i was given, the user ID is converted to CardID so that many things can work, that im clueless about. the card ID is a 32 byte array.
I have here a struct which shows in highlight it has to be a byte.
public struct BS2Card
{
public byte type;
public byte size;[MarshalAs(UnmanagedType.ByValArray, SizeConst = BS2Envirionment.BS2_CARD_DATA_SIZE)]
public byte[] data;
}
So ill be sending the device everything including This 32 padded byte arraybyte[] cardByte = new byte[32];
Finally the userID has to be converted to bit and inserted to the last occurrence of the byte array, meaning userID 11 has to be inserted into 0000000000000000000000000000000(11)problem is byte ranges from 0 - 255 so when you send lots of users then they start ending up with the same card ID's which brings back errors.
Why am i stuck cause im abit junior and im told to fix this, and my mind set is stuck on the fact that this has to be 0000000000000000000000000000000(11) like this and i kinda lack the experience of senior to see around this.
Can anyone point me in some direction/give criticism/ or tell me there is no hope i should rather talk to people who made the device. anything will help thank you in advance guys.
Bhuvanesh MohankumarPosted May 5, 2016, 4:06 AM
I hope youhave the answer for thisquestion.
I would suggest to have better approach.