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.

Good examples of GATT_DB_OFF_CHIP applications?

Other Parts Discussed in Thread: CC2541

First post here, I have been able to do a lot so far with the BLE stack on the CC2541 chips, except the ability to use the HostApp firmware with the gatt profile database being handle off chip.

I can configure the device into peripheral mode, see my advertising data on my BLE enabled device and connect. The problem comes when trying to figure out the format of some of the call backs that I need to respond to in order to operate correctly as a BLE device. I have been going about tediously reverse engineering every single command out of BTool, and testing because the output doesn't always correctly explain the format of the data. I have gotten most of the command to call back correctly, I am have particular issues with the response for ATT_ReadByTypeReq.


In BTool it simple states that this is a data list. Ok, great what's the format? After talking to another one of my BLE devices I was receiving responses that look like,

Handle: unsigned short

Descriptor Data: byte string

Trying to form the same message and sending it back doesn't seem to provide the correct response for the central device. The central device will either hang or disconnect with an error.

The document from TI titled "Network Processor GATT" was not very helpful. A very hastily written document that keeps making references to a program called HCITester.exe instead of actually explain in detail the response and request structor that the external MCU needs to provide.

If someone has some examples where they have an external MCU running as the GATT database handler that would be great. I would like to once I am done with this come up with an exhaustive tutorial on how to use this feature of the TI BLE firmware.

Thanks again,

Kieron

  • Hi Kieron,

    GATT_DB_OFF_CHIP means you need to have the entire GATT server off-line. Also you will need ATT parser and constructor. This is a lot of work.

    I would rather recommend that you follow one of the other examples on the wiki.

    CC254x With External MCU

    Best regards,
    Aslak

  • I have to say I am not fond of this answer at all.  The GATT_DB_OFF_CHIP is a specific example off the wiki (Network Processor GATT) and there are more people than just Kieron using it.  Just because it is complicated does not mean that it is not the ideal solution for a particular application and designers shouldn't avoid it just because the documentation is bad or it is complicated.

    The example however does only show how one request of many would be handled and is by no means thorough as pointed out.  Even other parts of the documentation leave questions unanswered.  I myself ALSO wonder how  ATT_ReadByTypeReq works as the HCI documentation states "The response with the status of bleProcedureComplete" will indicate the end of the sub-procedure".  However, I would expect the response would be a command with GATT_DB_OFF_CHIP because the request is an event (matching ATT_ReadReq and ATT_ReadRsp in  the example), but there is no way to indicate this status with a command as shown by the format in section 17.1 of the HCI documentation.

    Better examples would clearly demonstrate not only that it works (is this in question?) but the correct way to do it.

    Without your help we can only wonder.

    Nathan 

  • Hi Nathan,

    I apologize. What I mean to say is, we don't have any additional example except what you have seen and found lacking.

    Your second paragraph, I take it, refers to how an ATT Server should respond to ATT_ReadByTypeReq, or even ATT_ReadReq. In this case, the ATT server has an attribute table in memory, and knows all the handles. If and when a client requests handles that don't exist, you reply with an ATT_ErrorRsp(invalid handle) for ReadReq and Att_ArrorRsp(Attr not found) for ReadByTypeReq. bleProcedureComplete is the status provided to the ATT Client, not what the ATT Server has to send out.

    I refer you to the BLE 4.0 or 4.1 specification, Vol 3, Part F, Chapter 3.4.* for the protocol specification. Part G, Chapter 4.13 contains a useful mapping of GATT->ATT subprocedures.

    You can also refer to a sniffer log of communcation between two working devices to see what the appropriate responses are.

    Best regards,
    Aslak

  • Aslak,

    Thanks for the prompt response.

    I think where I got lost was with the wording of the TI Specific HCI documentation.  When it specified the bleProcedure is forwarded, I was assuming that meant a "local HCI client" (Network processor) as it is what is providing the responses.  I was not thinking this was referring to the ATT Client on the other side of the line, but from your statement I think I now get what the documentation is trying to say.

    I have not implemented this yet, but theoretically it should be straightforward and very powerful.  It still would be nice to have more examples of the TI vendor specific wrapping around ATT to prevent questions like this, as this is what is not commonly available and there are not examples which fully implement this to sniff the vendor specific HCI.  I agree, though, that the core specification is enough to implement the non-vendor specific data wrapped in the messages.  This core specification or how to implement an ATT server wasn't really ever a question for me.

    It is also important to have thorough examples to show customers that the TI provided software works as advertised (and in all the modes advertised), before we go through the effort of trying to make it work for ourselves.

    Thanks for your help.  I don't mean to be hard, I just wanted to reiterate the similar problem/request.

    Nathan

  • Hi Nathan,

    No, I agree with your statements. This is however somewhat low on the use-case number scale, so hasn't been prioritized enough.

    Best regards,
    Aslak