[libhid-discuss] cannat find path to read and write

sajjad gerami myworkmail2010 at gmail.com
Mon Aug 31 05:22:25 UTC 2009


hi

i have problem with finding path to read and write with libhid
my device parsing :

path: 0xff000001.0xff000001; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0xff000001; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0

no 0x80 exist!!!!!
i used 0xff000001.0xff000001 as a path with lenght=2
that works for writing (no ERROR) but i cant read any way with
0xff000001.0xff000001
or 0xff000001.0x00000000

i don't know how to find the path

thanks for helping in advance

feel good

------------------------------------------------------------------------------------------------------
my code :::::

/*-----------------------------writing-----------------------------*/
  //writing to device


  unsigned char const PATHLEN = 2;
   int PATH_OUT[PATHLEN];// = { 0xff000001, 0xff000001,
0xff000001,0xff000001,0xff000001,0xff000001 };
   PATH_OUT[0]= 0xff000001;
   PATH_OUT[1]= 0xff000001;


   unsigned char const SEND_PACKET_LENGHT=8;
   char PACKET[SEND_PACKET_LENGHT];//={0x0,0x1,0x2,0x6};
   PACKET[0]=0x0;
   PACKET[1]=0x9;
   PACKET[2]=0x2;
   PACKET[3]=0x3;
   PACKET[4]=0x4;
   PACKET[5]=0x5;
   PACKET[6]=0x6;
   PACKET[7]=0x7;

   hid_return write_ret;
  // write_ret=hid_set_output_report(hid,PATH_OUT,PATHLEN,PACKET,SEND_PACKET_LENGHT);
   if(write_ret!=HID_RET_SUCCESS)
       printf("***Writing failed_____----___--___-__-_\n");
   else
       printf("***Writing successfuly DONE_____----___--___-__-_\n");
/*
  path: 0xff000001.0xff000001; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0x00000000; type: 0x90
  path: 0xff000001.0xff000001; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
  path: 0xff000001.0x00000000; type: 0xb0
*/

   /*-----------------------------Reading-----------------------------*/

   int PATH_IN[PATHLEN];
   PATH_IN[0]=0xff000001;
   PATH_IN[1]=0xff000001;

   int recive_packet_len=8;
   char Recive_packet[recive_packet_len];
   //ret = hid_get_input_report(hid, PATH_OUT, PATHLEN, Recive_packet,
recive_packet_len);
   int i;
   printf("\n------------------recived data-----------------\n");
   for (i=0; i<recive_packet_len ; i++)
       printf("%hx\n",Recive_packet[i]);

   printf("\n------------------END of recived data-----------------\n");


   /*-----------------------------END Reading-----------------------------*/



More information about the libhid-discuss mailing list