Posted by amirn
on June 23, 2009 at 2:55 PM PDT
mpe_Error mpeos_podReceiveAPDU(uint32_t* sessionId, uint8_t **apdu, int32_t *len)
the mpeos_podReceiveAPDU call passes a pointer to where the APDU pointer is returned.
The way the api is defined requires the pod code to allocate a buffer to hold the APDU and thus return a pointer to pod allocated memory.
The api does not state that the caller is responsible for freeing the memory, nor how the memory should be allocated (malloc, etc).
Should the caller of this API allocate and deallocate the APDU buffer or should the implementation be responsible for it.
If the later case is assumed, shouldn't this API be asynchronous (i.e should it take an event queue argument). Retrieving APDU data from the CableCard *is* an asynchronous process.