smartgauges / canbox

Firmware for canbus boxes
59 stars 25 forks source link

Where to find more serial payloads raise mqb/pq #4

Closed jesusvallejo closed 4 months ago

jesusvallejo commented 4 months ago

Hi, after some time digging in your code and drive2.ru post, i cannot find where did you get the payloads for the canbox_cont and canbox_mici functions. Those codes 0x09 and 0x0c are not in the github.com/runmousefly/Wo…n_Golf7_Protocol.java# L23 link. Im adding the behind steering wheel buttons ( navi buttons ) and id like to use them to navigate through the radio, up, down, left , right , enter and back. I have allready developed everything but the canbox.c funtions that send the uart payload. Do you know if the protocol has those functions or where could i look?

Also, is there by any chance a long click could be developed so the radio is muted if for example the next button is long pressed?

Thank you very much!!

smartgauges commented 4 months ago

Hello, I think you need to know how data is processed on your Android radio. as example, in apk file from my android unit i see this function for processing button presses

jadx CanBus_4.8.9/smali/com/xygala/canbus/CanbusKey.smali

   private void DasAutoKey(byte[] keydata2) {
        int key = 0;
        if (getKeyData(keydata2, 1) == 32) {
            int temp = getKeyData(keydata2, 3);
            int status = getKeyData(keydata2, 4);
            switch (temp) {
                case 1:
                    key = 12;
                    break;
                case 2:
                    key = 13;
                    break;
                case 3:
                    key = 10;
                    break;
                case 4:
                    key = 11;
                    break;
                case 5:
                    if (130 != this.canbusService.getBtStatus() && 131 != this.canbusService.getBtStatus()) {
                        key = 15;
                        break;
                    } else {
                        key = 16;
                        break;
                    }
                    break;
                case 6:
                    key = 5;
                    break;
                case 7:
                    key = 7;
                    break;
                case 8:
                case 11:
                    key = 80;
                    break;
                case 9:
                    key = 15;
                    break;
                case 10:
                    key = 16;
                    break;
                case 22:
                    key = 6;
                    break;
            }
            sendKey(key, status);
        }
    }
jesusvallejo commented 4 months ago

Ok, this makes sense 32 is 0x20 , and that is why other commands sent to 0x2f of the github project of runmousefly are not working. I'll try to extract the canbus apk from my head unit and decompile it.

Thanks!!