Home | History | Annotate | Download | only in utils

Lines Matching refs:serial

12 "Phone serial number" - Serial number of the phone. This can be
18 "BattOr serial number" - Serial number of the BattOr. This can be
36 mapping between phone serial numbers and BattOr serial numbers, and
37 (2) getting the BattOr path corresponding to a given BattOr serial
42 [{'phone': <phone serial 1>, 'battor': <battor serial 1>},
43 {'phone': <phone serial 2>, 'battor': <battor serial 2>}, ...]
65 which takes a serial number mapping generated via step (1) and a phone
66 serial number, then gets the corresponding BattOr serial number from the
103 yield devnode.serial
107 """Reads JSON file giving phone-to-battor serial number map.
110 [{'phone': <phone serial 1>, 'battor': <battor serial 1>},
111 {'phone': <phone serial 2>, 'battor': <battor serial 2>}, ...]
113 indicating which phone serial numbers should be matched with
114 which BattOr serial numbers. Returns dictionary of the form:
116 {<phone serial 1>: <BattOr serial 1>,
117 <phone serial 2>: <BattOr serial 2>}
130 """Writes a map of phone serial numbers to BattOr serial numbers to file.
133 [{'phone': <phone serial 1>, 'battor': <battor serial 1>},
134 {'phone': <phone serial 2>, 'battor': <battor serial 2>}, ...]
136 indicating which phone serial numbers should be matched with
137 which BattOr serial numbers. Mapping is based on the physical port numbers
142 serial_map: Serial map {phone: battor}
151 """Generates a map of phone serial numbers to BattOr serial numbers.
154 {<phone serial 1>: <battor serial 1>,
155 <phone serial 2>: <battor serial 2>}
156 indicating which phone serial numbers should be matched with
157 which BattOr serial numbers. Mapping is based on the physical port numbers
173 # List of serial numbers in the system that represent BattOrs.
176 # If there's only one BattOr in the system, then a serial number ma
182 # port number to the serial number of that hub. For instance, in a 2
184 # where 'ab' and 'cd' are the phone serial numbers and 'jkl' and 'xyz'
185 # are the BattOr serial numbers.
194 # Map of {physical port number: [phone serial #, BattOr serial #]. This
200 for (port, serial) in hub.iteritems():
201 if serial in battor_serials:
205 port_to_devices[port].battor = serial
210 port_to_devices[port].phone = serial
213 # {phone serial number: BattOr serial number}.
226 """Generates a serial map file and writes it."""
229 def _PhoneToPathMap(serial, serial_map, devtree):
230 """Maps phone serial number to TTY path, assuming serial map is provided."""
232 battor_serial = serial_map[serial]
234 raise battor_error.BattorError('Serial number not found in serial map.')
238 if node.serial == battor_serial:
245 'Device with given serial number not a BattOr '
249 def GetBattorPathFromPhoneSerial(serial, serial_map=None,
254 phone serial numbers to BattOr serial numbers. This function will get the
255 TTY path for the given BattOr serial number.
260 BattOr serial numbers.
265 serial: Serial number of phone connected on the same physical port that
267 serial_map: Map of phone serial numbers to BattOr serial numbers, given
269 serial_map_file: Map of phone serial numbers to BattOr serial numbers,
278 ValueError: If serial number is not given.
288 if not serial:
290 'Two or more BattOrs connected, no serial provided')
298 tty_string = _PhoneToPathMap(serial, serial_map, devtree)
302 'No device with given serial number detected.')
308 'Device with given serial number is not a BattOr.')