NAOqi Core - Overview | API | NotificationInfo
Namespace : AL
#include <alproxies/alnotificationmanagerproxy.h>
As any module, this module inherits methods from ALModule API. It also has the following specific methods:
Adds a new Notification. As soon as it is added, the event notificationAdded() is raised.
Parameters: |
|
---|---|
Returns: | The notification identifier. |
# -*- encoding: UTF-8 -*-
#!/usr/bin/env python
from naoqi import ALProxy
ROBOT_IP = "127.0.0.1"
alnotificationmanager = ALProxy("ALNotificationManager", ROBOT_IP, 9559)
notificationId = alnotificationmanager.add({"message": "Hello World!", "severity": "info", "removeOnRead": True})
print "Notification ID: " + str(notificationId)
Removes a Notification. As soon as it is removed, the event notificationRemoved() is raised.
Parameters: |
|
---|
# -*- encoding: UTF-8 -*-
#!/usr/bin/env python
from naoqi import ALProxy
ROBOT_IP = "127.0.0.1"
alnotificationmanager = ALProxy("ALNotificationManager", ROBOT_IP, 9559)
# add new notification
notificationId = alnotificationmanager.add({"message": "Hello World!", "severity": "info", "removeOnRead": True})
print "Notification ID: " + str(notificationId)
# delete the notification
alnotificationmanager.remove(notificationId)
Returns the NotificationInfo corresponding to the given notification identifier. The notification is represented as an ALValue (see NotificationInfo).
Parameters: |
|
---|---|
Returns: | The notificationInfo of the given notification identifier. |
Throw : | An ALError, if the identifier doesn’t exist. |
Returns the list of pending NotificationInfos.
Returns: | An array of NotificationInfos contained in an ALValue (see NotificationInfo). |
---|
# -*- encoding: UTF-8 -*-
#!/usr/bin/env python
from naoqi import ALProxy
ROBOT_IP = "127.0.0.1"
alnotificationmanager = ALProxy("ALNotificationManager", ROBOT_IP, 9559)
notifications = alnotificationmanager.notifications()
for notification in notifications:
notifDict = dict(notification)
print "Notification ID: " + str(notifDict["id"])
print "\tMessage: " + notifDict["message"]
print "\tSeverity: " + notifDict["severity"]
print "\tRemove On Read: " + str(notifDict["removeOnRead"])
print "-----------\n"
Raised when a new notification has been added.
Parameters: |
|
---|
Raised when a notification has been removed. It can be discarded either if it is read or not valid anymore.
Parameters: |
|
---|