def getshort(data, index): # return two bytes from data as a signed 16-bit value return c_short((data[index + 1] << 8) + data[index]).value