Ejemplo n.º 1
0
  def prelude (self, args):
    if args.no_prelude:
      print "##### skipping prelude"
      return
    print "## do stuff with an insulin pump over RF"
    print "using", "`", args, "`"

    print "```"
    if args.port == 'scan' or args.port == "":
      args.port = scan.scan( )
    uart = stick.Stick(link.Link(args.port))
    print "```"
    print "```"
    uart.open( )
    print "```"
    print "```"
    pump = session.Pump(uart, args.serial)
    print "```"
    print "```"
    stats = uart.interface_stats( )
    print "```"
    print "```javascript"
    print pformat(stats)
    print "```"
    self.uart = uart
    self.pump = pump
    self.model = None
    if args.no_rf_prelude:
      print "##### skipping normal RF preludes"
      return
    print "```"
    if not args.autoinit:
      if args.init:
        pump.power_control(minutes=args.session_life)
      model = pump.read_model( )
      self.model = model
    else:
      self.autoinit(args)
    print "```"
    print '### PUMP MODEL: `%s`' % self.model
Ejemplo n.º 2
0
    def prelude(self, args):
        if args.no_prelude:
            print "##### skipping prelude"
            return
        print "## do stuff with an insulin pump over RF"
        print "using", "`", args, "`"

        print "```"
        if args.port == 'scan' or args.port == "":
            args.port = scan.scan()
        uart = stick.Stick(link.Link(args.port))
        print "```"
        print "```"
        uart.open()
        print "```"
        print "```"
        pump = session.Pump(uart, args.serial)
        print "```"
        print "```"
        stats = uart.interface_stats()
        print "```"
        print "```javascript"
        print pformat(stats)
        print "```"
        self.uart = uart
        self.pump = pump
        self.model = None
        if args.no_rf_prelude:
            print "##### skipping normal RF preludes"
            return
        print "```"
        if not args.autoinit:
            if args.init:
                pump.power_control(minutes=args.session_life)
            model = pump.read_model()
            self.model = model
        else:
            self.autoinit(args)
        print "```"
        print '### PUMP MODEL: `%s`' % self.model
Ejemplo n.º 3
0
 def scanner (self):
   from decocare.scan import scan
   return scan( )