Now I just want to send data from the PC to control the PS3.So I send the sixaxis's data just as
the report descriptor's format.But it doesn't work.
The code is:
Code: Select all
unsigned char report_1[50]={
                  0xA1,0x01,0x00,0x80,0x00,0x00,0x00,0x80,0x80,0x80,
                  0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,
                  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                  0x03,0x05,0x16,0xFF,0xCD,0x00,0x00,0x33,0x7F,0x77,
                  0x01,0x80,0x02,0x07,0x02,0x14,0x01,0x96,0x01,0xE8};
unsigned char report_2[50]={
                  0xA1,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,
                  0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                  0x03,0x05,0x16,0x00,0x00,0x00,0x00,0x33,0x02,0x77,
                  0x01,0x9E,0x02,0x08,0x01,0xF2,0x01,0x93,0x00,0x02};
unsigned char report_3[50]={
                  0xA1,0x01,0x00,0x20,0x00,0x00,0x00,0x80,0x80,0x80,
                  0x80,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00,0x00,
                  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                  0x03,0x05,0x16,0x00,0x00,0x00,0x00,0x33,0x02,0x77,
                  0x01,0x9E,0x02,0x08,0x01,0xF2,0x01,0x93,0x00,0x02};
		
unsigned char feature_1[]= {
		  0x43,0x02,0x01, 0x03, 0x00, 0x05, 0x0c, 0x01, 0x02, 0x18,
		  0x18, 0x18, 0x18, 0x09, 0x0a, 0x10, 0x11, 0x12,
		  0x13, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02,
		  0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x04, 0x04,
		  0x04, 0x04, 0x00, 0x00, 0x02, 0x01, 0x02, 0x00,
		  0x64, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00
	};
unsigned char feature_ef[]= {
		  0x53,0xef,0xef, 0x04, 0x00, 0x05, 0x03, 0x01, 0xa0, 0x00,
		  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		  0x02, 0x74, 0x02, 0x71, 0x00, 0x00, 0x00, 0x00,
		  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04
	};
                send ( sctl, feature_1,50,MSG_DONTWAIT );
                usleep(1000000);
                send ( sctl, feature_ef,50,MSG_DONTWAIT );
                usleep(send ( 1000000);
                send ( sint, report_1,50,MSG_NOSIGNAL );
                usleep(100000);
                send ( sint, report_2,50,MSG_NOSIGNAL );
                usleep(100000);
                send ( sint, report_3,50,MSG_NOSIGNAL );
                usleep(100000);
                send ( sint, report_2,50,MSG_NOSIGNAL );
                usleep(100000);