Safeguard Management Programming Manual (G06.29+, H06.08+, J06.03+)
Example of Sharing a Binary Description Field
Safeguard Management Programming Manual—422086-028
B-2
strcpy(&v[0].info[2], "Safeguard Subsystem - T9750");
/* v[0] will contain nonprintable data. */
BinaryBuf.length = sizeof(struct vendor);
sprintf(BinaryBuf.string,"%s%d%s", v[0].ssid,
v[0].length, v[0].info);
2. Add the binary description field to the user/alias record using an SPI procedure.
For example:
SSPUTTKN (spibuf, tok, (char*)value,,(short*)&sfg_ssid);
where
spibuf is the SPI buffer to be sent.
tok is the binary description token ZSFG-TKN-DESC_BIN.
value is the structure (BinaryBuf) to be stored in the binary description
record.
sfg_ssid is the Safeguard subsystem ID.
3. Share the code with a second vendor:
a. Retrieve the binary description field of the first vendor using the INFO
command through the SPI interface and extract the binary description token by
using SPI procedures. For example:
SSGETTKN (spibuf, tok, (char*)value ,,,
(short*)&sfg_ssid);
where
spibuf is the SPI buffer received.
tok is the binary description token ZSFG_TKN_DESC_BIN.
value is the structure (BinaryBuf) to receive the binary description field.
sfg_ssidis the Safeguard subsystem ID.
b. Append the second vendor’s information to BinaryBuf, as follows
(BinaryBuf.length contains the length of the first vendor’s information.):
memset ((char*)&v[1], ’0’, sizeof(v[1]));
strcpy (v[1].ssid, "HP ");
v[1].length = 217;
v[1].info[0] = 21;
v[1].info[1] = 7;
strcopy (&(v[1].info[2], "Safeguard Subsystem - T9750");
/* v[1].info will contain nonprintable data */
sprintf (&(BinaryBuf.string[BinaryBuf.length]),
"%s %d %s", v[1].ssid, v[1].length, v[1].info);
BinaryBuf.length = 2*sizeof (struct vendor);