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.

write value to own attribute by network processor

Hi all,

I need to know, how is it possible to write values to added services and attributes in HostTestApp project, when the device is switched to peripheral mode and GATT database is stored off chip. I think the peripheral only can do GATT server which handle read/write requests from connected central device, but is it possible to write value to an attribute from controller?

I tried to write value by ATT_WriteReq command with loopback connection handle(0xFFFE), but this function required confirming ATT_WriteRsp event.
I looked for LPRF_BLE_NetworkProcessorGATT document, but there is no description for this case.
I will be very grateful for any advice, it is very import to me.

Thanks,

Martin Petřík

  • Hi Martin,

    GATT roles are independent of peripheral and central roles. So that being said, a peripheral can be a GATT client and/or GATT server.

    Take a look at the TimeApp project to see GATT client implemented in a peripheral role. Also note that the GATT client is initialized as follows:

      // Initialize GATT Client
      VOID GATT_InitClient();
    

  • Hi Zahid,

    Thanks for the response.

    Please check my mind - device init in peripheral mode to GAP layer and server for GATT layer. I can add services and attributes with GATT_AddService(0xfdfc) and GATT_AddAttribute (0xfdfe) functions. But now I need to setup created GATT database - write value to attributes. How can I do it?

    Is it possible to switch GATT role from server to client and perform loopback write request?

    e.g. call GATT_InitClient() function and then GATT_WriteCharValue with 0xFFFE connection handle?

    Thank you for help,

    Martin Petřík