Adam-Langley / pybleno

A direct port of the Bleno bluetooth LE peripheral role library to Python2/3
MIT License
68 stars 34 forks source link

TypeError: can't multiply sequence by non-int of type 'float' #13

Closed enpboss closed 6 years ago

enpboss commented 6 years ago

Python version 2.7

Here is the bug log

pi@raspberrypi:~/pyle/pybleno/examples/batteryservice $ sudo python main.py      Hit <ENTER> to disconnect
on -> stateChange: poweredOn
on -> advertisingStart: success
setServices: success
Exception in thread HCISocketPoller:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pybleno/hci_socket/BluetoothHCI/BluetoothHCI.py", line 197, in _socket_poller
    self._socket_on_data_user_callback(bytearray(data))
  File "/usr/local/lib/python2.7/dist-packages/pybleno/hci_socket/Hci.py", line 417, in onSocketData
    self.emit('aclDataPkt', [handle, cid, pktData])
  File "/usr/local/lib/python2.7/dist-packages/pybleno/hci_socket/Emit.py", line 15, in emit
    handler(*arguments)
  File "/usr/local/lib/python2.7/dist-packages/pybleno/hci_socket/Bindings.py", line 167, in onAclDataPkt
    self._aclStream.push(cid, data)
  File "/usr/local/lib/python2.7/dist-packages/pybleno/hci_socket/AclStream.py", line 18, in push
    self.emit('data', [cid, data])
  File "/usr/local/lib/python2.7/dist-packages/pybleno/hci_socket/Emit.py", line 15, in emit
    handler(*arguments)
  File "/usr/local/lib/python2.7/dist-packages/pybleno/hci_socket/Gatt.py", line 255, in onAclStreamData
    self.handleRequest(data)
  File "/usr/local/lib/python2.7/dist-packages/pybleno/hci_socket/Gatt.py", line 293, in handleRequest
    response = self.handleFindInfoRequest(request)
  File "/usr/local/lib/python2.7/dist-packages/pybleno/hci_socket/Gatt.py", line 388, in handleFindInfoRequest
    response = array.array('B', [0] * (2 + numInfo * lengthPerInfo))
TypeError: can't multiply sequence by non-int of type 'float'

terminated.
Adam-Langley commented 6 years ago

Hi Poovizhirajan, Can you please provide your reproduction steps? Thanks.

Adam-Langley commented 6 years ago

Hi Poovizhirajan, I've made some fixed, can you please pull and try again? commit 93e95c08323ff5a16478b717df245a6cce9dad25 I cannot be sure this fill fix your issue however, without a clear reproduction.

Adam-Langley commented 6 years ago

Closing due to non-activity