def setSmallInteger2(self,name, value, value2, ignoreCurrent=False): writer = RemoteMeDataWriter() writer.writeUInt16(remotemeStruct.VariableType.SMALL_INTEGER_2._value_) writer.writeString(name) writer.writeInt16(value) writer.writeInt16(value2) self.__remoteMe.send( remotemeMessages.getVariableChangeMessage(self.__remoteMe.getDeviceId(), ignoreCurrent, writer.getBytes()))
def getDecreaseGuestKeyCreditAndTimeMessage(senderDeviceId, sessionId, credit, time): writer = RemoteMeDataWriter() writer.writeUInt16( remotemeStruct.MessageType.DECREASE_GUEST_CREDIT_AND_TIME._value_) writer.writeUInt16(8) writer.writeUInt16(senderDeviceId) writer.writeUInt16(sessionId) writer.writeInt16(credit) writer.writeInt16(time) return writer.getBytes()
def __sendNow(self,name,type): size = 2 + 2 + 2 + len(name) + 1 wr = RemoteMeDataWriter() wr.writeInt16(remotemeStruct.MessageType.OBSERVER_REGISTER_MESSAGE.value) wr.writeInt16(size) wr.writeInt16(self.__remoteMe.getDeviceId()) wr.writeInt16(1) wr.writeInt16(type.value) wr.writeString(name) self.__logger.debug("sending variable {} type:{}".format(name, type)) self.__remoteMe.send(wr.getBytes())