Alerts Interface

2017. 5. 25. 17:49Architecture/A.I

반응형


Overview

Alert 인터페이스는 타이머와 알람을 설정, 관리 및 취소하는 데 사용되는 directive와  event를 제공합니다. 
AVS는 타이머와 알람을 설정하고 관리하기 위해 고객에게 지시를 보내지만 궁극적으로 인터넷 연결이 끊어 지거나 제품 내 시계가 NTP와 동기화되지 않으면 타이머와 알람을 관리하는 데 필요한 논리를 구현해야합니다. 
자세한 구현 세부 정보는 Understanding Alerts (Alerts 이해) 및 Interaction Model (상호 작용 모델)을 참조하십시오.

이 문서는 다음 주제를 다룹니다.
  • Alerts State Diagram
  • Alerts Directives and Events

State Diagram

다음 다이어그램은 Alerts 구성 요소에 의해 구동되는 상태 변경을 보여줍니다. 
Boxes는 Alerts 상태를 나타내고 connectors는 전환을 나타냅니다.

Alerts은 다음 상태를 지원합니다.
IDLE : 이전에 설정된 Alerts이 울리기 전에 Alerts 구성 요소가 IDLE 상태 여야합니다. 
alerts가 중지 / 완료되면 Alerts도 IDLE 상태로 되돌아 가야합니다. 
이것은 사용자 음성, 실제 버튼 누름 또는 GUI affordance의 결과로 발생할 수 있습니다.

FOREGROUND ALERT : 클라이언트 측 alert이 이미 설정되었다고 가정하면 alerts가 시작되고 AlertStarted 이벤트가 Alexa Voice Service로 전송되면 alerts는 IDLE 상태에서 alert foreground 상태로 전환해야합니다.

alerts 채널이 foreground에 있는 경우에만 해당되며 Dialog channel이 비활성 상태임을 나타냅니다. 
채널 및 채널 우선 순위에 대한 자세한 내용은 상호 작용 모델을 참조하십시오.

음성, 버튼 누름 또는 GUI 기능을 통해 Alerts가 중지되면 Alerts 구성 요소가 alert foreground 상태에서 IDLE 상태로 전환됩니다.
alerts가 울리는 동안 Dialog channel이 활성화되면 Dialog channel이 활성화되어있는 한 alerts 구성 요소는  foreground alerts 상태에서 background alert 상태로 전환해야합니다. Dialog channel이 비활성 상태가 되면 중지/완료 될 때까지 foreground alert상태로 되돌아 가야합니다.

BACKGROUND ALERT : Dialog channel이 활성화되면 Alerts 구성 요소는 background alert 상태로 전환해야합니다. 
채널 및 채널 우선 순위에 대한 자세한 내용은 상호 작용 모델을 참조하십시오.




SetAlert Directive

이 directive는 AVS에서 보내 지정된 시간이나 시간 동안 타이머 또는 알람을 설정하도록 클라이언트에 지시합니다. 
타이머 또는 알람을 설정하기위한 음성 요청 또는 Amazon Alexa 앱을 사용하여 이전에 설정된 알람을 다시 사용할 수있게 설정 한 
경우 클라이언트가 SetAlert Directive를 수신 할 수 있습니다.

Sample Message

{
    "directive": {
        "header": {
            "namespace": "Alerts",
            "name": "SetAlert",
            "messageId": "{{STRING}}",
            "dialogRequestId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "type": "{{STRING}}",
            "scheduledTime": "{{STRING}}"
        }
    }
}


Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string
dialogRequestId
A unique ID used to correlate directives sent in response to a specific Recognize event.

Note: dialogRequestId is only sent in response to a speech request. dialogRequestId is not included in directives sent to your client on the downchannel stream.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token that uniquely identifies the alert.
string
type
Identifies whether the alert is a timer or alarm. 
Accepted values: TIMER or ALARM.
string
scheduledTime
The scheduled time for an alert in ISO 8601 format.
string


SetAlertSucceeded Event

SetAlertSucceeded 이벤트는 SetAlert Directive를받은 후 클라이언트가 경고를 성공적으로 설정할 때  AVS로 보내야합니다.

Sample Message

{
    "event": {
        "header": {
            "namespace": "Alerts",
            "name": "SetAlertSucceeded",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}"
        }
    }
}


Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the SetAlert directive.
string



SetAlertFailed Event

SetAlertFailed 이벤트는 SetAlert Directive를받은 후 클라이언트가 alert를 설정하지 못한 경우 AVS로 보내야합니다.

Sample Message

{
    "event": {
        "header": {
            "namespace": "Alerts",
            "name": "SetAlertFailed",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}"
        }
    }
}


Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the SetAlert directive.
string


DeleteAlert Directive

이 Directive는 AVS에서 전송되어 클라이언트에게 특정 기간 또는 시간 동안 기존 타이머 또는 alert를 삭제하도록 지시합니다. 
클라이언트는 타이머 또는 알람을 취소/삭제할 음성 요청 또는 미리 설정된 alert가 Amazon Alexa 앱에서 삭제 된 경우 DeleteAlert Directive를 수신 할 수 있습니다.

Sample Message

{
    "directive": {
        "header": {
            "namespace": "Alerts",
            "name": "DeleteAlert",
            "messageId": "{{STRING}}",
            "dialogRequestId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}"
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string
dialogRequestId
A unique ID used to correlate directives sent in response to a specific Recognize event.

Note: dialogRequestId is only sent in response to a speech request. dialogRequestId is not included in directives sent to your client on the downchannel stream.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token that uniquely identifies the alert.
string

DeleteAlertSucceeded Event

DeleteAlertSucceeded 이벤트는 클라이언트가 기존 alert를 성공적으로 삭제하거나 취소 할 때 DeleteAlert Directive를 받은 후 AVS로 전송되어야합니다.
Note: For more information on when to send the DeleteAlertSucceeded event, please see Understanding Alerts.

Sample Message

{
    "event": {
        "header": {
            "namespace": "Alerts",
            "name": "DeleteAlertSucceeded",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}"
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the DeleteAlert directive.
string


DeleteAlertFailed Event

DeleteAlertFailed 이벤트는 클라이언트가 기존 alert를 삭제하거나 취소하지 못하는 DeleteAlert Directive를 수신 한 후 AVS로 보내야합니다.

Sample Message

{
    "event": {
        "header": {
            "namespace": "Alerts",
            "name": "DeleteAlertFailed",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}"
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the DeleteAlert directive.
string


AlertStarted Event

alert이 예정된 시간에 트리거되면 AlertStarted 이벤트를 AVS로 전송해야합니다.

Sample Message

{
    "event": {
        "header": {
            "namespace": "Alerts",
            "name": "AlertStarted",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}"
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the SetAlert directive.
string


AlertStopped Event

활성 alert가 중지되면 AlertStopped 이벤트를 AVS로 전송해야합니다. 
다음 두 가지 방법 중 하나로 alert를 중지 할 수 있습니다.

1. DeleteAlert Directive를 수신했습니다. AlertStopped 이벤트를 보낸 후에 클라이언트는 DeleteAlertSucceeded 이벤트 또는 DeleteAlertFailed 이벤트로 경고가 성공적으로 삭제 된 경우 AVS에 알려야합니다. 
    이 상호 작용은 alert 이해에 설명되어 있습니다. 
2. 물리적 컨트롤 (하드웨어 버튼 또는 GUI).

Sample Message

{
    "event": {
        "header": {
            "namespace": "Alerts",
            "name": "AlertStopped",
            "messageId": "{STRING}"
        },
        "payload": {
            "token": "{{STRING}}"
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the SetAlert directive.
string


AlertEnteredForeground Event

AlertEnteredForeground 이벤트는 활성 alert가 foreground로 들어가거나 (전체 볼륨으로 재생 될 때) 클라이언트에서 AVS로 전송되어야하며, Dialog channel의 동시 대화가 완료된 후 foreground로 다시 입력되어야합니다. 
채널 상호 작용에 대한 자세한 내용은 상호 작용 모델을 참조하십시오.

Sample Message

{
    "event": {
        "header": {
            "namespace": "Alerts",
            "name": "AlertEnteredForeground",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}"
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the SetAlert directive.
string


AlertEnteredBackground Event

Dialog 채널에서의 동시 상호 작용이 발생하는 동안 활성 alert가 foreground에서 나올 때 (감쇠 또는 일시 정지) AlertEnteredBackground 이벤트를 클라이언트에서 AVS로 보내야합니다. 
채널 상호 작용에 대한 자세한 내용은 상호 작용 모델을 참조하십시오.

Sample Message

{
    "event": {
        "header": {
            "namespace": "Alerts",
            "name": "AlertEnteredBackground",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}"
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided in the SetAlert directive.
string








반응형

'Architecture > A.I' 카테고리의 다른 글

챗GPT  (0) 2023.03.23
PlaybackController Interface  (0) 2017.05.26
Understanding Alerts  (0) 2017.05.26
AudioPlayer Interface  (0) 2017.05.24