Exemple #1
0
def SetNotificationRegistration(c, connect):
    happ = headers.App_Parameters('\x0e\x01' + ('\x01' if connect else '\x00'))
    c.put(
        name="",
        file_data='\x30',
        header_list=[headers.Type("x-bt/MAP-NotificationRegistration"), happ])
    print("Notification Registration:" + str(connect))
Exemple #2
0
def GetMessage(c, handle):
    resp = c.get(name=handle,
                 header_list=[
                     headers.Type('x-by/message'),
                     headers.App_Parameters('\x14\x01\x01')
                 ])
    return resp
Exemple #3
0
def PushMessage(c, t, f, body):
    resp = c.put(name="outbox",
                 file_data=msg,
                 header_list=[
                     headers.Type("x-bt/message"),
                     headers.App_Parameters('\x14\x01\x01')
                 ])
    return resp
Exemple #4
0
def GetMessageListing(c, params):
    resp = c.get(name="inbox",
                 header_list=[
                     headers.Type("x-bt/MAP-msg-listing"),
                     headers.App_Parameters(params)
                 ])
    #headers.App_Parameters('\x10\x04\x00\x00\x10\x6b\x13\x01\xff')])
    return resp
Exemple #5
0
 def push_message(self, folder, message):
     response = self.put(folder,
                         message,
                         header_list=[
                             self.connection_id,
                             headers.Type("x-bt/message"),
                             headers.App_Parameters("\x0A\x01")
                         ])
     if not isinstance(response, responses.Success):
         raise Exception
Exemple #6
0
 def set_message_status(self, message_id, indicator, value):
     app_param = "\x17" + indicator + "\x18" + value
     response = self.put(message_id,
                         str(0x30),
                         header_list=[
                             self.connection_id,
                             headers.Type("x-bt/messageStatus"),
                             headers.App_Parameters(app_param)
                         ])
     if not isinstance(response, responses.Success):
         raise Exception
Exemple #7
0
 def get_message(self, message_id):
     response = self.get(header_list=[
         self.connection_id,
         headers.Name(message_id),
         headers.Type("x-bt/message"),
         headers.App_Parameters("\x0A\x01\x14\x01")
     ])
     if isinstance(response, responses.FailureResponse):
         raise Exception()
     header, data = response
     return data
Exemple #8
0
    def get_message_listing(self):
        response = self.get(header_list=[
            self.connection_id,
            headers.Type("x-bt/MAP-msg-listing"),
            headers.App_Parameters(str(0x060))
        ])

        if isinstance(response, responses.FailureResponse):
            raise Exception()
        header, data = response
        return data
Exemple #9
0
 def set_notification_registration(self):
     response = self.put(
         "",
         str(0x30),
         header_list=[
             self.connection_id,
             headers.Type("x-bt/MAP-NotificationRegistration"),
             headers.App_Parameters(str(0x0e1))
         ])
     if not isinstance(response, responses.Success):
         raise Exception(response)