summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-02-07 13:30:17 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-02-07 13:49:00 +0200
commit1090c954ec64ae2c07523b8688bf732cf7344899 (patch)
treebbf59fa8e2bfd3509cffaeac156101b292be86a5 /test
parente859c032310b39658efdb1287e4c6ec000882a1a (diff)
downloadbluez-1090c954ec64ae2c07523b8688bf732cf7344899.tar.gz
test: Add -p/--push option to map-client
This option can be used to push messages, it takes as a parameter a file location which should contain the message in bmsg format.
Diffstat (limited to 'test')
-rwxr-xr-xtest/map-client13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/map-client b/test/map-client
index 34897cdc8..f3c657f73 100755
--- a/test/map-client
+++ b/test/map-client
@@ -51,6 +51,8 @@ def parse_options():
help="List messages in supplied CWD subdir")
parser.add_option("-g", "--get", action="store", dest="get_msg",
help="Get message contents")
+ parser.add_option("-p", "--push", action="store", dest="push_msg",
+ help="Push message")
parser.add_option("--get-properties", action="store", dest="get_msg_properties",
help="Get message properties")
parser.add_option("--mark-read", action="store", dest="mark_msg_read",
@@ -85,8 +87,7 @@ class MapClient:
signal_name="PropertiesChanged",
path_keyword="path")
- def create_transfer_reply(self, reply):
- (path, properties) = reply
+ def create_transfer_reply(self, path, properties):
self.transfer_path = path
self.props[path] = properties
if self.verbose:
@@ -147,6 +148,11 @@ class MapClient:
msg.Get("", True, reply_handler=self.create_transfer_reply,
error_handler=self.error)
+ def push_message(self, filename):
+ self.map.PushMessage(filename, "telecom/msg/outbox", dict(),
+ reply_handler=self.create_transfer_reply,
+ error_handler=self.error)
+
def get_message_properties(self, handle):
self.map.ListMessages("", dict())
path = self.path + "/message" + handle
@@ -201,6 +207,9 @@ if __name__ == '__main__':
if options.get_msg is not None:
map_client.get_message(options.get_msg)
+ if options.push_msg is not None:
+ map_client.push_message(options.push_msg)
+
if options.get_msg_properties is not None:
map_client.get_message_properties(options.get_msg_properties)