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

iOS DFU Writing to characteristic failed

I'm using the iOS latest iOSDFULibrary pods to import to my app. However, after I using DFUServiceIniciator service the log just show as attach.DFUQuestionLog.m

The only different with the Nordic iOS toolbox is the following line : 10: Packet Receipt Notif Req (Op Code= 8, Value = 12) request sent. Moreover, I used Nordic iOS toolbox did succeed to OTA the device.

My question is that is it the possible that the the DFUServiceInitiator didn't found the total characteristics in my App?

And if there is possible to fix ATT error, how would I change the iOSDFULibrary?

Thanks~

Update: full DFU log. /Users/dennislan/Desktop/DFUQuestionFullLog.m

Parents
  • After Several testing, I found out that the problem may be the same as the following link: github.com/.../24

    According to the log in Xcode, the Value for my case return 0

    ex. 10: Packet Receipt Notif Req (Op Code = 8, Value = 0) request sent

    As the upon link said, maybe the .packetReceiptNotificationParameter was modified by user to return 0. As the result, I modified with following example and it just suceed.

    DFUServiceInitiator *initiator = [[DFUServiceInitiator alloc] initWithCentralManager:bluetoothManager target:peripheral];
    NSString *selectedPath = [[NSBundle mainBundle] pathForResource:@"selectedfile" ofType:@"zip"];
             NSURL *url = [NSURL fileURLWithPath:selectedPath];
             selectedFirmware = [[DFUFirmware alloc] initWithUrlToZipFile:url];
             [initiator withFirmwareFile:selectedFirmware];
             initiator.forceDfu = [[[NSUserDefaults standardUserDefaults] valueForKey:@"dfu_force_dfu"] boolValue]; 
    // initiator.packetReceiptNotificationParameter = [[[NSUserDefaults standardUserDefaults] valueForKey:@"dfu_number_of_packets"] intValue];
    
             initiator.logger = self;
             initiator.delegate = self;
             initiator.progressDelegate = self;
             controller = [initiator start];
    
Reply
  • After Several testing, I found out that the problem may be the same as the following link: github.com/.../24

    According to the log in Xcode, the Value for my case return 0

    ex. 10: Packet Receipt Notif Req (Op Code = 8, Value = 0) request sent

    As the upon link said, maybe the .packetReceiptNotificationParameter was modified by user to return 0. As the result, I modified with following example and it just suceed.

    DFUServiceInitiator *initiator = [[DFUServiceInitiator alloc] initWithCentralManager:bluetoothManager target:peripheral];
    NSString *selectedPath = [[NSBundle mainBundle] pathForResource:@"selectedfile" ofType:@"zip"];
             NSURL *url = [NSURL fileURLWithPath:selectedPath];
             selectedFirmware = [[DFUFirmware alloc] initWithUrlToZipFile:url];
             [initiator withFirmwareFile:selectedFirmware];
             initiator.forceDfu = [[[NSUserDefaults standardUserDefaults] valueForKey:@"dfu_force_dfu"] boolValue]; 
    // initiator.packetReceiptNotificationParameter = [[[NSUserDefaults standardUserDefaults] valueForKey:@"dfu_number_of_packets"] intValue];
    
             initiator.logger = self;
             initiator.delegate = self;
             initiator.progressDelegate = self;
             controller = [initiator start];
    
Children
Related