This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

iOS OAD source code

The official SensorTag app on the App Store implements OAD on iOS. However, the source code in gitlab does not include OAD. Can Ti please share this code so we don't have to reinvent the wheel when using the OAD service profiles that come with the BLE stack. 

Thanks so much,

-r

  • Hello,

    Yes, the github iOS code does not implement OAD. I will see if there's any update planned to the public iOS source code.

    Best wishes
  • Thanks for looking into this. Short of getting the update source to the entire iOS app thats in the app store, it would be tremendously helpful to be able to see the relevant routines to initiate, perform and finish the OAD transfer of a firmware image.
  • We are working to bring a public OAD support to the existing github iOS sample application. As you may know, the app store ToS have implications on how source code can be released from a published store app. Unfortunately, I don't have a date as to when we will have it released on the public github site.

    For now, you can refer to the Android implementation. Hopefully this can serve as a guide for how to do the OAD service.

    Best wishes
  • JXS, while this is getting slight off-topic, from personal experience, i think the App Store GPL related passages refer to app store apps including GPL'd code. Assuming you wrote the OAD code yourself (Ti), i don't see any sections in the TOS that would prevent you from sharing some of the relevant lines of code here. 

  • Hi Pixbroker,

    could you implement the OAD yourself?
    I am also trying to implement it on my own program.

    Thanks,

    Michael
  • Hi pixbroker,

    i am using your code as base and want to implement the OAD Manager in Qt.
    To understand a little bit more i have few questions.
    After connecting to the OAD service, i first have to send an image information to the "OAD Image Block" characteristic.
    This information should look like this:


    Byte no Description Value
    0-1 CRC CRC16 calculated by client
    2-3 CRC shadow Not used, set to 0xFFFF
    4-5 Version Always '0 for SensorTag
    6-7 Length Length of image in blocks (block size = 16 bytes)
    8-11 User ID 'E','E', 'E', 'E' for SensorTag
    12-13 Address Starts address of image in block units (block size = 16 bytes)
    14 Image type Always '1' (application) for SensorTag
    15 Reserved Not used, set to 0xFF

    On the "OAD Image Identifyier" characteristic i will find out if the device accepts the image or not.
    If yes i will send the image data by writing 2x Blocks of 16bytes in the "OAD Image Block" characteristic right?

    Looking at the output .hex file i see this:

    :10100000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
    :201010006841002095820000CDA90000CDA90000CDA90000CDA90000CDA90000CDA900001C
    :1C103000CDA90000CDA90000CDA90000CDA90000CDA90000CDA900000FB0000021
    .
    .
    .
    :00000001FF


    The character ":" separate each line to be send right?
    Does each line contains 16Bytes ?
    What does the first and the last line means?

    On your code, what does the record type means?
    You have "DATA", "EXT_LIN_ADDR" and "EOF". How do you "see" those on the hex lines? (EOF = End Of FIle)?
    I am trying to understand your parseline() function too.

    Thanks,

    Michael
  • In my code, in OADFirmwareImage.swift,

    parseLines(...)

    turns the hex string into a binary blob (NSData) based on the intel hex spec described here:

    en.wikipedia.org/.../Intel_HEX

    imgIdentifyRequestData()

    will give you the data that you have to send to the identify char. or printHdr() will print it to the Xcode console.