Comer352L / FreeSSM

GNU General Public License v3.0
214 stars 67 forks source link

Reset Oil Dilution #16

Open tomkor opened 7 years ago

tomkor commented 7 years ago

Would you check this code?

bool SSMprotocol1::resetOilDilution(CMlevel_dt level, bool *success){

There's no Oil Dilution measurement / reset using the SSM1 protocol. SSM2protocol is the right place for this. Looks like you are suggesting to do the reset as part of the Clear Memory Procedure ? Both things should really be kept independent. We could add it as an Adjustment, but maybe it's time to add a "Service Procedures" section...

    *success = false;
    if(_state != state_normal) return false;
    if(level != CMlevel_1) return false;
    char bytewritten = 0;
    const int adres=0x27D;
    char b;
    if(!_SSMP1com->readAddress(adres,&b)){
        resetCUdata();
        return false;
    }
    else{
        _SSMP1com->writeAddress(adres,b | 0x40,&bytewritten);

Delay needed ?

        _SSMP1com->readAddress(adres,&b);
        _SSMP1com->writeAddress(adres,b & ~0x40,&bytewritten);
        _SSMP1com->readAddress(adres,&b);
        if(b!=0) return false;

Is it really an error if the resulting value is != 0 ? I'm pretty sure the other bits are used for different purposes...

    }

    return true;
}

Can you send me a dump of your ECUs flagbytes (in private if you want) ?

tomkor commented 7 years ago

I use procedure from RomRaider Tools TestApp and it is work greate. I try to create another button into left panel with method to reset oil dilution in SSM2 protocol. But I cannot test this becouse my car is in workshop.

I try to implement some method to write loged data to file like csv or comma separated txt.

FreeSSM.zip