mickeyl / LTSupportAutomotive

An iOS / watchOS / macOS support library for OBD2, VIN-Decoding, and more.
MIT License
212 stars 59 forks source link

Adapter State Initializing #39

Closed pavnishquokkalabs closed 2 years ago

pavnishquokkalabs commented 2 years ago

i am getting error "Unhandeld adapter state OBD2AdapterStateInitializing" after i am replace your services "[@[ @"FFF0", @"FFE0", @"BEEF" , @"E7810A71-73AE-499D-8C15-FAA9AEF0C3F2"]" with my own service "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx" and also added check for verify own characteristics not getting any response

-(void)peripheral:(CBPeripheral )peripheral didDiscoverCharacteristicsForService:(CBService )service error:(NSError )error { for ( CBCharacteristic characteristic in service.characteristics ) { if ([characteristic.UUID.UUIDString isEqualToString:@"xxxxxxxxxxxx-xxxxxxx-xxxxxx-xxxxxxxxxxxx"]) { if ( characteristic.properties & CBCharacteristicPropertyRead ) { LOG( @"Did see read characteristic" ); _reader = characteristic;

            [peripheral readValueForCharacteristic:characteristic];
            //[peripheral setNotifyValue:YES forCharacteristic:characteristic];
        }

        if ( characteristic.properties & CBCharacteristicPropertyWrite )
        {
            LOG( @"Did see write characteristic" );
            _writer = characteristic;
        }
    }
}

if ( _reader && _writer )
{
    [self connectionAttemptSucceeded];
}
else
{
    [self connectionAttemptFailed];
}

}

danr777 commented 2 years ago

Do you recall how you fixed this?