EN CN
CMD_SET_ADJ_VARS_VAL format: conversion according to C-language format
  • In the serial API reference document it discusses an outgoing command called CMD_SET_ADJ_VARS_VAL. I am told that the format is 4b (4 bytes) and that

    "Values are packed according to the C-language memory model, little-endian order. 1- or 2-byte types converted to 4-byte using C-language type conversions."

    I have no experience in C programming. Could someone please give me an example or two of how I might pack a 1-byte unsigned integer into this 4 byte format?

    Thanks.
  • After some testing, it appears to be easier than I thought. Apparently you just pack three zeroes after the value you want to write. :-)