1100D: PROPAD_GetPropertyData stub

#619 Declined
Repository
dmilligan
Branch
1100D_PROPAD_GetPropertyData
Repository
hudson
Branch
unified
Author
  1. David Milligan
Reviewers
Description
No description

Comments (2)

  1. Alex

    I'd rather refactor the code to use a plain prop handler, or get the values from the core, then remove this stub.

    "There should be one -- and preferably only one -- obvious way to do it."

  2. David Milligan author

    so for camera serial number, something like this?

    char camera_serial[32];
    
    PROP_HANDLER(PROP_BODY_ID)
    {
        /* different camera serial lengths */
        if(len == 8)
        {
            snprintf(camera_serial, sizeof(camera_serial), "%X%08X", (uint32_t)(*((uint64_t*)buf) & 0xFFFFFFFF), (uint32_t) (*((uint64_t*)buf) >> 32));
        }
        else if(len == 4)
        {
            snprintf(camera_serial, sizeof(camera_serial), "%08X", *((uint32_t*)buf));
        }
        else
        {
            snprintf(camera_serial, sizeof(camera_serial), "(unknown len %d)", len);
        }
    }
    

    Doesn't seem to work, at least not from a module, but I don't really know that much about how the property system works.