学习CC2533DK-RF4CE-BA开发套件一段时间了,有个问题想请教一下各位大侠们~
根据RF4CE标准,一个家庭只要一个遥控器即可控制所有家电,我的问题也就是关于这一方面的。
RF4CE的第一款套件(黑色遥控器那一款),键盘第二行定义了四个家电设备“TV,DVD,STB,AUX”,按照TI技术文档以及RemoTI1.3.1协议栈中的BasicRemote工程,在这几种设备和遥控器相应配对之后,遥控器只要按下这四个键盘中的其中一个,即可实现遥控器与四者之一进行通信(这是一个很不错的功能)。
下面这个函数和这个功能关系密切:
static void rsaTargetDeviceToggleKeyAction(void)
{
uint8 maxCnt = rsaMaxNumPairingEntries - 1;
uint8 maxIdx = rsaMaxNumPairingEntries;
uint8 idx = (rsaDestIndex == RTI_INVALID_PAIRING_REF) ? 0 : rsaDestIndex;
if (rsaKeyRepeated) // Toggle-Key should not repeat; force user to release key and press again.
{
return;
}
for (uint8 cnt = 0; cnt < maxCnt; cnt++)
{
if (++idx == maxIdx)
{
idx = 0;
}
// Set current pairing table item to the current search index in order to read it.
(void)RTI_WriteItemEx(RTI_PROFILE_RTI, RTI_SA_ITEM_PT_CURRENT_ENTRY_INDEX, 1, &idx);
// RTI_ReadItemEx succeeds only when pairing entry pointed by current entry index is valid.
if (RTI_ReadItemEx(RTI_PROFILE_RTI, RTI_SA_ITEM_PT_CURRENT_ENTRY,
sizeof(rsaPairingEntryBuf), (uint8 *)&rsaPairingEntryBuf) == RTI_SUCCESS)
{
if (rsaTgtDevType == RTI_DEVICE_RESERVED_FOR_WILDCARDS)
{
rsaDestIndex = idx;
return;
}
for (uint8 type = 0; type < RCN_MAX_NUM_DEV_TYPES; type++)
{
if (rsaPairingEntryBuf.devTypeList[type] == rsaTgtDevType)
{
rsaDestIndex = idx;
return;
}
}
}
}
// No valid entry to toggle to, so restore the originally selected entry.
(void)RTI_WriteItemEx(RTI_PROFILE_RTI, RTI_SA_ITEM_PT_CURRENT_ENTRY_INDEX, 1, &rsaDestIndex);
}
rsaTgtDevType为静态全局变量,表示目标设备的类型,在void RSA_KeyCback(uint8 keys, uint8 state)函数中会对其进行相关的初始化,其中有一段如下:
if (cmd >= RSA_TGT_TYPE && cmd != RTI_CERC_RESERVED_1)
{
// Select a target device type
rsaTgtDevType = cmd - RSA_TGT_TYPE;
rsaTargetDeviceToggleKeyAction();
// Reset target device type so that generic device toggle key would work
// with any device types.
rsaTgtDevType = RTI_DEVICE_RESERVED_FOR_WILDCARDS;
}
问题如下:
RSA_TGT_TYPE的值为 0xC0
我在协议栈里面移植都没有找到变量值大于0XC0的按键,而且我一直没有找到“TV,DVD,STB,AUX”这四个按键的定义....大家知道这些在哪里吗?