{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "PeripheralDetailItem",
    "type": "object",
    "additionalProperties": false,
    "description": "Information on a single peripheral device used in trip matching",
    "properties": {
        "id": {
            "type": "string",
            "description": "Unique ID of the peripheral device (e.g., MAC address)"
        },
        "name": {
            "type": "string",
            "description": "Name of the peripheral device"
        },
        "alias": {
            "type": "string",
            "description": "Alias of the peripheral device set by the user"
        },
        "device_type": {
            "type": "string",
            "description": "Type of peripheral device (e.g., car, speaker, receiver)"
        },
        "profiles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Profiles used by the device (e.g., A2DP, HFP)"
        },
        "rssi": {
            "type": "integer",
            "description": "Bluetooth RSSI signal level"
        },
        "protocol": {
            "type": "string",
            "enum": [
              "BLUETOOTH_LE",
              "BLUETOOTH_CLASSIC",
              "BLUETOOTH_DUAL",
              "BLUETOOTH_UNKNOWN",
              "CAR_PLAY",
              "AUDIO",
              "ANDROID_AUTO",
              "UNKNOWN"
            ],
            "description": "Protocol of the connection (e.g., Bluetooth_LE, Bluetooth_Classic, etc.)"
        },
        "connection_status": {
            "type": "string",
            "description": "Current status of the peripheral device connection (e.g., connected, paired, history)"
        },
        "matched_channel_client_id": {
            "type": "string",
            "description": "UUID of the matched car (if a match was found based on device details)"
        },
        "match_reason": {
            "type": "string",
            "$ref": "/resources/schema/analytics/client/v4/type/TripAssignmentReasonType.json",
            "description": "Reason for the match (or mismatch) in the context of channel_client_id"
        },
        "device_metadata": {
            "type": "string",
            "description": "Optional JSON data (as a string) with additional metadata for this peripheral device"
        }
    },
    "required": [
        "name"
    ]
}