# Diag IDPS Service - [API reference](https://docs.qualcomm.com/doc/80-41102-2/topic/_doxygen_rst_file__doxygen_sources_taf_diagIDPS_interface_h.html#file-taf-diagidps-interface-h) IDPS Service provides APIs to applications to monitor diagnostic IDPS status. ## IPC interfaces binding The functions of this API are provided by the **tafDiagSvc** platform service. The following example illustrates how to bind to the Diag IDPS service. bindings: { clientExe.clientComponent.taf_diagIDPS -> tafDiagSvc.taf_diagIDPS } Copy to clipboard ## Get Diag IDPS service reference Get a Diag IDPS service reference using taf\_diagIDPS\_GetService(securityLevel) with the securityLevel passed as a parameter. Use the returned reference for subsequent operations. The following example illustrates how to set up a Diag IDPS server-service-instance. taf_diagIDPS_ServiceRef_t svcRef; // Service reference // Get the service reference. svcRef = taf_diagIDPS_GetService(securityLevel); LE_ERROR_IF((svcRef == NULL), "taf_diagIDPS_GetService returns NULL!"); Copy to clipboard ## Set VLAN ID After getting a service reference, an application can set the VLAN ID using [taf\_diagIDPS\_SetVlanId()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00377_1ae6613885b9c5361b59f2a3a2053da6bc.html#Documentationa00377_1ae6613885b9c5361b59f2a3a2053da6bc). It shall be called before registering the handler for the IDPS status notification message. - [taf\_diagIDPS\_SetVlanId()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00377_1ae6613885b9c5361b59f2a3a2053da6bc.html#Documentationa00377_1ae6613885b9c5361b59f2a3a2053da6bc) — Sets the VLAN ID. ## Tester OFF/ON notification API After getting the service reference, an application can call [taf\_diagIDPS\_AddStatusHandler()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00377_1a2d869e815bc55462683ed3380e90c357.html#Documentationa00377_1a2d869e815bc55462683ed3380e90c357) to register a handler for IDPS status notification. Once IDPS is detected, the handler is called with the IDPS status message reference, security level, service ID and status passed as input parameters. Finally, it calls [taf\_diagIDPS\_ReleaseStatusMsg()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00377_1ae7d0026c92f905cd1d495b501ba2f379.html#Documentationa00377_1ae7d0026c92f905cd1d495b501ba2f379) to release the IDPS status message. // IDPS status handler function. void IDPSStatusHandler ( taf_diagIDPS_StatusMsgRef_t statusMsgRef, taf_diagIDPS_SecurityLevel_t securityLevel, uint8_t serviceId, uint8_t status, void* contextPtr ) { // Process after IDPS detection } // Register the IDPS status handler. taf_diagIDPS_StatusHandlerRef_t handlerRef = taf_diagIDPS_AddStatusHandler(svcRef, (taf_diagIDPS_StatusHandlerRef_t)IDPSStatusHandler, NULL); LE_ERROR_IF((handlerRef == NULL), "taf_diagIDPS_AddStatusHandler returns NULL!"); // To get the logical addresses. uint16_t sourceAddr, targetAddr; result = taf_diagIDPS_GetLogicalAddr(statusMsgRef, &sourceAddr, &targetAddr); if (result != LE_OK) { LE_ERROR("Fail to get logical addresses."); return result; } // To release the tester state msg after getting the state change notification. le_result_t result = taf_diagIDPS_ReleaseStatusMsg(statusMsgRef); if (result != LE_OK) { LE_ERROR("Fail to release msg."); return result; } // To remove the handler function, when it is not needed. taf_diagIDPS_RemoveStatusHandler(handlerRef); Copy to clipboard Last Published: Jul 29, 2026 [Previous Topic Diag Event Management Service](https://docs.qualcomm.com/bundle/publicresource/80-41102-2/topics/page_c_tafDiagEvent.md) [Next Topic Diag IO control Service](https://docs.qualcomm.com/bundle/publicresource/80-41102-2/topics/page_c_tafDiagIOCtrl.md)