- size_t BitLen = DemodBufferLen;
- uint8_t BitStream[MAX_GRAPH_TRACE_LEN]={0};
- memcpy(BitStream, DemodBuffer, BitLen);
- if (Em410xDecode(BitStream, &BitLen, &idx, hi, lo)){
+ uint8_t BitStream[512]={0};
+ size_t BitLen = sizeof(BitStream);
+ if ( !getDemodBuf(BitStream, &BitLen) ) return 0;
+
+ if (Em410xDecode(BitStream, &BitLen, &idx, hi, lo)) {