~nherriot/bcm/trunk

« back to all changes in this revision

Viewing changes to src/core/plugins/devices/option_gi0335.py

  • Committer: andrewbird
  • Date: 2010-06-29 13:47:38 UTC
  • Revision ID: svn-v4:302e0824-f0b9-4af8-b993-bc22a3d40462:trunk:903
Core - Add Option GI0355 stick

Requires Kernel upgrade to 2.6.33+, else hso driver PID mod.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# Copyright (C) 2010  Vodafone España, S.A.
 
3
# Author:  Andrew Bird
 
4
#
 
5
# This program is free software; you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License as published by
 
7
# the Free Software Foundation; either version 2 of the License, or
 
8
# (at your option) any later version.
 
9
#
 
10
# This program is distributed in the hope that it will be useful,
 
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
# GNU General Public License for more details.
 
14
#
 
15
# You should have received a copy of the GNU General Public License along
 
16
# with this program; if not, write to the Free Software Foundation, Inc.,
 
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
18
 
 
19
from wader.common.hardware.option import (OptionHSOWCDMADevicePlugin,
 
20
                                          OptionHSOWCDMACustomizer,
 
21
                                          OptionHSOWrapper)
 
22
 
 
23
 
 
24
class OptionGI0335Wrapper(OptionHSOWrapper):
 
25
 
 
26
    def find_contacts(self, pattern):
 
27
        d = self.list_contacts()
 
28
        d.addCallback(lambda contacts:
 
29
                        [c for c in contacts
 
30
                           if c.name.lower().startswith(pattern.lower())])
 
31
        return d
 
32
 
 
33
 
 
34
class OptionGI0335Customizer(OptionHSOWCDMACustomizer):
 
35
    wrapper_klass = OptionGI0335Wrapper
 
36
 
 
37
 
 
38
class OptionGI0335(OptionHSOWCDMADevicePlugin):
 
39
    """:class:`wader.common.plugin.DevicePlugin` for Options's GI0335"""
 
40
    name = "Option GI0335"
 
41
    version = "0.1"
 
42
    author = u"Andrew Bird"
 
43
    custom = OptionGI0335Customizer()
 
44
 
 
45
    __remote_name__ = "GlobeTrotter HSPA Modem"
 
46
 
 
47
    __properties__ = {
 
48
          'ID_VENDOR_ID': [0xaf0],
 
49
          'ID_MODEL_ID': [0x8300],
 
50
    }
 
51
 
 
52
option_gi0335 = OptionGI0335()