Integer out of Range Kotlin Android Studio
val strValue = (characteristic.value[1].toInt().shl(8) or characteristic.value[2].toInt()).toUShort()
This code works well to 127. Then it moves to 65408. It looks:
123
124
125
126
127
65408
65409
65410
I tried .toUInt but with no effect. Basically this code connects two uint8 and makes uint16