IanHarvey / bluepy

Python interface to Bluetooth LE on Linux
Other
1.59k stars 491 forks source link

write characteristic error #363

Open Sidlotia opened 5 years ago

Sidlotia commented 5 years ago

hello. i am using blue py and i am getting error as write characteristic needs 3 atleast 3 arguments 0 given,can you help me out? this is my code snippet

import sys from bluepy.btle import UUID, Peripheral

if len(sys.argv) != 2: print "Fatal, must pass device address:", sys.argv[0], "" quit()

p = Peripheral(sys.argv[1],"public")

def writeCharacteristic(self, handle, val, withResponse=False):

Without response, a value too long for one packet will be truncated,

    # but with response, it will be sent as a queued write
    cmd = "wrr" if withResponse else "wr"
    self._writeCmd("%s %X %s\n" % (cmd, handle,

binascii.b2a_hex(val).decode('utf-8'))) return self._getResp('wr')

writeCharacteristic()

RahulNagesh commented 5 years ago

hey i have the same issue , help me too