/* put a little endian short (16bits) to a pointer 
Caller should ensure parameters are valid. */
void BytesPutLe16(void *ptr, uint16_t v)
/* put a little endian short (16bits) to a pointer 
Caller should ensure parameters are valid. */
void BytesPutLe16(void *ptr, uint16_t v)
{
    uint8_t *p = (uint8_t *)ptr;
    p[0] = v & 0xff;
    p[1] = (v >> 8) & 0xff;
}