User`s guide

Aironet Wireless Communications, Inc. 7-34 Confidential and Proprietary
Reading and Writing RIDs
Reading and writing RIDs requires use of commands in addition to the BAP registers.
Prior to reading or writing the RID, the Access RID command must be issued. Also after modifying a RID,
the Access RID command must be used to commit the changes.
static tds4500command cmd; /* for issuing commands */
static tds4500response rsp; /* response from commands */
int PC4500_accessrid(u16 rid, u16 accmd)
{
u16 status;
memset(&cmd, 0, sizeof(cmd));
cmd.command = accmd;
cmd.param[0] = rid;
status = PC4500_command(&cmd, &rsp);
if (status != 0) return status;
if ( (rsp.status & 0x7F00) != 0) {
return (accmd << 8) + (rsp.response[0] & 0xFF);
}
return 0;
}
int PC4500_readrid(u16 rid, void *pBuf, int len)
{
u16 status;
if ( (status = PC4500_accessrid(rid, CMD_ACCESS)) != 0) return status;
if (bap0_setup(rid, 0) != SUCCESS) return ERROR;
// read the rid length field
bap0_read(pBuf, 2);
// length for remaining part of rid
len = min(len, *(u16*)pBuf) - 2;
// read remainder of the rid
return bap0_read(((u16*)pBuf)+2, len);
}
int PC4500_writerid(u16 rid, const void *pBuf, int len)
{
u16 status;
// --- first access so that we can write the rid data
if ( (status = PC4500_accessrid(rid, CMD_ACCESS)) != 0) return status;
// --- now write the rid data