You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
506 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "protocolGenericTest.h"
  2. int protocolGenericTest::probeData(unsigned char * Data, int DataSize)
  3. {
  4. if (DataSize > 1)
  5. {
  6. if (Data[0] != 0x3C)
  7. { // Check Header
  8. return -1;
  9. };
  10. if (DataSize < 6)
  11. { // Check Size
  12. return 1;
  13. };
  14. if (Data[4] == 0x24 && Data[5] == 0x4D)
  15. { // Check Bottom ( checksumm )
  16. return 0;
  17. };
  18. return -1;
  19. };
  20. }
  21. int protocolGenericTest::parseData(unsigned char * Data, int DataSize)
  22. {
  23. // ToDo: Make Data manipulation
  24. return 6; // Return Size of Package
  25. }