# Path: pyilper/pilcore.py
# def isWINDOWS():
#    return platform.system()=="Windows"


import serial,time
from .pilcore import isWINDOWS


class cls_rs232:
 
   def __init__(self,parent=None):
      self.__device__= None
      self.__isOpen__= False
      self.__timeout__=0

#
#  Windows needs much time to reconfigure the timeout value of the serial
#  device, so alter the device settings only if necessary. Give the device
#  some time to settle.
#
   def __settimeout__(self,timeout):
      if timeout != self.__timeout__:
         try:
            self.__ser__.timeout= timeout
         except:
            raise Rs232Error('cannot set timeout value of serial device')
         self.__timeout__=timeout

   def isOpen(self):
      return self.__isOpen__


   def open(self,device,baudrate):
#
#     use Windows device naming (hint by cg)
#

# Path: pyilper/pilcore.py
# def isWINDOWS():
#    return platform.system()=="Windows"


# Path: pyilper/pilrs232.py
import serial,time
from .pilcore import isWINDOWS



class cls_rs232:
 
   def __init__(self,parent=None):
      self.__device__= None
      self.__isOpen__= False
      self.__timeout__=0

#
#  Windows needs much time to reconfigure the timeout value of the serial
#  device, so alter the device settings only if necessary. Give the device
#  some time to settle.
#
   def __settimeout__(self,timeout):
      if timeout != self.__timeout__:
         try:
            self.__ser__.timeout= timeout
         except:
            raise Rs232Error('cannot set timeout value of serial device')
         self.__timeout__=timeout

   def isOpen(self):
      return self.__isOpen__


   def open(self,device,baudrate):
#
#     use Windows device naming (hint by cg)
#

      if isWINDOWS():