Exemplo n.º 1
0
 def write(self, buffer):
     """Write raw bytes to the serial port.
     
     :param buffer: The buffer of bytes to write.
     :param count: The maximum number of bytes to write.
     :returns: The number of bytes actually written into the port.
     """
     return hal.writeSerial(self.port, buffer)
Exemplo n.º 2
0
 def write(self, buffer: bytes, count: int) -> int:
     """Write raw bytes to the serial port.
     
     :param buffer: The buffer of bytes to write.
     :returns: The number of bytes actually written into the port.
     """
     if len(buffer) < count:
         raise ValueError("buffer is too small, must be at least %d" % count)
     return hal.writeSerial(self.port, buffer)
Exemplo n.º 3
0
    def write(self, buffer: bytes) -> int:
        """Write raw bytes to the serial port.
        
        :param buffer: The buffer of bytes to write.

        :returns: The number of bytes actually written into the port.
        """
        # Python-Specific: No count parameter needed
        return hal.writeSerial(self.port, buffer)