Extracting 15-bit integer values from binary with pattern matching

(I’m no expert in this)

Looks like this goes per 8 bits so:

iex(225)> <<_::1, number::15-integer-little-signed>> = <<1::1, 254::8, 127::7>>
<<255, 127>>
iex(226)> number
-2

So: first bit is ignored by you, then 8 bits with 2^7..2^0, then sign::1, then 6 bit 2^13..2^8.
So last chunk is 7 bits with first bit as sign.

Please correct me if I’m wrong, I just figured this out with iex.
Try to debug with this:

<<_::1, number::15-integer-little-signed>> = <<1::1, 1::1, 1::1, 1::1, 1::1, 1::1, 1::1, 1::1, 1::1, 1::1, 1::1, 1::1, 1::1, 1::1, 1::1, 1::1>> 

Edit:
So just add the ignored bit to the beginning, and reduce the size of the last integer by 1 bit.

<<1::1, 255::8, 127::7>>