[Bacnet-developers] TSM, invoke IDs
Brought to you by:
skarg
From: <tom...@sw...> - 2010-04-19 12:53:28
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, BACnetters (BACnetizens?) I have a icouple of questions question wrt tsm.c: 1. Freeing the invoke ID ======================== Normally, the application is responsible for freeing transaction numbers (aka "invoke IDs" as the standard calls them), as can be een, e.g. in readprop, which cleans up (tsm_free_invoke_id() on succesful receipt of the answer and on timeout. But there are some cases (src/apdu.c) where the library does the freeing itself (sorted by pdu type / service choice): - PDU_TYPE_SIMPLE_ACK / SERVICE_CONFIRMED_REQUEST_KEY - PDU_TYPE_COMPLEX_ACK / SERVICE_CONFIRMED_AUTHENTICATE - PDU_TYPE_SEGMENT_ACK - PDU_TYPE_ERROR - PDU_TYPE_REJECT - PDU_TYPE_ABORT What is the rationale behind that? How does the application decide when *not* to free the invoke ID? 2. Linear searches in the TSM_List ================================== Is there any particular reason not to index the TSM_List array directly by the invoke ID? This would save us a linear search for each answer received. The only visible difference would be that we wouldn't use the whole range 0..255 (or in the current implementation 1..255 anyway) of invoke IDs when MAX_TSM_TRANSACTIONS < 255. Would this make sense? If there is consensus on it, I'd be happy to prepare a patch along these lines, but I'd like to have some opinion on it -- maybe I'm missing something obvious. Thanks for any input - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFLzFGeBcgs9XrR2kYRAkjEAJ4lOxXIbf2b6xwt6jUWsI903qHb9QCfUqO8 Gle9ANLOD9CajRu0rOXEwXs= =vrIV -----END PGP SIGNATURE----- |