Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapter State Initializing #39

Closed
pavnishquokkalabs opened this issue Aug 23, 2021 · 1 comment
Closed

Adapter State Initializing #39

pavnishquokkalabs opened this issue Aug 23, 2021 · 1 comment

Comments

@pavnishquokkalabs
Copy link

pavnishquokkalabs commented Aug 23, 2021

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
Copy link

danr777 commented Nov 17, 2021

Do you recall how you fixed this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants