/*
 * playground.c
 *
 *  Created on: May 14, 2010
 *      Author: epics
 */
#include <stdio.h>
#include <stdlib.h>

void strtol_test(void);
int main()
{
   strtol_test();

   return 0;
}

void strtol_test(void)
{
   char cstring[] = "2802967C0100004A";
   char byte[] = "00";

   unsigned char id[8] = {0,0,0,0,0,0,0,0};
   int index = 0;

   for (index = 0; index < 8; index++)
   {
      byte[0] = cstring [index*2];
      byte[1] = cstring [index*2 +1];
      byte[2] = 0;

      id[index] = strtol(byte, NULL, 16);
   }


   printf("cstring %s\n", cstring);
   for (index = 0; index < 8; index++)
   {
      printf("%02X", id[index]);
   }
}
