Intrusion Detection System#
Overview#
The Intrusion Detection System (IDS) provides a comprehensive security monitoring framework for Bluetooth Low Energy applications. This interface defines various security events that can be detected across different layers of the Bluetooth LE stack and provides mechanisms to register callbacks and handle security incidents.
Event Types#
The idsEventType_t enumeration defines various security events that can be detected:
Usage Example#
The user must set the gIntrusionDetectionSystem_d define to 1 in the application’s app_preinclude.h header. The IDS_RegisterCallback() API is used to register a callback for events specified via an event mask.
/* Register for specific security events */
uint32_t eventMask = gSecEvt_MicFailureDisconnect_c |
gSecEvt_UnexpectedSmpMessage_c |
gSecEvt_MalformedAtt_c;
IDS_RegisterCallback(securityEventHandler, eventMask);
The security events can then be handled in the registered callback.
/* Callback function to handle security events */
void securityEventHandler(idsEventData_t *pEventData) {
/* Handle the security event based on type */
switch(pEventData->type) {
case gSecEvt_MicFailureDisconnect_c:
/* Handle MIC failure */
break;
case gSecEvt_UnexpectedSmpMessage_c:
/* Handle unexpected SMP message */
break;
/* ... handle other events */
}
}
The IDS provides comprehensive security monitoring capabilities for Bluetooth LE applications, helping to detect and respond to various known attack vectors and security vulnerabilities.