{"action":"created","issue":{"url":"https://api.github.com/repos/NordicSemiconductor/IOS-DFU-Library/issues/3","repository_url":"https://api.github.com/repos/NordicSemiconductor/IOS-DFU-Library","labels_url":"https://api.github.com/repos/NordicSemiconductor/IOS-DFU-Library/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/NordicSemiconductor/IOS-DFU-Library/issues/3/comments","events_url":"https://api.github.com/repos/NordicSemiconductor/IOS-DFU-Library/issues/3/events","html_url":"https://github.com/NordicSemiconductor/IOS-DFU-Library/issues/3","id":140339078,"number":3,"title":"DFUServiceDelegate does not receive a StateCompleted event, although peripheral flashes fine","user":{"login":"starblanket","id":153975,"avatar_url":"https://avatars.githubusercontent.com/u/153975?v=3","gravatar_id":"","url":"https://api.github.com/users/starblanket","html_url":"https://github.com/starblanket","followers_url":"https://api.github.com/users/starblanket/followers","following_url":"https://api.github.com/users/starblanket/following{/other_user}","gists_url":"https://api.github.com/users/starblanket/gists{/gist_id}","starred_url":"https://api.github.com/users/starblanket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starblanket/subscriptions","organizations_url":"https://api.github.com/users/starblanket/orgs","repos_url":"https://api.github.com/users/starblanket/repos","events_url":"https://api.github.com/users/starblanket/events{/privacy}","received_events_url":"https://api.github.com/users/starblanket/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-12T02:41:54Z","updated_at":"2016-03-12T16:00:51Z","closed_at":null,"body":"The DFUServiceDelegate never receives a StateCompleted event with version 1.0 of the library. During a flashing update, the delegate receives these state changes: StateConnecting, StateStarting, StateEnablingDfuMode, StateStarting, StateUploading, StateValidating, StateDisconnecting. After receiving the StateDisconnecting event, I expected a StateCompleted event but instead the delegate is informed there was an error writing the \"activate and reset\" to the control point characteristic. It's not a legitimate error to report to the delegate though because the peripheral actually did reset.\r\n\r\n```\r\n-[OTAViewController didStateChangedTo:]:121 DFU state change to 4\r\n-[OTAViewController logWith:message:]:141 Data written to 00001531-1212-EFDE-1523-785FEABCD123\r\n-[OTAViewController logWith:message:]:141 Validate Firmware (Op Code = 4) request sent\r\n-[OTAViewController logWith:message:]:141 Notification received from 00001534-1212-EFDE-1523-785FEABCD123, value (0x):100401\r\n-[OTAViewController logWith:message:]:141 Response (Op Code = 4, Status = 1) received\r\n-[OTAViewController logWith:message:]:141 Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...\r\n-[OTAViewController logWith:message:]:141 peripheral.writeValue(0x05, forCharacteristic: 00001531-1212-EFDE-1523-785FEABCD123, type: WithResponse)\r\n-[OTAViewController didStateChangedTo:]:121 DFU state change to 5\r\n-[OTAViewController logWith:message:]:141 Data written to 00001531-1212-EFDE-1523-785FEABCD123\r\n-[OTAViewController logWith:message:]:141 Activate and Reset (Op Code = 5) request sent\r\n-[OTAViewController logWith:message:]:141 [Callback] Central Manager did disconnect peripheral\r\n-[OTAViewController logWith:message:]:141 Disconnected by the remote device\r\n-[OTAViewController didErrorOccur:withMessage:]:126 error 305 Writing to characteristic failed\r\n```\r\n\r\nI just want to add that this is great library -- it's made it so simple and the flashing is working reliably!"},"comment":{"url":"https://api.github.com/repos/NordicSemiconductor/IOS-DFU-Library/issues/comments/195766460","html_url":"https://github.com/NordicSemiconductor/IOS-DFU-Library/issues/3#issuecomment-195766460","issue_url":"https://api.github.com/repos/NordicSemiconductor/IOS-DFU-Library/issues/3","id":195766460,"user":{"login":"starblanket","id":153975,"avatar_url":"https://avatars.githubusercontent.com/u/153975?v=3","gravatar_id":"","url":"https://api.github.com/users/starblanket","html_url":"https://github.com/starblanket","followers_url":"https://api.github.com/users/starblanket/followers","following_url":"https://api.github.com/users/starblanket/following{/other_user}","gists_url":"https://api.github.com/users/starblanket/gists{/gist_id}","starred_url":"https://api.github.com/users/starblanket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starblanket/subscriptions","organizations_url":"https://api.github.com/users/starblanket/orgs","repos_url":"https://api.github.com/users/starblanket/repos","events_url":"https://api.github.com/users/starblanket/events{/privacy}","received_events_url":"https://api.github.com/users/starblanket/received_events","type":"User","site_admin":false},"created_at":"2016-03-12T16:00:51Z","updated_at":"2016-03-12T16:00:51Z","body":"The logs above are a record of everything that came to `[LoggerDelegate logWith:message:]`. All log levels were output (the `level` parameter was just ignored).\r\n\r\nThe peripheral's bootloader+app+SD was built using the most up to date code from http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822, which shows a version of \"Nordic BLE4.1 ver:8 fw:0067\" from `BLE::getVersion()`. I have trouble correlating this with anything on the Nordic site. From the documentation I've only seen that Soft Device S110 8.0.0 should have a fw id of 0x0064. If you know of a better way to find what version of the soft device is flashed, let me know.\r\n\r\n"}}