Imported from previous forum
Hi,
I am trying to understand the presence map better.
When I connect to my provider, the first byte I received is 0xC0, which is the presence map.
The first bit after the stop bit is 1 (0xC0=11000000), indicating the template ID exists.
And it does exist right after this byte (presence map).
My question is – does 0xC0 here indicate that none of the fields in that specific template exists (since the remaining bits are zeros in the presence map)?
However, the template has only 2 fields and 1 of them is mandatory:
Am I missing something?
Thanks in advance!
Hi,
0xC0 means that the only bit set is the first bit.
This is indeed the presence bit for template id.
The first field in the template is mandatory and has no operator so it doesn’t have a pmap entry and should always be present on the wire.
The second field is optional but it has no operator so it doesn’t have a pmap entry either and should always be present on the wire. An absent optional value is represented by a NULL that is encoded as a special value on the wire. Please refer to the specification section 10.6.3, esp the table at the end of the section.
So, in summary, you should see three SBIT-encoded fields following the pmap.
HTH,
Rolf
Hi,
I am trying to understand the presence map better.
When I connect to my provider, the first byte I received is 0xC0, which
is the presence map.The first bit after the stop bit is 1 (0xC0=11000000), indicating the
template ID exists.And it does exist right after this byte (presence map).
My question is – does 0xC0 here indicate that none of the fields in
that specific template exists (since the remaining bits are zeros in the
presence map)?However, the template has only 2 fields and 1 of them is mandatory:
Am I missing something?
Thanks in advance!
Hi Hei,
I am trying to understand the presence map better.
The presence map bits are only used for fields that might not be on the wire. The combination of field operator and presence attribute determines whether the bit is needed.
As Rolf explained, in your example, a field with no operator is ALWAYS on the wire, so no presence map bit is needed. If the string field is optional, and not included in the message it is still encoded on the wire as a null string.
Take a look at Google Code Archive - Long-term storage for Google Code Project Hosting.
This, along with careful reading of the specification that you can find at http://www.fixprotocol.org/fast should give you the information you need to understand how the presence map bits are used by various combinations of operator and presence attributes.
Dale
Thanks for the cheat sheet. It is very helpful ![]()
Hi Hei,
I am trying to understand the presence map better.
The presence map bits are only used for fields that might not be on the
wire. The combination of field operator and presence attribute
determines whether the bit is needed.As Rolf explained, in your example, a field with no operator is ALWAYS
on the wire, so no presence map bit is needed. If the string field is
optional, and not included in the message it is still encoded on the
wire as a null string.Take a look at Google Code Archive - Long-term storage for Google Code Project Hosting.
This, along with careful reading of the specification that you can find
at http://www.fixprotocol.org/fast should give you the information you
need to understand how the presence map bits are used by various
combinations of operator and presence attributes.Dale