This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Device disconnected and not going connecting again

I was writing 3 character to ble device .but I got below error and ble device got disconnected. LED lights got off...

[CoreBluetooth] API MISUSE: <CBPeripheral: 0x1572b660, identifier = 82616B5B-3759-43F2-82DF-61573C2BDCD0, name = AP-09-9999 ^B, state = disconnected> can only accept commands while in the connected state

Now I am not able to connect my device ...even its not getting scan by NRF connect app.

Parents
  • Its iOS app using Nordic type app with custom framework. While a tried to update 3 character then only it crashed. I was able to update single character successfully... like date

    written code:

    let bytes : [UInt8] = [ 0x00, 0x09, 0x98 , 0x88, 0x83, 0x92, 0xD3, 0x39, 0x39, 0x39, 0x39, 0x39 ] let datar = Data(bytes:bytes) deviceNameCharacterToUpdate?.service.peripheral.writeValue(datar as Data, for: deviceNameCharacterToUpdate!, type: CBCharacteristicWriteType.withResponse)

        let bytess : [UInt8] = [ 0x43, 0x67, 0x61 , 0x6E, 0x64, 0x72, 0x61, 0x20 ]
        let dataLoca = Data(bytes:bytess)
        locationCharacterToUpdate?.service.peripheral.writeValue(dataLoca as Data, for: locationCharacterToUpdate!, type: CBCharacteristicWriteType.withResponse)
    
        
        let data = self.dataWithHexString(hex: hexDateToWrite)
        dateCharacterToUpdate?.service.peripheral.writeValue(data, for: dateCharacterToUpdate!, type: CBCharacteristicWriteType.withResponse)
    
Reply
  • Its iOS app using Nordic type app with custom framework. While a tried to update 3 character then only it crashed. I was able to update single character successfully... like date

    written code:

    let bytes : [UInt8] = [ 0x00, 0x09, 0x98 , 0x88, 0x83, 0x92, 0xD3, 0x39, 0x39, 0x39, 0x39, 0x39 ] let datar = Data(bytes:bytes) deviceNameCharacterToUpdate?.service.peripheral.writeValue(datar as Data, for: deviceNameCharacterToUpdate!, type: CBCharacteristicWriteType.withResponse)

        let bytess : [UInt8] = [ 0x43, 0x67, 0x61 , 0x6E, 0x64, 0x72, 0x61, 0x20 ]
        let dataLoca = Data(bytes:bytess)
        locationCharacterToUpdate?.service.peripheral.writeValue(dataLoca as Data, for: locationCharacterToUpdate!, type: CBCharacteristicWriteType.withResponse)
    
        
        let data = self.dataWithHexString(hex: hexDateToWrite)
        dateCharacterToUpdate?.service.peripheral.writeValue(data, for: dateCharacterToUpdate!, type: CBCharacteristicWriteType.withResponse)
    
Children
No Data
Related