Click here to Skip to main content
15,908,842 members
Home / Discussions / C#
   

C#

 
QuestionDLL reference fails after first build Pin
JacquesDP3-Jan-11 3:34
JacquesDP3-Jan-11 3:34 
AnswerRe: DLL reference fails after first build Pin
fjdiewornncalwe3-Jan-11 4:53
professionalfjdiewornncalwe3-Jan-11 4:53 
GeneralRe: DLL reference fails after first build Pin
JacquesDP3-Jan-11 19:35
JacquesDP3-Jan-11 19:35 
AnswerRe: DLL reference fails after first build Pin
jschell3-Jan-11 10:02
jschell3-Jan-11 10:02 
GeneralRe: DLL reference fails after first build Pin
JacquesDP3-Jan-11 19:31
JacquesDP3-Jan-11 19:31 
GeneralRe: DLL reference fails after first build Pin
JacquesDP3-Jan-11 19:58
JacquesDP3-Jan-11 19:58 
GeneralRe: DLL reference fails after first build [modified] Pin
JacquesDP3-Jan-11 20:19
JacquesDP3-Jan-11 20:19 
QuestionWhat I want to ignore the message which start with 55 55 with length equal 6 ? ( Dealing With Bytes) Pin
Honeyboy_203-Jan-11 3:11
Honeyboy_203-Jan-11 3:11 
I am try to read serial of bytes and if I find the first byte is 55 and the second is 55 I will try till , I receive CC CC as a terminal.

but my problem is : when i reading I can find 55 55 and this is not start like this sample of bytes.

55  55  03  0A  0C  28  
AA  AA  00  00  
99  08  F1  00  00  0B  09  0D
AA  AA  5F  00  
99  1E  3F  48  56  41  30  31  31  32  34  31  4E  4E  20  20  30  31  30  20  20  20  20  01  00  00  00  00  00 0D   
AA  AA  17  08  
99  1E  3F  48  56  41  30  37  31  32  34  32  4E  4E  20  20  30  37  30  20  20  20  20  07  00  00  00  00  00 0D  

55  55  03  0A  0C  2A 		[synch message every 3 minuits]

AA  AA  04  09  
99  08  F1  80  00  0B  09  0D  
AA  AA  0E  09  
99  08  F1  80  00  0B  09  0D  
AA  AA  05  0A  
CC  CC  			[end of section] 



What I want to ignore the message which start with 55 55 with length equal 6 because it's not the start of current block.

and here's My code :

1- I am Calculate Number of Blocks.
2- Then Store each block.

Current code neglect some bytes but I am not able to reach where's the logic error.

Note : All bytes are stored in VopMessageDetails ArrayList and I am converted from Hex to Decimal so 55 Hex Will equal = 85 and CC =204

       int NblockCounter = 0;
            int prevBlockLengths = 0;

            #region To Get Numbers Of Blocks
            // To Get Numbers Of Blocks
            for (int i = 0; i < VopMessageDetails.Count; i++)
            {
                if (VopMessageDetails[i].ToString() == "204")
                {
                    i++;
                    NblockCounter++;
                }
            }
            #endregion

            // catchBlockBytesArray : Used to Make Array of Bytes each Index will contains a block.
            List<String>[] catchBlockBytesArray = new List<String>[NblockCounter];
            int blockCounter = 0;

            catchBlockBytesArray[blockCounter] = new List<string>();

            #region Catch blocks where each block stored as a item in catchBlockBytesArray.
            for (int i = 0; i < VopMessageDetails.Count; i++)
            {
                if (VopMessageDetails[0 + prevBlockLengths].ToString() == "85" & VopMessageDetails[1 + prevBlockLengths].ToString() == "85")
                {
                    if (VopMessageDetails[i].ToString() != "204")
                    {
                        if (VopMessageDetails[i].ToString() == "55" & VopMessageDetails[i + 1].ToString() == "55")
                        {
                            i += 6;
                        }
                        else
                        {
                            catchBlockBytesArray[blockCounter].Add(VopMessageDetails[i].ToString());
                        }
                    }
                    else
                    {
                        prevBlockLengths = i + 2;
                        i++;
                        blockCounter++;

                        if (i != VopMessageDetails.Count - 1)
                        {
                            if (blockCounter < NblockCounter)
                            {
                                catchBlockBytesArray[blockCounter] = new List<string>();
                            }

                        }
                    }
                }
            }
            #endregion
        }


    }
}

AnswerRe: What I want to ignore the message which start with 55 55 with length equal 6 ? ( Dealing With Bytes) Pin
OriginalGriff3-Jan-11 3:31
mveOriginalGriff3-Jan-11 3:31 
GeneralRe: What I want to ignore the message which start with 55 55 with length equal 6 ? ( Dealing With Bytes) Pin
Honeyboy_203-Jan-11 3:36
Honeyboy_203-Jan-11 3:36 
GeneralRe: What I want to ignore the message which start with 55 55 with length equal 6 ? ( Dealing With Bytes) Pin
OriginalGriff3-Jan-11 3:41
mveOriginalGriff3-Jan-11 3:41 
QuestionFetching Website Visitor Details By Email Pin
rowdykuttan3-Jan-11 2:11
rowdykuttan3-Jan-11 2:11 
AnswerRe: Fetching Website Visitor Details By Email Pin
Not Active3-Jan-11 2:40
mentorNot Active3-Jan-11 2:40 
AnswerRe: Fetching Website Visitor Details By Email Pin
GenJerDan3-Jan-11 4:28
GenJerDan3-Jan-11 4:28 
AnswerRe: Fetching Website Visitor Details By Email Pin
T M Gray3-Jan-11 9:49
T M Gray3-Jan-11 9:49 
QuestionSFTP using Sharp SSH Pin
SG21072-Jan-11 20:02
SG21072-Jan-11 20:02 
AnswerRe: SFTP using Sharp SSH Pin
OriginalGriff2-Jan-11 21:04
mveOriginalGriff2-Jan-11 21:04 
AnswerRe: SFTP using Sharp SSH Pin
Bernhard Hiller2-Jan-11 21:17
Bernhard Hiller2-Jan-11 21:17 
QuestionChanging Console font Pin
Mc_Topaz2-Jan-11 11:28
Mc_Topaz2-Jan-11 11:28 
AnswerRe: Changing Console font Pin
PIEBALDconsult2-Jan-11 15:19
mvePIEBALDconsult2-Jan-11 15:19 
AnswerRe: Changing Console font Pin
DaveyM692-Jan-11 18:03
professionalDaveyM692-Jan-11 18:03 
GeneralRe: Changing Console font Pin
Mc_Topaz2-Jan-11 22:16
Mc_Topaz2-Jan-11 22:16 
QuestionCan't set Label.Text Pin
Pelgar2-Jan-11 6:57
Pelgar2-Jan-11 6:57 
AnswerRe: Can't set Label.Text Pin
Luc Pattyn2-Jan-11 7:07
sitebuilderLuc Pattyn2-Jan-11 7:07 
GeneralRe: Can't set Label.Text [modified] Pin
Pelgar2-Jan-11 7:13
Pelgar2-Jan-11 7:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.