Exemplo n.º 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))
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 5
0
Arquivo: MAS.py Projeto: eliasj/MAP
 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
Exemplo n.º 6
0
Arquivo: MAS.py Projeto: eliasj/MAP
 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
Exemplo n.º 7
0
Arquivo: MAS.py Projeto: eliasj/MAP
 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
Exemplo n.º 8
0
Arquivo: MAS.py Projeto: eliasj/MAP
    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
Exemplo n.º 9
0
Arquivo: MAS.py Projeto: eliasj/MAP
 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)