Identify a 5-bit pattern, given a bit stream, accessible by function uint8_t getBits(), which returns 4 bits at a time.
Anonimo
static int flag = 0; int matchPattern (char bitStream[]) //bitstream obtained from the function that returns 4 bits { //extract the first 4 bits of the 5-bit pattern value to be matched in the string Pattern 2 if(flag==1 && bitStream[0]==Pattern[4[) //When the next stream occurs match it with the last bit of the pattern return 1; if(!strcmpi(bitStream,Pattern2)) flag=1; }