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))
def GetMessage(c, handle): resp = c.get(name=handle, header_list=[ headers.Type('x-by/message'), headers.App_Parameters('\x14\x01\x01') ]) return resp
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
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
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
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
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
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
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)