def _serialize(self, writer: BufferWriter): writer.putUInt8(self.itemCount) writer.putUInt8(self.itemSize) self.items.sort() for item in self.items: writer.putBytes(item)
def _serialize(self, writer: BufferWriter): writer.putUInt8(self.commandProtocolVersion) writer.putUInt8(self.filterId) writer.putUInt16(self.chunkStartIndex) writer.putUInt16(self.totalSize) writer.putUInt16(self.chunkSize) writer.putBytes(self.chunk)
def serialize(self): writer = BufferWriter() writer.putUInt8(self.type) writer.putUInt8(self.flags) writer.putUInt8(self.timeout_or_transmissions) writer.putUInt8(len(self.crownstoneIds)) for stoneId in self.crownstoneIds: writer.putUInt8(stoneId) writer.putBytes(self.payload) return writer.getBuffer()
def serialize(self): writer = BufferWriter() writer.putUInt8(len(self.packets)) for stonePacket in self.packets: writer.putBytes(stonePacket.serialize()) return writer.getBuffer()
def _toBuffer(self, writer: BufferWriter): self.header.toBuffer(writer) writer.putUInt16(self.offset) writer.putBytes(self.binaryChunk)
def _serialize(self, writer: BufferWriter): self.header.serialize(writer) writer.putUInt16(self.offset) writer.putBytes(self.binaryChunk)