# Diag Data ID Storage Service

- [API reference](https://docs.qualcomm.com/doc/80-41102-2/topic/_doxygen_rst_file__doxygen_sources_taf_diagDidStore_interface_h.html#file-taf-diagdidstore-interface-h)

[Plugin APIs](https://docs.qualcomm.com/doc/80-41102-2/topic/_doxygen_rst_file__doxygen_sources_include_plugin_tafPiDiagDID_h.html#file-tafpidiagdid-h)

The diag DataIDStore service provides APIs for read, write and DID change notification. The plugin reads and writes data associated with the DID from vehicle systems storage. Did notification allows the application to receive notifications when the data associated with a specific DID changes.

## IPC interfaces binding

The functions of this API are provided by the **tafDidStoreSvc** platform service.

The following example illustrates how to bind to the diag DataIDStore service.

bindings:
    {
         clientExe.clientComponent.taf_diagDidStore -> tafDidStoreSvc.taf_diagDidStore
    }
    Copy to clipboard

## Server-service APIs

Get a diag DataID storage service reference using the [taf\_diagDidStore\_GetService()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00365_1a97a6fbf647bceafb9c217234e5f77570.html#Documentationa00365_1a97a6fbf647bceafb9c217234e5f77570) API. Use the returned reference for subsequent operations.

The following example illustrates how to set up a diag DataID storage server service instance.

taf_diagDidStore_ServiceRef_t svcRef;    // Service reference
    
    // Get the service reference.
    svcRef = taf_diagDidStore_GetService();
    LE_ASSERT(svcRef != NULL);
    Copy to clipboard

- [taf\_diagDidStore\_Read()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00365_1abc4a840115ce862765ed3a06dcc3e180.html#Documentationa00365_1abc4a840115ce862765ed3a06dcc3e180) — Reads the data record of the DID.
- [taf\_diagDidStore\_Write()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00365_1abd7e111b1fa79e901c3ea741847f4956.html#Documentationa00365_1abd7e111b1fa79e901c3ea741847f4956) — Writes the data record to given DID.

An application must call [taf\_diagDidStore\_AddDataIdChangeHandler()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00365_1ae906bc9b4931830225d21de64e9ce657.html#Documentationa00365_1ae906bc9b4931830225d21de64e9ce657) first to register a handler for a DataID to get the change notification. To receive notifications for additional DataID, an application should call [taf\_diagDidStore\_AddDIDToHandler()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00365_1a75f88dd0226fe5e504f5527ece4d802e.html#Documentationa00365_1a75f88dd0226fe5e504f5527ece4d802e) and [taf\_diagDidStore\_RemoveDIDFromHandler()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00365_1a0ef6d544395a7eb2768c3acd6d7136f3.html#Documentationa00365_1a0ef6d544395a7eb2768c3acd6d7136f3) to add/remove the DataID by passing the service reference along with the desired DataID. If a change occurs in any of registered DataID, the service triggers the handler and provides the updated value for the corresponding DataID.

// Rx DataID change handler function.
    void DataIdChangeHandler
    (
         uint16_t dataId,
         const uint8_t* dataRecordPtr,
         size_t dataRecordSize,
         void* contextPtr
    )
    {
         // Process after DataID record change
    }
    
    // Register the DataID change handler.
    uint16_t dataId = 0xA5A6;
    taf_diagDidStore_DataIdChangeHandlerRef_t handlerRef =
        taf_diagDidStore_AddDataIdChangeHandler(svcRef, dataId,
             (taf_diagDidStore_DataIdChangeHandlerFunc_t)DataIdChangeHandler, NULL);
    LE_ERROR_IF((handlerRef == NULL), "taf_diagDidStore_AddDataIdChangeHandler returns NULL!");
    
    // Add the DataID to get the change notification.
    uint16_t dataId = 0xF011;
    le_result_t result = taf_diagDidStore_AddDIDToHandler(svcRef, dataId);
    if (result != LE_OK || result != LE_DUPLICATE){
     LE_ERROR("Fail to add DataID");
     return result;
    }
    
    // Remove the DataID.
    uint16_t dataId = 0xF011;
    le_result_t result = taf_diagDidStore_RemoveDIDFromHandler(svcRef, dataId);
    if (result != LE_OK || result != LE_NOT_FOUND){
     LE_ERROR("Fail to remove DataID");
     return result;
    }
    
    // To remove the handler function, when it is not needed.
    taf_diagDidStore_RemoveDataIdChangeHandler(handlerRef);
    Copy to clipboard

Last Published: Jun 09, 2026

[Previous Topic
Diag Update Service](https://docs.qualcomm.com/bundle/publicresource/80-41102-2/topics/page_c_tafDiagUpdate.md) [Next Topic
eCall Service](https://docs.qualcomm.com/bundle/publicresource/80-41102-2/topics/page_c_tafecall.md)