KeyTest.zip
Walter77
static struct rkxx_remote_key_table remote_key_table_testremote[] = { {0xf0 , KEY_PLAYPAUSE}, {0xfa , KEY_HOME}, {0xc1 , KEY_YELLOW}, {0xa3 , KEY_RED}, {0xb5 , KEY_VIDEO_NEXT}, };
{ .usercode = 0xe32, .nbuttons = 5, .key_table = &remote_key_table_testremote[0], },
static int remotectl_init(void) { printk(KERN_INFO "++++++++remotectl_init\n"); // Read in file from root here and populate // struct with data from file<---- return platform_driver_register(&remotectl_device_driver); }
case RMC_USERCODE: { ddata->scanData <<= 1; ddata->count ++; if ((TIME_BIT1_MIN < ddata->period) && (ddata->period < TIME_BIT1_MAX)){ ddata->scanData |= 0x01; } if (ddata->count == 0x10){//16 bit user code // Only print user code if value in local file // is set to 1 (eg. if(read_usercode)... ) // printk("u=0x%x\n",((ddata->scanData)&0xFFFF)); if (remotectl_keybdNum_lookup(ddata)){ ddata->state = RMC_GETDATA; ddata->scanData = 0; ddata->count = 0; }else{ //user code error ddata->state = RMC_PRELOAD; } } }
case RMC_GETDATA: { ddata->count ++; ddata->scanData <<= 1; if ((TIME_BIT1_MIN < ddata->period) && (ddata->period < TIME_BIT1_MAX)){ ddata->scanData |= 0x01; } if (ddata->count == 0x10){ // The same here : only print button codes if value // in local file is set to 1 (eg. if(read_buttoncode) ...) // printk(KERN_ERR "d=%x\n",(ddata->scanData&0xFFFF)); ...
read_usercode=1 read_buttoncode=1
num_buttons = 3 {0xf0,KEY_POWER} {0xb2,KEY_HOME} {0xa9,KEY_MUTE}
static void read_custom_remote(){ // Open rk_custom.remote from sdcard root FILE *rk_remote = fopen("/sdcard/rk_custom.remote","r"); // If file could not be opened if(rk_remote != NULL){ // Every line from file will be stored in this buffer char buffer[32]; // Debug variables if(fgets(buffer,32,rk_remote) != NULL){ if(buffer[15] == '1') print_usercode = 1; } if(fgets(buffer,32,rk_remote) != NULL){ if(buffer[17] == '1') print_buttoncode = 1; } // Read usercode from file if(fgets(buffer,32,rk_remote) != NULL){ char usercode_string[] = { buffer[9] , buffer[10], buffer[11], buffer[12] }; int usercode = atoi(usercode_string); remotectl_button[2].usercode = usercode; } // Check if read_table is = 1 int read_table = 0; if(fgets(buffer,32,rk_remote) != NULL){ if(buffer[11] == '1') read_table = 1; } // Read in button mapping from file // only if file says so if(read_table){ int table_index = 0; int button_count = 0; //While the next line is present while(fgets(buffer,32,rk_remote) != NULL){ // Get scancode from file char scancode_string[] = {buffer[1] , buffer[2], buffer[3]}; int scancode = atoi(scancode_string); // Get keycode from file char keycode_string[] = {buffer[5] , buffer[6] , buffer[7]}; int keycode = atoi(keycode_string); // Store scan- and keycode in custom remotes array remote_key_table_custom[table_index].scanCode = scancode; remote_key_table_custom[table_index].keyCode = keycode; table_index++; button_count++; } // Set the remotes number of buttons remotectl_button[2].nbuttons = button_count; } } else { printk("ERROR : /sdcard/rk_custom.remote does not exist !"); } fclose(rk_remote); }
static int remotectl_init(void) { printk(KERN_INFO "++++++++remotectl_init\n"); read_custom_remote(); return platform_driver_register(&remotectl_device_driver); }
{ .usercode = 0, .nbuttons = 0, .key_table = &remote_key_table_custom[0], },
int print_usercode = 0; int print_buttoncode = 0; static struct rkxx_remote_key_table remote_key_table_custom[64] = { };
print_usercode=1 print_buttoncode=1 usercode=0000 read_table=0 {255,136} {033,001} {123,029}
// Only print usercode if local file says so if(print_usercode) printk("u=0x%x\n",((ddata->scanData)&0xFFFF));
// Only print buttoncode if local file says so if(print_buttoncode) printk(KERN_ERR "d=%x\n",(ddata->scanData&0xFFFF))
<6>[ 626.073371] qtaguid: ctrl_counterset(s 1 10049): insufficient priv from pid=424 tgid=363 uid=1000 <6>[ 626.862503] qtaguid: ctrl_counterset(s 0 10052): insufficient priv from pid=424 tgid=363 uid=1000 <6>[ 632.196747] qtaguid: ctrl_counterset(s 1 10058): insufficient priv from pid=424 tgid=363 uid=1000 <6>[ 632.981211] qtaguid: ctrl_counterset(s 0 10049): insufficient priv from pid=424 tgid=363 uid=1000 <6>[ 749.568440] qtaguid: ctrl_counterset(s 1 10052): insufficient priv from pid=424 tgid=363 uid=1000 <6>[ 750.007843] qtaguid: ctrl_counterset(s 0 10058): insufficient priv from pid=424 tgid=363 uid=1000 <4>[ 1177.529646] RTL871X: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:2 <4>[ 1177.529822] RTL871X: send eapol packet <6>[ 1660.761962] qtaguid: ctrl_counterset(s 0 10052): insufficient priv from pid=424 tgid=363 uid=1000 <4>[ 1662.612117] enter func vmac_open... <4>[ 1663.615875] power on phy <6>[ 1664.674877] vmac_mii_bus: probed <6>[ 1664.676299] rk29 vmac rk29 vmac.0: PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1) <6>[ 1664.678641] ADDRCONF(NETDEV_UP): eth0: link is not ready <6>[ 1666.668371] PHY: 0:00 - Link is Down <4>[ 1669.440800] enter func vmac_close... <6>[ 1672.773446] qtaguid: ctrl_counterset(s 1 10052): insufficient priv from pid=424 tgid=363 uid=1000
<6>[ 171.977923] qtaguid: ctrl_counterset(s 1 10010): insufficient priv from pid=422 tgid=364 uid=1000 <6>[ 173.321278] qtaguid: ctrl_counterset(s 0 10008): insufficient priv from pid=422 tgid=364 uid=1000 <6>[ 254.512217] qtaguid: ctrl_counterset(s 0 10010): insufficient priv from pid=422 tgid=364 uid=1000 <4>[ 256.329251] enter func vmac_open... <4>[ 256.329340] !!!!!!!!!!11111111111111!!!! <4>[ 256.329428] power on phy <4>[ 257.368955] !!!!!!!!!!222222222222222!!!! <4>[ 257.369117] Read the Ethernet MAC address from IDB:00:00:00:00:00:00 <4>[ 257.369227] eth_mac_from_RANDOM***********:EE:E9:E0:B3:C7:0 <4>[ 257.369296] !!!!!!!!!!33333333333333!!!! <4>[ 257.379899] !!!!!!!!!!44444444444444444!!!! <4>[ 257.379959] !!!!!!!!!!55555555555555!!!! <6>[ 257.402318] vmac_mii_bus: probed <4>[ 257.402445] !!!!!!!!!!777777777777777777!!!! <6>[ 257.402483] rk29 vmac rk29 vmac.0: PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1) <4>[ 257.402540] !!!!!!!!!!8888888888888888888!!!! <6>[ 257.403572] ADDRCONF(NETDEV_UP): eth0: link is not ready <6>[ 259.399296] PHY: 0:00 - Link is Down <4>[ 263.345298] enter func vmac_close... <6>[ 266.613032] qtaguid: ctrl_counterset(s 1 10010): insufficie
static struct rkxx_remote_key_table remote_key_table_mele[] = { {0xEA, KEY_POWER}, };
{ .usercode = 0xf9, .nbuttons = 1, .key_table = &remote_key_table_mele[0], },
static struct rkxx_remote_key_table remote_key_table_mele[] = { {0xEA, KEY_POWER}, };
{ .usercode = 0xf9, .nbuttons = 1, .key_table = &remote_key_table_mele[0], },
su
echo 1 > /proc/print_usercode
dmesg
u=yourusercode
echo 0 > /proc/print_usercode
echo yourusercode > /proc/remote_id
echo 1 > /proc/print_buttoncode
dmesg
d=yourbuttoncode
There are currently 1972 users online. 0 members and 1972 guests.
Most users ever online was 63,956 at 18:56 on 20 March 2025.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity. We may share certain information about our users with our advertising and analytics partners. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment