adameus03 / LabMate

Lab asset management systems prototype
0 stars 0 forks source link

[RSCS] Handle tag embodiment #16

Open adameus03 opened 1 day ago

adameus03 commented 1 day ago

Writing '1' to rscs/uhfX/driver/embody should cause the rscs/uhfX property files (i.e. epc, access_passwd and kill_passwd) to be attempted to be rewritten over the physical medium into a single tag dev's "reserved" and "epc" memory (see GS1 epc class 1 gen2 standard) accessible via that medium. The YPD-R200 (nothing more for the current state of the project, maybe in the future...) board is already handled as well as the hw abstraction layer (uhfman).

Main operations to perform during the process:

Using the uhfman layer let's do appropriate dev in:

adameus03 commented 1 day ago
int uhfd_embody_dev(uhfd_t* pUHFD, uhfd_dev_t* pDev) {
    LOG_E("uhfd_embody_dev: not implemented");
    return -1;

    // Poll for first detected tag
    //...
    // Read tag EPC
    //...
    // Set select and query parameters such that we communicate only with that tag (see old_main.c)
    //...
    // Check if the EPC is already used by any tag and handle that (error? or warning? or not?)
    //...
    // Write access password and kill password (by default they are zeroes before doing anything. Should we allow embodying a tag which already has a non-zero password?)
    //...
    // Write EPC
    //...
    // Set the 'embodied' flag
    //...
    // Return
    //...
}
adameus03 commented 17 hours ago
/* ATTENTION
    *  WE NEED TO FIND OUT WHETHER WE CAN WRITE THE TAG USING GENERIC OR SPECIFIC SELECT BEFOREHAND
        - if generic - less code, and possibly quicker? We need to set the select and query parameters such that we communicate with any tag, while the non-zero password can protect the tag from being written unintentionally
        - if specific - more code, and possibly more reliable? We need to poll for the first detected tag and then use it's EPC
*/