jonneytest / sma-bluetooth

Automatically exported from code.google.com/p/sma-bluetooth
0 stars 0 forks source link

Unclear or No info given when password is wrong #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. wrong password given on commandline or in smatool.conf file

What is the expected output?
Valid data

What do you see instead?
with verbose output you see several times
bluetooth signal = 70%

What version of the product are you using? On what operating system?
0.11test on ubuntu 10.04
inverter is 4000TL

Please provide any additional information below.
I propose to add some code in data extraction part of $TIMESTRING (case 12)
See code below (my changes are suffixed with //*VDJ*)

                case 12: // extract time strings $TIMESTRING
                                if (debug == 1) printf("received[60]=0x%0X - Expected 0x6D\n", received[60]);   //*VDJ*
                                if (debug == 1) printf("received[61]=0x%0X - Expected 0x23\n", received[61]);   //*VDJ*
                                if(( received[60] == 0x6d )&&( received[61] == 0x23 ))
                                {
                    memcpy(timestr,received+63,24);
                    if (debug == 1) printf("extracting timestring\n");
                                    memcpy(timeset,received+79,4);
                                    idate=ConvertStreamtoTime( received+63,4, &idate );
                                    /* Allow delay for inverter to be slow */
                                    if( reporttime > idate ) {
                                       if( debug == 1 )
                                           printf( "delay=%d\n", (int)(reporttime-idate) );
                                       sleep( reporttime - idate );
                                    }
                                }
                                else
                                {
                    if (received[61]==0x7e) {                               //*VDJ*
                    printf("$TIMESTRING extraction failed. Check password!!!\n");           //*VDJ*
                        exit(-1);                                   //*VDJ*
                    }                                           //*VDJ*
                    memcpy(timestr,received+63,24);
                    if (debug == 1) printf("bad extracting timestring\n");
                                    already_read=0;
                                    fseek( fp, returnpos, 0 );
                                    linenum = returnline;
                                    found=0;
                                    if( archdatalen > 0 )
                                       free( archdatalist );
                                    archdatalen=0;
                                    strcpy( lineread, "" );
                                    failedbluetooth++;
                                    if( failedbluetooth > 10 )
                                        exit(-1);
                                    goto start;
                                    //exit(-1);
                                }

                break;

Original issue reported on code.google.com by luc.van....@skynet.be on 1 Apr 2011 at 7:47

GoogleCodeExporter commented 8 years ago

Original comment by stephenb...@gmail.com on 20 Apr 2011 at 5:55

GoogleCodeExporter commented 8 years ago
I've put this in the next version

Original comment by stephenb...@gmail.com on 27 Feb 2013 at 6:56